dS378
dS378
User Manual v2.19
To prevent re-play (or Playback) attacks the command packet includes a Nonce. This takes the
form of a 32-bit (4 byte) random number in positions 12, 13, 14 & 15 of the 16 byte data
packet. For example when you send a Get Status command (0x30) you will get a 16 byte block
returned. The first 8 bytes (0-7) will be as defined for the binary commands. Bytes 8-11 are
unused. Bytes 12-15 contain the Nounce.
Commands with generate and send you a Nounce are:
0x30 – Get Status
0x31 – Set Relay
0x32 – Set Output
Commands which require a Nounce to be sent by you are:
0x31 – Set Relay
0x32 – Set Output
A Nounce is only ever used once, you must always used the most recently issued Nounce.
The following example shows how the Nounce provided by the module is used in the next Set
Relay or Set Ouput command.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Get Status
0x30
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
Response
0x23
0x02
0x12
0x01
0x02
0x7D
0x01
0x0B
xx
xx
xx
xx
0x89
0xAB 0xCD
0xEF
Set Relay
0x31
0x02
0x01
0x00
0x00
0x00
0x00
xx
xx
xx
xx
xx
0x89
0xAB 0xCD
0xEF
Response
0x00
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
0x1A
0x2B
0x3C
0x4D
Set Relay
0x31
0x03
0x01
0x00
0x00
0x00
0x00
xx
xx
xx
xx
xx
0x1A
0x2B
0x3C
0x4D
Response
0x00
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
0xF1
0xE2
0xD3
0xC4
Set Output
0x32
0x04
0x01
xx
xx
xx
xx
xx
xx
xx
xx
xx
0xF1
0xE2
0xD3
0xC4
Response
0x00
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
0x5C
0x47
0x9B
0xED
If the Nounce you send with the command does not match the last one sent to you, then the
Relay (or Output) will not be changed.
No other commands either require or provide a Nounce.
Copyright
© 2016-2017,
Devantech Ltd.
All rights reserved.
34
www.pishrobot.com