Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://wiki.rakwireless.com/doku.php?id=iot-product:rak413
- CRC16 / CCITT
- ---- SEARCH DEVICE ----
- broadcast UDP port 6350 DATA: [0x02] [T] [Q] [I] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
- see RAKInfo.java in http://wiki.rakwireless.com/lib/exe/fetch.php?media=easyconfig_tool_for_android_sdk.zip
- ANSWER:
- [0-5]
- [6-7] Device
- [8-10] Version
- [11-28] MAC
- ---- READ SETTINGS ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [R] [0x00] [0x00] [CRC16_lo] [CRC16_hi] ([0x02 0x54 0x51 0x52 0x00 0x00 0x2A 0x45])
- ANSWER:
- [3] = [R]
- i==6
- while (i < ANSWER_LENGTH)
- {
- if [i] = [I] //Information
- {
- i+=3
- [(i)-(i+1)] Type of device
- [(i+2)-(i+4)] Version
- i+=5
- }
- else if [i] = [N] //Name
- {
- i+=2
- [i] NAME_LENGTH
- i++
- [i - (i+NAME_LENGTH)] Name UTF-8
- i+=NAME_LENGTH
- }
- else if [i] = [M] //MAC
- {
- i+=3
- [(i)-(i+17)] MAC
- i+=17
- }
- else if [i] = [A] //Access
- {
- i+=3
- [i] Access TRUE/FALSE
- i++
- }
- else if [i] = [S] //Sensor settings
- {
- i+=4
- [i] Valve settings TRUE/FALSE
- i++
- [i] SENSORS_COUNT
- i++
- [i] RELAYS_COUNT
- i++
- [i] Dry TRUE/FALSE
- i++
- [i] Cl flag valve
- i++
- [i] Line in config mode
- i++
- [i] Background status
- }
- else if [i] = [s] //Status
- {
- i+=4
- [i] Battery
- i++
- [i] Line 0 status
- i++
- [i] Line 1 status
- i++
- [i] Line 2 status
- i++
- [i] Line3 status
- i++
- [i] Attention!
- }
- else
- {
- i++
- }
- }
- ---- GET SENSOR NAMES ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [N] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
- ANSWER:
- [3] = [N]
- SENSORS_COUNT
- i=6
- FOR (s = 0 -> SENSORS_COUNT)
- {
- [(i+s*21) - (i+(s+1)*21)] Sensor name Cp1251
- i+=21
- }
- ---- GET SENSOR STATUS ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [S] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
- ANSWER:
- [3] = [S]
- i=7
- FOR (s = 0 -> SENSORS_COUNT)
- {
- [i] Sensor[s] signal
- i++
- [i] Sensor[s] line
- i++
- [i] Sensor[s] battary
- i++
- [i] Sensor[s] Attention!
- i++
- }
- ---- GET COUNTER VALUES ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [C] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
- ANSWER:
- [3] = [C]
- i=6
- FOR (s = 0 -> 4)
- {
- [(i)-(i+4)] Counter value 32BIT Unsigned
- i+=5
- }
- ---- GET COUNTER NAMES ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [c] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
- ANSWER:
- [3] = [c]
- SENSORS_COUNT
- i=6
- FOR (s = 0 -> 4)
- {
- [(i+s*21) - (i+(s+1)*21)] Counter name Cp1251
- i+=21
- }
- ---- GET BACKGROUND STATUS ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [B] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
- ANSWER:
- [3] = [B]
- [6] Background status (0 -> -4)
- ---- WRITE NAME ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+3] [N] [0x00] [] .. NAME < 80 .. [] [CRC16_lo] [CRC16_hi]
- ---- WRITE SENSOR NAME ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+4] [n] [0x00] [NAME_LENGTH+1] [NUM_SENSOR] [] .. NAME < 21 Cp1251 .. [] [CRC16_lo] [CRC16_hi]
- ---- WRITE COUNTER NAME ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+4] [c] [0x00] [NAME_LENGTH+1] [NUM_SENSOR] [] .. NAME < 21 Cp1251 .. [] [CRC16_lo] [CRC16_hi]
- ---- WRITE COUNTER VALUE ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [0x17] [C] [0x00] [0x14] [VALUE_COUNTER1 4BYTE] [STEP_COUNTER1] [VALUE_COUNTER2 4BYTE] [STEP_COUNTER2] [VALUE_COUNTER3 4BYTE] [STEP_COUNTER3] [VALUE_COUNTER4 4BYTE] [STEP_COUNTER4] [CRC16_lo] [CRC16_hi]
- ---- WRITE SETTINGS ----
- ---
- ---- WRITE WI-FI NAME ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+3] [W] [0x00] [] .. NAME .. [] [CRC16_lo] [CRC16_hi]
- ---- WRITE WI-FI PASS ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+3] [P] [0x00] [] .. PASS.. [] [CRC16_lo] [CRC16_hi]
- ---- RECONNECT ----
- unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [0x03] [R] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
- ---- FIRMWARE ----
- ---
Add Comment
Please, Sign In to add comment