automotive-message-broker  0.13
 All Classes Files Functions Variables Pages
Automotive Message Broker Library Documentation - Bluemonkey Plugin
Version
0.13

Back to AMB Documentation Main

Introduction

Bluemonkey is a javascript rendering engine that allows the scripting of source plugin behavior in javascript. It allows developers a quick way to prototype plugin code as well as a way to create custom properties.

Properties

Bluemonkey uses internal property names (not DBus API interface names). These properties are defined in lib/vehicleproperty.h. There are mappings from AMB internal property names to DBus API properties in the mappings documentation. The mappings comes in handy when you want to implement properties that are exported as an DBus API interface (ie, org.automotive.VehicleSpeed).

Example bluemonkey script

var speedProperty = bluemonkey.subscribeTo("VehicleSpeed");
var testTimer = bluemonkey.createTimer();
testTimer.interval = 3000;
testTimer.singleShot = false;
testTimer.timeout.connect(function() {
//VehicleSpeed
speedProperty.value = Math.floor((Math.random() * 100) + 1);
});
testTimer.start();

API documentation

Javascript API documentation is found in bluemonkey.idl and is described using WebIDL. Plugin configuration documentation can be found in bluemonkey.README.