Developer
Ask a QuestionBlecon WebsiteBlecon Console
  • Learn Blecon
    • Introduction
    • Blecon Modems
      • Device Identity and Network Security
      • Modem Firmware vs Modem Library
      • Using the Modem
      • Communicating with the cloud
      • Sending data from the cloud to a device
    • Blecon Hotspots
    • Blecon Networks
      • Blecon Accounts
      • Registering devices
        • The Blecon Scanner
        • Blecon Scanner Developer Guide
      • Blecon Events
      • Cloud Integrations
  • Cloud Integrations
    • Webhook
    • AWS S3
    • AWS SQS
    • AWS EventBridge
    • Memfault
  • Getting Started Guides
    • Getting started index
    • Install the Blecon Modem Firmware
    • Set up a Blecon Hotspot
    • Use Blecon from your computer with the Blecon CLI
    • Create a Network and register a device
    • Send device requests and events to your web service
    • Use Blecon from a Development Board
    • Use the Blecon Modem from an MCU
  • Device Guides
    • KKM S5-BCN
  • Development Board Guides
    • Supported Development Boards
    • Ezurio DVK-BL54L15
    • Fanstel EV-BM15C
    • InsightSiP ISP2454-LX-EB
    • Nordic nRF52840DK
    • Nordic nRF54L15DK
    • Minew ME54BE01
    • Panasonic PAN-B511 EVB
    • Raytac AN54L15Q-DB
    • u-Blox EVK-NORA-B20
  • Modem Reference
    • Modem Firmware Releases
      • nRF54L15 DK
      • nRF52840 Dongle
      • nRF52840 DK
    • CLI Releases
    • SDK Releases
    • Modem API Reference
    • Modem Protocol Reference
      • Request Frames
      • Command Protocol
      • UART Transport
    • Guides and best practices
      • Retrieve a device's identity
  • Cloud Reference
    • Configuration API
    • Advanced event routing
  • Hotspot Reference
    • Blecon Hub
Powered by GitBook

Get Support

  • Ask a question
On this page
  • Commands List
  • Command Format
  • Commands Details
  • Attention
  • Protocol Version
  • Get Identity
  • Get Device URL
  • Get Info
  • Status
  • Connection Initiate
  • Connection Terminate
  • Outgoing Queue Push
  • Outgoing Queue Space
  • Incoming Queue Pop
  • Incoming Queue Count
  • Incoming Queue Clear
  • Announce
  1. Modem Reference
  2. Modem Protocol Reference

Command Protocol

This page describes the underlying commands exposed by the modem.

Commands List

Id
Command
Description
Request
Response

0x100

Check communication with device

0x101

Get the modem's command protocol version

Protocol version

0x102

Get device's unique identifier

Device Identifier (UUID)

0x103

Get device's URL

Zero-terminated, ASCII-encoded URL

0x104

Get information about the modem

Modem firmware version & uptime

0x200

Read connection status and events

Status & event bits

0x201

Request connection to the Blecon network

0x202

Close or cancel connection

0x203

Queue outgoing frame

Outgoing frame to send

0x204

Get number of free slots in outgoing queue

Number of free slots

0x205

Dequeue incoming response frame

Incoming frame

0x206

Get the number of queued incoming frames

Number of queued frames

0x207

Clear all frames from incoming queue

0x208

Announce the device to nearby Blecon hotspots

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:

4 bytes
n bytes

Request Id

Request Field

The structure of a response is:

2 bytes
n bytes

Error code

Response Field

The response data field is only present when the command executed successfully (error code 0).

Error codes

Code
Description

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:

Field
Size (bytes)
Description

Protocol Version

4

The supported protocol version (2)

Get Identity

Retrieve the Blecon Device Identifier.

Request Id: 0x102

Request field: Empty

Response field:

Field
Size (bytes)
Description

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:

Field
Size (bytes)
Description

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:

Field
Size (bytes)
Description

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:

Field
Size (bytes)
Description

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:

Field
Size (bytes)
Description

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:

Field
Size (bytes)
Description

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:

Field
Size (bytes)
Description

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:

Field
Size (bytes)
Description

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

PreviousRequest FramesNextUART Transport

Last updated 11 months ago

Attention
Protocol Version
Get Identity
Get Device URL
Get Info
Status
Connection Initiate
Connection Terminate
Outgoing Queue Push
Outgoing Queue Space
Incoming Queue Pop
Incoming Queue Count
Incoming Queue Clear
Announce