{"_id":"57fdb17c4defec0e00642290","category":{"_id":"57fdb520bcc07b0e00d1ef41","__v":0,"project":"5581248904ae5b0d0026289a","version":"57fdb17c4defec0e0064228b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-10-12T03:59:28.475Z","from_sync":false,"order":1,"slug":"guides","title":"Guides"},"parentDoc":null,"version":{"_id":"57fdb17c4defec0e0064228b","project":"5581248904ae5b0d0026289a","__v":2,"createdAt":"2016-10-12T03:43:56.009Z","releaseDate":"2016-10-12T03:43:56.009Z","categories":["57fdb17c4defec0e0064228c","57fdb17c4defec0e0064228d","57fdb17c4defec0e0064228e","57fdb520bcc07b0e00d1ef41"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"__v":0,"project":"5581248904ae5b0d0026289a","user":"557e2561eb75d80d00af3dab","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-06-18T03:18:45.199Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Discovery\"\n}\n[/block]\n1. Send [Device::GetService](doc:device-messages#section-getservice-2) as a UDP broadcast to port 56700 with the [Frame](doc:header-description#frame) _tagged_ field set to one (1).\n2. All devices on LAN should respond back with one or more [Device::StateService](doc:device-messages#section-stateservice-3) messages.\n3. Clients can then send further messages directly to individual devices or broadcast them.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/I7URyKh8SLuvpdyc9QOj_discovery.png\",\n        \"discovery.png\",\n        \"579\",\n        \"208\",\n        \"#ac0434\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request with acknowledgement\"\n}\n[/block]\n1. Discover devices as above.\n2. Set the source field with a unique 32-bit number, it does not have to be globally unique.\n3. Use the wrap around sequence as a message id.\n4. Set the ack_required field to 1\n5. Send message and it is acknowledged with [Device::Acknowledgement](doc:device-messages#section-acknowledgement-45) having same source and sequence.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Q4COCrwzT2Oa2QRDahtV_request-with-ack.png\",\n        \"request-with-ack.png\",\n        \"904\",\n        \"332\",\n        \"#ac0535\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request with response\"\n}\n[/block]\n1. Discover devices as above.\n2. Set the source field with a unique 32-bit number, it does not have to be globally unique.\n3. Use the wrap around sequence as a message id.\n4. Set the res_required field to 1\n5. Send message and a corresponding semantic reply is sent back having same source and sequence.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/tzQlY64rQXyCDD6WTeBP_request-with-response.png\",\n        \"request-with-response.png\",\n        \"871\",\n        \"332\",\n        \"#ab0434\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request with acknowledgement and response\"\n}\n[/block]\n1. This is a mix of the above 2 workflows.\n2. The device sends back an acknowledgment initially and then a corresponding semantic reply.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7mjfsOoZRheFQzv7IBgC_request-with-ack-and-response.png\",\n        \"request-with-ack-and-response.png\",\n        \"908\",\n        \"387\",\n        \"#ac0434\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"workflow-diagrams","type":"basic","title":"Workflow Diagrams"}
[block:api-header] { "type": "basic", "title": "Discovery" } [/block] 1. Send [Device::GetService](doc:device-messages#section-getservice-2) as a UDP broadcast to port 56700 with the [Frame](doc:header-description#frame) _tagged_ field set to one (1). 2. All devices on LAN should respond back with one or more [Device::StateService](doc:device-messages#section-stateservice-3) messages. 3. Clients can then send further messages directly to individual devices or broadcast them. [block:image] { "images": [ { "image": [ "https://files.readme.io/I7URyKh8SLuvpdyc9QOj_discovery.png", "discovery.png", "579", "208", "#ac0434", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Request with acknowledgement" } [/block] 1. Discover devices as above. 2. Set the source field with a unique 32-bit number, it does not have to be globally unique. 3. Use the wrap around sequence as a message id. 4. Set the ack_required field to 1 5. Send message and it is acknowledged with [Device::Acknowledgement](doc:device-messages#section-acknowledgement-45) having same source and sequence. [block:image] { "images": [ { "image": [ "https://files.readme.io/Q4COCrwzT2Oa2QRDahtV_request-with-ack.png", "request-with-ack.png", "904", "332", "#ac0535", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Request with response" } [/block] 1. Discover devices as above. 2. Set the source field with a unique 32-bit number, it does not have to be globally unique. 3. Use the wrap around sequence as a message id. 4. Set the res_required field to 1 5. Send message and a corresponding semantic reply is sent back having same source and sequence. [block:image] { "images": [ { "image": [ "https://files.readme.io/tzQlY64rQXyCDD6WTeBP_request-with-response.png", "request-with-response.png", "871", "332", "#ab0434", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Request with acknowledgement and response" } [/block] 1. This is a mix of the above 2 workflows. 2. The device sends back an acknowledgment initially and then a corresponding semantic reply. [block:image] { "images": [ { "image": [ "https://files.readme.io/7mjfsOoZRheFQzv7IBgC_request-with-ack-and-response.png", "request-with-ack-and-response.png", "908", "387", "#ac0434", "" ] } ] } [/block]