Command Protocol
This page describes the underlying commands exposed by the modem.
Commands List
Command Format
A command always consists of a request sent by the host MCU, and corresponding response sent back by the Blecon modem.
All data is sent in little endian.
The structure of a request is:
Request Id
Request Field
The structure of a response is:
Error code
Response Field
The response data field is only present when the command executed successfully (error code 0).
Error codes
0
OK
1
Invalid command ID
2
Invalid size
3
Parsing error
4
Invalid state
5
Internal Memory Error
Commands Details
Attention
Check communication with the Blecon modem.
Request Id: 0x100
Request field: Empty
Response field: Empty
Protocol Version
Get the modem's command protocol version.
Request Id: 0x101
Request field: Empty
Response field:
Protocol Version
4
The supported protocol version (2)
Get Identity
Retrieve the Blecon Device Identifier.
Request Id: 0x102
Request field: Empty
Response field:
BDID
16
The Blecon Device Identifier (Version 4 UUID)
Get Device URL
Retrieve the Blecon Device URL used for device connection. This is the same URL exposed by the modem via NFC.
Request Id: 0x103
Request field: Empty
Response field:
Device URL
192
A zero-terminated, ASCII-encoded URL
Get Info
Get information about the modem's firmware & state.
Request Id: 0x104
Request field: Empty
Response field:
Firmware Version
4
The Blecon Modem firmware version
Uptime
4
Time in milliseconds since the modem was started
Status
Get information about the modem's status.
All event bits are set on a specific event, and cleared when read.
Request Id: 0x200
Request field: Empty
Response field:
Status
2
Bit 0: Network Connection Status (1: connected) Bits 1..15: RFU
Events
2
Bit 0: Connection Event
Bit 1: Disconnection Event
Bit 2: Outgoing Queue Space Event
Bit 3: Incoming Queue Data Event Bits 3..31: RFU
Connection Initiate
Request a connection to the Blecon network. Once the connection is available, a connection event is raised.
Request Id: 0x201
Request field: Empty
Response field: Empty
Connection Terminate
Close the current connection to the Blecon network, or stop requesting for one. Issuing this command clears all connection, response and error events.
Request Id: 0x202
Request field: Empty
Response field: Empty
Outgoing Queue Push
Queue a frame to send to the Blecon network. This command will succeed if the queue is not full and the modem connected to the network.
Request Id: 0x203
Request field:
Outgoing request frame
Frame-specific
See request frames description
Response field: Empty
Outgoing Queue Space
Get number of free slots in the outgoing queue.
Request Id: 0x204
Request field: Empty
Response field:
Slots
2
Number of free slots in queue
Incoming Queue Pop
Dequeue an incoming frame received from the Blecon network. This command will succeed if the queue is not empty.
Request Id: 0x205
Request field: Empty
Response field:
Incoming request frame
Frame-specific
See request frames description
Incoming Queue Count
Get the number of frames queued in the incoming queue.
Request Id: 0x206
Request field: Empty
Response field:
Count
2
Number of frames in queue
Incoming Queue Clear
Clear all frames in incoming queue.
Request Id: 0x207
Request field: Empty
Response field: Empty
Announce
Announce the device to nearby hotspots, so that any Blecon hotspot in range can identify the device in order to connect it to a network, or manage it.
Request Id: 0x208
Request field: Empty
Response field: Empty
Last updated