Wireless Communication Protocol

Stellar Gateway Wireless Communication Protocol Implementation Guide #


Purpose #

This guide offers a comprehensive overview of the Stellar Gateway Wireless Communication Protocol, focusing on its practical implementation. Covering the design, functional operation, command structure, and safety precautions, it is tailored for developers, system integrators, and technical professionals who seek a deep understanding of how to effectively employ and optimize devices using the Stella Gateway Wireless Protocol.

Definition Glossary #

BLE (Bluetooth Low Energy): A power-efficient version of the classic Bluetooth wireless technology. It’s designed for short bursts of long-range radio connection, making it perfect for IoT (Internet of Things) applications.

SDR (Software Defined Radio): A radio communication system where traditional hardware components like modulators, demodulators, and tuners are instead implemented in software. This allows for more flexibility and adaptability in handling various frequencies and communication types.

GATT (Generic Attribute Profile): A specification that describes in detail how attributes (data) are transferred once devices have connected using BLE.

GATT Handler: Refers to the specific GATT characteristic or descriptor handle, which identifies a particular piece of data on a BLE device.

BLE Peripheral: Refer to BLE standard Peripheral devices that gateway supports. It can be either BLE advertiser only (BLE beacon) or connectable peripheral devices.

BLE Data Exchange: Refers to BLE data transmission and reception with connectable BLE Peripheral following standard BLE GATT protocol.

SDR Network Address: InPlay SDR devices use two-layer addressing to support network communications. There are network address and device address. The network address is shared by all the devices in an SDR basic network.

SDR Device Address: Each InPlay SDR device is assigned to have a 16-bit address. This address can be used to facilitate private data communication in a network with multiple SDR devices.

SDR Broadcast: A kind of wireless signal transmission by SDR on broadcast channel, which does not concern if signals are actually received no not. In this case, SDR Device Address is not necessary.

SDR Private Data Exchange: A kind of wireless signals transmission by SDR on non-broadcast channel between given SDR node and Stellar Gateway. If acknowledgement is not received from peer, communication is considered failed. In this case, SDR Device Address is necessary for both two sides of communication, in Stellar world, Stellar Gateway and SDR Node.

SDR Node: Refer to slave devices by SDR in the Stellar Gateway network. It can be device that transmit SDR Broadcast only, or one that support SDR Private Data Exchange simultaneously.

Scanner Module: A functional component of Stellar Gateway that actively searches for available devices or signals of either SDR Broadcast or BLE advertisement within its vicinity.

Transceiver Module: A functional component of Stellar Gateway that can transmit and receive signals of either SDR Private Data Exchange or BLE Data Exchange.

Controller: Refers to the dedicated hardware or software component responsible for overseeing, managing, and directing the operations and data flow of the unit. It ensures that signals are received, processed, and transmitted appropriately, interfacing with both the Scanner Module and the Transceiver Module to achieve optimal performance.

Error Code: A system-defined numeric value that signifies a specific type of error or issue encountered during command execution.

Introduction #

The Stellar Gateway Wireless Communication Protocol Implementation Guide delves deep into the Stellar Gateway Wireless Module’s practical use. This module is an integral component in today’s wireless communication ecosystems. It effectively integrates the Scanner and Transceiver modules, with the Controller MCU as the primary interface and managerial component.

System Diagram #

The Stellar Gateway system block diagram is shown in Figure1. The Stella Gateway contains 4 IN612Ls as key parts of Stella Gateway Wireless Modules. From the functional point of view, they can be subdivided into Scanner and Transceiver Module. Also present in the gateway is the Controller module, which serves as the connection between these two wireless modules and an interaction with the host.

Scanner Module: #

Its primary function is to scan SDR Broadcasts or BLE Advertisements. It incorporates three IN612Ls, with each one designated to scan a specific channel.

Transceiver Module: #

One IN612L is in this module which dedicated on SDR P2P Data Exchange or BLE Data Exchange with connectable BLE Peripheral.

Controller: #

A third-party MCU typically processes commands from the host. Upon receiving these commands, it interprets them and sends the relevant data structure to both the Scanner and Transceiver for radio activities. Furthermore, this Controller acquires advertising or broadcasting reports from the Scanner, filters these reports, and subsequently sends a singular event to the Host. In Stella Gateway, the Controller uses AT32F413 and its development is beyond the scope of this document. Please visit ARTERY website for AT32F413 SDK and any reference development documents. This document aims to explain the data exchange protocols between the Controller and the Scanner/Transceiver.

