User's Manual

Enhanced Class 1 Bluetooth v2.1 Module
User’s Guide
Americas: +1-800-492-2320 Option 2
Europe: +44-1628-858-940
Hong Kong: +852-2923-0610
www.lairdtech.com/wireless
99
CONN-GUIDE-BT740_v0.2
8.16.7 Get Digital/Analog I/O
This command reads the states of up to 16 digital input lines and optionally requests an analogue input
reading.
This response packet contains two octets containing the digital input states. If an analogue input reading
is requested then the ADC reading is supplied in an EVENT_ADC event.
Command Packet
Offset
Field
Value
Comments
0
LENGTH
6
Fixed
1
CHANNEL
0
Fixed
2
COMMAND
[CMD_GET_IO]
3
FLOW_IN
??
Runtime value
4
digId
0
0 = Digital I/o in Module
5
analogId
0
0 = No ADC access
1..255 = FUTURE USE
See Note 1
Response Packet
Offset
Field
Value
Comments
0
LENGTH
Fixed
1
CHANNEL
0
Fixed
2
COMMAND
[CMD_GET_IO]
3
FLOW_OUT
??
Runtime value
4
STATUS
As appropriate
5
digId
0
Echoed from command packet
6..7
digIn[2]
??
Digital inputs 0 to 15. Bit 15 is
bit 7 in the MSB.
See Note 2
Note 1: If the analogID field in the command is non-zero, and EVENT_ADC generates when the ADC
is read and available.
Note 2: Bit 0 corresponds to GPIO0, Bit 1 corresponds to GPIO1, etc. Refer to the module’s data
sheet to check which GPIO pins are available for use.