Dfence - Sensor Control Protocol Specification - MD
Dfence - Sensor Control Protocol Specification - MD
Data types
uint8_t // 1 byte
float // 4 bytes
zone_index_t
byte, zone index.
Possible values: - .
uint8_t zone_index;
version_t
Zone version.
name, build, date and time are strings are encoded as ASCII
channel_mem_t
Channel configration.
channel_t
Channel runtime data + channel configuration.
device_t
Device runtime
// status bits:
// 0: Digital Input A
// 1: Tamper
// 2: Channels A
// 3: Digital Input B
// 4: Channels B
// 5-7: [spare]
status:
Device status code of value x means an errors on both Digital Input A and Channels A
log_channel_data_t
uint8_t channel; // channel index
uint8_t status; // channel status
// 1: Cable disconnected
// 2: Difference
// 3: Error (Low)
// 4: Error (High)
// 5-7: [spare]
channel_values_t
uint8_t channel; // channel index. 0-15
uint8_t enabled; // 0x00 or 0x01. (Disable: 0x00, Enable: 0x01)
float difference; // difference
Command structure
length: uint
Device commands
Read version
Read zone version.
0x000a (zone-id)
Example (zone # ):
x A x x
0x000b (version)
Clear alarm
Clears and resets current alarm state.
0x0006 (zone-id)
Example (zone # ):
x x x
0x0007 (device-status)
Reset
command (uint16) Zone (zone_index_t)
0x000c (zone-id)
Example (zone # ):
x c x x
Reset (reponse)
command (uint16)
0x000d
Read log
command (uint16) Zone (zone_index_t)
0x0011 (zone-id)
Example (zone # ):
x x x
Read log response will always end with “end of log” packet (packet type # ).
0x0012 (channel-log)
0x0014
Read status
command (uint16) Zone (zone_index_t)
0x0008 (zone-id)
Example (zone # ):
x x x
0x0007 (device-status)
0x0010 (mem)
Example
Send (read version packet):
11 55 22 55 33 55 03 00 0A 00 00 0A
Get version of zone # :
11 55 22 55 33 55 03 00 0A 00 01 0B
66 52 00 0B 00 53 65 6E 73 6F 72 73 20 63 6F 6E fR...Sensors con
74 72 6F 6C 6C 65 72 20 5B 6C 6F 67 67 65 72 20 troller [logger
31 36 43 48 5D 31 2E 31 32 30 00 00 00 00 00 00 16CH]1.120......
00 00 00 00 00 4F 63 74 20 33 31 20 32 30 31 38 .....Oct 31 2018
00 00 00 00 00 31 35 3A 30 36 3A 34 31 00 00 00 .....15:06:41...
00 00 00 00 00 F2 AA .....òª
In this example:
time: 15:06:41