Figure 1: Stella Gateway diagram

Communication Interface #

The interface between each IN612L and the Controller is USART bus. For AT32F413 controller, the USART ports with 612Ls are USART1, USART2, USART3, UART4.

The default USART parameters are as follows:

  • 921600 bps
  • 8 bits
  • No Parity
  • 1 Stop bit
  • Hardware flow control disabled

For interface between Controller and Host, Please refer to Stella Gateway Hardware User Guide for more details.

Command Description #

Data exchanged between the Controller and Scanner/Transceiver is formatted as a byte array. All values follow the Big-endian convention (MSB first).

  1. Module Reset #

This command is used to reset any IN612L in Scanner or Transceiver. It is essential for system maintenance and troubleshooting. The Reset command is unique in that no response is returned upon its execution.

Command:

OFFSETNAMELENGTHVALUENOTE
0Command Id11Command Id for "Reset"
1Reset Option11System Reset

Response: N/A

Example:

→01 01

  1. Module Configure #

This command configures the type of IN612L, either as Scanner or Transceiver, as well as the SDR Broadcast access address and SDR P2P Data Exchange access address. It’s core setting command that must be executed first for system initialization. Once executed, it should NOT be called again unless the “Reset” command is issued.

Command:

OFFSETNAMELENGTHVALUENOTE
0Command Id12Command Id for "Configure"
1Module10: Scanner
1: Transceiver
Module type that IN612L configures to
2SDR broadcast network address432 bit NumberNetwork address of SDR broadcast. If 0, SDR broadcast is not available
6SDR private network address432 bit NumberNetwork address of SDR private data exchange. If 0, SDR private data exchange is not available
10SDR address20x0001 - 0xFFSDR address for gateway when SDR private data exchange.

Response:

OFFSETNAMELENGTHVALUENOTE
0Command Id12Command Id for "Configure"
1Result2Error CodeCommand Error Code

Example:

//Configure 612L as Scanner. SDR Broadcast on netword address 0x11223344, SDR Private Data Exchange on network address 0x33445566, and gateway’s SDR address is 1.
→02 00 44 33 22 11 66 55 44 33 01 00

//Configure 612L as Transceiver. SDR Broadcast on netword address 0x11223344, SDR Private Data Exchange on network address 0x33445566, and gateway’s SDR address is 1.
→02 01 44 33 22 11 66 55 44 33 01 00

//Command successful.
←02 00 00

  1. Module Start Control #

This command provides dynamic operational control (start or stop) of the Scanner or Transceiver. Only IN612L with same Module type which is set via “Configure” command can accept this command with same “Module” parameters.

Command:

OFFSETNAMELENGTHVALUENOTE
0Command Id13Command Id for "Module Start Control"
1Module10 , 10: Scanner
1: Transceiver
2SDR Channel11 - 40Channel SDR broadcast on. Available only for "Scanner" module.
3SDR Window20 - 4000SDR broadcast scan time in microseconds. Available only for "Scanner" module. 0 to stop SDR scan. If SDR is not supported, its value is skipped.
5BLE Channel10 , 37 - 39If 0, scan in turn on all three BLE advertising channel; or else scan on fixed channel.
6BLE Window20 - 4000BLE advertising scan time in microseconds. Available only for "Scanner" module. 0 to stop BLE scan.
8PHY10: 1M
1: 2M
2: 125K
3: 500K
Physical rate
2Sync Interval20 , 100 - 60000The time interval at which the Transceiver will transmit a synchronization signal. 0 to stop synchronization signal transmission. The shorter synchronize interval is, the more frequently SDR nodes wake up to exchange data with gateway and raise date rate of SDR Private Data Exchange accordingly. The cost is power consumption of the node. Available only for "Transceiver" module. If SDR is not supported, its value is skipped.

Response:

OFFSETNAMELENGTHVALUENOTE
0Command Id13Command Id for "Module Start Control"
1Result216bits unsigned integerCommand Error Code

Example:

//Start SDR broadcast only scan every 1000ms on channel 15 on 1M PHY.
→03 00 0F E8 03 00 00 00 00

//Start BLE advertising only scan every 1000ms on all 37 to 39 channels on 125K coded PHY.
→03 00 00 00 00 00 E8 03 02

