automotive-message-broker  0.13
 All Classes Files Variables Pages
Websocket Plugin Protocol Documentation
Version
0.13

Back to AMB Documentation Main

Introduction

This document describes the AMB Websocket protocol. The messages are passed either as JSON or in binary format. The binary format is defined by the Qt project. The JSON format is described in protocol.idl.

For information about the using the plugin with AMB, see the plugin documentation

Example javascript

The following is an example of using the websocket protocol in html5. For a more complete example, see the html test.

socket = new WebSocket('ws://localhost:23000/');
socket.onmessage = function (msg)
{
// we got a reply!
console.log(msg);
};
socket.onopen = function() {
var obj = {
"type" : "method",
"name" : "getSupported",
"transactionid" : 'ReallyUniqueId1',
}
socket.send(JSON.stringify(obj));
};