I/O Sample Indicator - 0x92

Description

This frame type is emitted when a device configured with standard API output—AO (API Options) = 0—receives an I/O sample frame from a remote device. Only devices running in API mode will send I/O samples out the serial port.

Format

The following table provides the contents of the frame. For details on frame structure, see API frame specifications.

Offset Size Frame Field Description
0 8-bit Start Delimiter Indicates the start of an API frame.
1 16-bit Length Number of bytes between the length and checksum.
3 8-bit Frame type

I/O Sample Indicator - 0x92

4 64-bit 64-bit source address

The sender's 64-bit IEEE address.

12 16-bit Reserved

Unused, but typically 0XFFFE.

14 8-bit Receive options

Bit field of options that apply to the received message:

  • Bit 0: Packet was Acknowledged [0x01]
  • Bit 1: Packet was sent as a broadcast [0x02]

Note Option values may be combined.

15 8-bit Number of samples The number of sample sets included in the payload. This field typically reports 1 sample.
16 16-bit Digital sample mask

Bit field that indicates which I/O lines on the remote are configured as digital inputs or outputs, if any:

bit 0: DIO0

bit 1: DIO1

bit 2: DIO2

bit 3: DIO3

bit 4: DIO4

bit 5: DIO5

bit 6: DIO6

bit 7: DIO7

bit 8: DIO8

bit 9: DIO9

bit 10: DIO10

bit 11: DIO11

bit 12: DIO12

bit 13: DIO13

bit 14: DIO14

bit 15: N/A

For example, a digital channel mask of 0x002F means DIO 0, 1, 2, 3, and 5 are enabled as digital I/O.

18 8-bit Analog sample mask

Bit field that indicates which I/O lines on the remote are configured as analog input, if any:

bit 0: AD0

bit 1: AD1

bit 2: AD2

bit 3: AD3

bit 7: Supply Voltage (enabled with V+ command)

19 16-bit Digital samples (if included)

If the sample set includes any digital I/O lines (Digital channel mask > 0), this field contain samples for all enabled digital I/O lines. If no digital lines are configured as inputs or outputs, this field will be omitted.

DIO lines that do not have sampling enabled return 0. Bits in this field are arranged the same as they are in the Digital channel mask field.

22 16-bit variable Analog samples (if included) If the sample set includes any analog I/O lines (Analog channel mask > 0), each enabled analog input returns a 16-bit value indicating the ADC measurement of that input.
Analog samples are ordered sequentially from AD0 to AD3.
EOF 8-bit Checksum 0xFF minus the 8-bit sum of bytes from offset 3 to this byte (between length and checksum).

Examples

Each example is written without escapes (AP = 1) and all bytes are represented in hex format. For brevity, the start delimiter, length, and checksum fields have been excluded.

I/O sample

A device with the 64-bit address of 0013A20012345678 is configured to periodically send I/O sample data to a particular device. The device is configured with DIO3, DIO4, and DIO5 configured as digital I/O, and AD1 and AD2 configured as an analog input.

The destination will emit the following frame:

7E 00 16 92 00 13 A2 00 12 34 56 78 FF FE C1 01 00 38 06 00 28 02 25 00 F8 E8 
Frame type 64-bit source Reserved Rx options Num samples Digital channel mask Analog channel mask Digital samples Analog sample 1 Analog sample 2
0x92

0x0013A200
12345678

0x87AC 0xC1 0x01 0x0038 0x06 0x0028 0x0225 0x00F8
Sample
Unused ACK was sent in mesh network Single sample (typical)

b'00111000

DIO3, DIO4, and DIO5 enabled

b'0110

AD1 and AD2 enabled

b'00101000

DIO3 and DIO5 are HIGH; DI04 is LOW

AD1 data

AD2 data