//Start Transceiver with sync interval 100ms.
→03 01 64 00

//Error Scanner parameter not set (0x0111).
←03 11 01

  1. Set Scan Filter #

This command allows setting a filter for the Scanner based on specific criteria to help in narrowing down and focusing on specific data while scanning. This command is allowed be executed dynamically while Scanner has started. Another way is to stop Scanner first, set the filter and start again, which makes scan report more clear and accurate. This command is acceptable for Scanner only.

Command:

OFFSETNAMELENGTHVALUENOTE
0Command Id14Command Id for "Set Scan Filter"
1Len10 - 10Filter bytes array length
2Filter<Len>Bytes arrayFilter raw bytes array

Response:

OFFSETNAMELENGTHVALUENOTE
0Command Id14Command Id for "Set Scan Filter"
1Result216bits unsigned integerCommand Error Code

Example:

//Set filter manufacturer ID 0x004c (Apple Inc).
→04 02 4C 00

//Command successful.
←04 00 00

  1. SDR Multicast Data #

This command initiates SDR multicast data to SDR nodes. Multicast data is transmitted over synchronizing signals in Transceiver as a result all kinds of SDR nodes can receive data. But it’s up to SDR node’s implementation (group id match etc.) whether data is acceptable. This command is acceptable for Transceiver module only.

Command:

OFFSETNAMELENGTHVALUENOTE
0Command Id15Command Id for "SDR Multicast Data"
1Group Id10 - 255Group Id that SDR node belongs to
2Duration2unsigned shortTime that the command executes in ms. 0 to stop.
4Len11 - 251SDR multicast data length
5Date<Len>-Multicast data

Response:

OFFSETNAMELENGTHVALUENOTE
0Command Id15Command Id for "Set Scan Filter"
1Result216bits unsigned integerCommand Error Code

Example:

//Send multicast data “00 01” to SDR nodes with group id 1 for 1000ms
→05 01 03 e8 02 00 01

*//Command completes successfully
←05 00 00

  1. SDR Private Data Exchange #

This command initiates SDR Private Data Exchange between Transceivers and single SDR nodes that support private data exchange. It’s direct, private two-way communication between node and gateway. This command is acceptable for Transceiver only.

Command:

OFFSETNAMELENGTHVALUENOTE
0Command Id16Command Id for "SDR Private Data Exchange"
1Virtaul ID4unsigned longVirtual ID of SDR node
5Group ID1unsigned charGroup ID that SDR node belongs
6SDR Node Type166: SDR Node that support Private Data Exchange
7Len11 - 251SDR Private Data length
8Data<Len>byte arraySDR Private Data

Response:

OFFSETNAMELENGTHVALUENOTE
0Command Id16Command Id for "SDR Private Data Exchange"
1Virtaul ID4unsigned longVirtual ID of SDR node
5Group ID1unsigned charGroup ID that SDR node belongs
6SDR Node Type164: SDR Broadcast only Node
6: SDR Node that support Private Data Exchange
7Result216bits unsigned integerCommand Error Code

Example:

//Send data “00 01” to SDR node [0x01, 0x01, 0x06]
→06 01 00 00 00 01 06 02 00 01

*//Command completes successfully
←06 01 00 00 00 01 06 00 00

  1. BLE Connection #

TBD

  1. BLE GATT Service Discovery #

TBD

  1. BLE GATT Read #

TBD

  1. BLE GATT Write #

TBD

Event Description #

When scanning, due to high-capacity nodes that gateway supports and limited resources of 612L, SDR Broadcast Report and BLE Advertising Report are dispatched in a structured manner, where the data frame is of a fixed size of 39 bytes. In this context:

  • An SDR broadcast signifies a method by which a software-defined radio sends information.

  • A BLE advertisement indicates that a Bluetooth Low Energy device is publicly broadcasting data, often for discovery by other devices.

For this notification, if payload of an SDR broadcast or BLE advertisement exceeds 31 bytes, scanner will discard the rest and hense the payload is not complete.

During private data exchange, transceivers are devices that both transmit and receive data. In this context, Transceiver event may be either data from given SDR node when engaged in SDR Private Data Exchange or BLE GATT Notification Data from BLE connectable peripheral.

  1. SDR Broadcast Report #

