This repository has been archived by the owner on Aug 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
SWAP Protocol Decoder Encoder
danbim edited this page Apr 6, 2011
·
7 revisions
The SWAP protocol provides an easy and lightweight alternative to service oriented application level protocols like the Constrained Application Protocol (CoAP).
0: CMD_TYPE = 70
1: REQUEST_ID
2: REQUEST_TYPE
3: REQUEST_OPTIONS_LENGTH
4-n: REQUEST_OPTIONS
0: CMD_TYPE = 71
1: REQUEST_ID
2: RESPONSE_CODE
3: RESPONSE_PAYLOAD_LENGTH
4-n: RESPONSE_PAYLOAD
0: CMD_TYPE = 72
1: SUBSCRIPTION_ID
2: PAYLOAD_LENGTH
3-n: PAYLOAD
The following table shows the possible values for the various fields of request and response messages:
REQUEST_TYPE | REQUEST_OPTIONS | RESPONSE_PAYLOAD |
---|---|---|
0x00 GET_SENSORS | newline character-separated string of sensor names and associated key-value pairs, e.g., "temp=1\nhumid=2\nacc=3" | |
0x01 GET_SENSORNODE_META_DATA | key-value pairs, newline character-separated, e.g., "type=isense\nrevision=jennic85391" | |