Open Connection And Authentication; Send Messages - Bosch rexroth ActiveShuttle System Manual

Hide thumbs Also See for rexroth ActiveShuttle:
Table of Contents

Advertisement

146

8.3.1 Open connection and authentication

The endpoint for web socket communications is under the '/ies' path. Every client that connects must send
an "AUTHORIZE" message with the API-Key configured for the server to be able to send and receive data.
The schemas for sending the query and result are as follows:
{ "authorize": { "id": "#/ies/authorize", "name": "AUTHORIZE", "description":
"Authorization message that needs to be send to initiate
"object", "properties": { "apiKey": { "type":
}, "authorizeResult": { "id": "#/ies/authorizeResult", "description":
for auth message. Welcome is ACK, Nope is NACK, Hello again means the channel was
already
authorized", "type": "object", "properties": { "resultCode": { "type":
"integer", "min": 0 }, "resultText": { "type": "string", "enum": [ "Hello",
again",
"Nope"
] } } } }
→ Connect and authorize in javascript as follows (example-implementation):
var
socket = io(<AMS-URL>, { path:
{
console.log('Socket
(res) => {
if
(res.resultCode > 0) {
return; }
 console.log('Socket authorized. Ready for
socket.on('reconnect', () => {
suggest to wait a few seconds after server reconnect setTimeout(() =>
{ socket.emit('AUTHORIZE', { apiKey: "<API-KEY>" }, (res) => { if (res.resultCode >
0) { console.error('Authorization failed!', res); return; } console.log('Socket
authorized. Ready for usage!'); } }, 5000); });

8.3.2 Send messages

After a successful log in, the client sends different messages to the AMS.
1.1.1.1. Add Job
Add Job allows to add a Job with a given priority to the ledger list.
→ Issue a 'JOB_ADD' message with the corresponding JSON object as payload as follows:
{ "jobAdd": { "id": "#/ies/jobAdd", "name": "JOB_ADD", "type": "object", "properties":
{ "externalId": { "type": "string", "description":
System"
}, "name": { "type":
"destination": { "$ref":
"integer", "description":
"requiredDeliveryTime": { "type": "integer", "description":
target completion time"
Timestamp of the job priority: Time of the latest acceptable job execution.
1
} }, "required": [ "externalId", "source",
 If the /ies/location is as follows (JSON schema):
{ "location": { "id": "#/ies/location", "type": "object", "properties": { "id": {
"type": "string", "description":
] } }
 The server answer will look like this:
RA91390962 AB-V1.3.3, en
'/ies'
connected'); socket.emit('AUTHORIZE', { apiKey:
console.error('Authorization
// Due to server initzialization it is currently
"string"
}, "source": { "$ref":
"#/ies/location"
"UNIX Timestamp of the target start time"
}, "priority": { "type": "integer", "description":
"ID of the location in AMS"
ILS, ActiveShuttle | External Interface
connection", "type":
"string"
} }, "required": [
}); socket.on('connect', () =>
usage!'); } });
"ID of the job in the external
"#/ies/location"
}, "requiredPickupTime": { "type":
"UNIX Timestamp of the
"destination"
] } }
} }, "required": [
"apiKey"
]
"ACK or NACK
"Hello
"<API-KEY>"
},
failed!', res);
},
},
"UNIX
", "min":
"id"

Advertisement

Table of Contents
loading

Table of Contents