The SDR Broadcast Report is an event in which the Scanner notifies the system when it captures an SDR broadcast. The detailed information about this broadcast is tabulated in the format mentioned, which includes the event ID, virtual ID of the SDR node, the group ID of the SDR node, etc. The event example demonstrates the structure in which the data is presented.

OFFSETNAMELENGTHVALUENOTE
0Event Id10x64Event Id for "SDR Broadcast Report"
1Virtaul ID4unsigned longVirtual ID of SDR node
5Group ID1unsigned charGroup ID that SDR node belongs
6SDR Node Type144: SDR Broadcast only Node
6: SDR Node that support Private Data Exchange
7Time Stamp2unsigned shortTime stamp in 10ms unit when SDR broadcast is captured
9RSSI1signed charReceived Signal Strength Indicator in dBm
10Len11 - 27SDR broadcast payload length
11Payload<Len>byte arraySDR broadcast payload

Example:

//SDR Broadcast from node [0x44,0x01,0x04], RSSI is 0xB6 (-74dBm), payload “D4 0A”
←64 44 00 00 00 01 04 51 86 B6 02 D4 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

  1. BLE Advertising Report #

The BLE Advertising Report is an event when the Scanner captures a BLE advertisement. Information related to this event includes the event ID, BLE Mac Address, timestamp of the event, Received Signal Strength Indicator (RSSI), and other relevant data. An example to depict this structure is also provided.

OFFSETNAMELENGTHVALUENOTE
0Event Id10x65Event Id for "BLE Advertising Report"
1MAC Adddress6-MAC Address of BLE advertiser (Beacon)
7Time Stamp2unsigned shortTime stamp in 10ms unit when advertisement is captured
9RSSI1signed charReceived Signal Strength Indicator in dBm
10Flag1-
Bit 7:1Reserved
Bit 00: Non-connectable
1: Connectable
11Len11 - 27BLE advertisement payload length
12Payload<Len>byte arrayBLE advertisement payload

Example:

BLE advertising from 00:01:02:03:04:AB, RSSI is 0xAC (-84dBm), payload “07 09 49 6E 50 6C 61 79”
←65 AB 04 03 02 01 00 94 C1 AC 01 07 09 49 6E 50 6C 61 79 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

  1. SDR Private Data Reception #

The SDR Private Data Reception event signifies the reception of data directly from given SDR node. This event captures the essence of the data being transmitted from given SDR node that support private data exchange, which include details such as the virtual ID, group ID, type of SDR node, and the data itself. The accompanying example provides clarity on the data structured representation.

OFFSETNAMELENGTHVALUENOTE
0Event Id10x66Event Id for "SDR Private Data Recepiton"
1Virtaul ID4unsigned longVirtual ID of SDR node
5Group ID1unsigned charGroup ID that SDR node belongs
6SDR Node Type164: SDR Broadcast only Node (Beacon)
6: SDR Node that support Private Data Exchange
7Len1unsigned charData Length
8Data<Len>byte arrayData

Example:

//SDR private data reception from node [0x44,0x01,0x06], data “D4 0A”
←66 44 00 00 00 01 06 02 D4 0A

  1. BLE Data Reception #

The BLE Data Reception is an event where the Transceiver receives data from BLE connectable node via GATT notification/indication method. The specifics of this event encapsulate the event ID, BLE peripheral’s MAC Address, and the data length received, along with the actual data payload. An example is provided to elucidate the structured format of the received data.

Event:

OFFSETNAMELENGTHVALUENOTE
0Event Id10x67Event Id for "BLE Data Recepiton"
1BLE MAC Address6-MAC address of peer BLE peripheral
7Handle2unsigned shortHandle of GATT characteristic that notify or indicate
9Len10 - 255Data length
10Data<Len>byte arrayData

Example:

//BLE notify data from 11:22:33:44:55:66, handle is 0x0010, data is “D4 0A”.
←67 66 55 44 33 22 11 10 00 02 D4 0A

Error Code #

The error codes serve as a standardized way of communicating issues or successes between a device or system and its user or another system. Recognizing and understanding these codes can assist in diagnosing problems, troubleshooting, and ensuring smoother operations.

Error CodeDescription
0Command was executed correctly
0x1001Command was executed with error
0x0111Not Ready
0x100AError Command ID
0x100BError Busy
0x100DError Parameter
0x100EError Timeout
OthersBLE error