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).
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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 1 | Command Id for "Reset" |
1 | Reset Option | 1 | 1 | System Reset |
Response: N/A
Example:
→01 01
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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 2 | Command Id for "Configure" |
1 | Module | 1 | 0: Scanner 1: Transceiver | Module type that IN612L configures to |
2 | SDR broadcast network address | 4 | 32 bit Number | Network address of SDR broadcast. If 0, SDR broadcast is not available |
6 | SDR private network address | 4 | 32 bit Number | Network address of SDR private data exchange. If 0, SDR private data exchange is not available |
10 | SDR address | 2 | 0x0001 - 0xFF | SDR address for gateway when SDR private data exchange. |
Response:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 2 | Command Id for "Configure" |
1 | Result | 2 | Error Code | Command 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
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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 3 | Command Id for "Module Start Control" |
1 | Module | 1 | 0 , 1 | 0: Scanner 1: Transceiver |
2 | SDR Channel | 1 | 1 - 40 | Channel SDR broadcast on. Available only for "Scanner" module. |
3 | SDR Window | 2 | 0 - 4000 | SDR broadcast scan time in microseconds. Available only for "Scanner" module. 0 to stop SDR scan. If SDR is not supported, its value is skipped. |
5 | BLE Channel | 1 | 0 , 37 - 39 | If 0, scan in turn on all three BLE advertising channel; or else scan on fixed channel. |
6 | BLE Window | 2 | 0 - 4000 | BLE advertising scan time in microseconds. Available only for "Scanner" module. 0 to stop BLE scan. |
8 | PHY | 1 | 0: 1M 1: 2M 2: 125K 3: 500K | Physical rate |
2 | Sync Interval | 2 | 0 , 100 - 60000 | The 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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 3 | Command Id for "Module Start Control" |
1 | Result | 2 | 16bits unsigned integer | Command 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
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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 4 | Command Id for "Set Scan Filter" |
1 | Len | 1 | 0 - 10 | Filter bytes array length |
2 | Filter | <Len> | Bytes array | Filter raw bytes array |
Response:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 4 | Command Id for "Set Scan Filter" |
1 | Result | 2 | 16bits unsigned integer | Command Error Code |
Example:
//Set filter manufacturer ID 0x004c (Apple Inc).
→04 02 4C 00
//Command successful.
←04 00 00
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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 5 | Command Id for "SDR Multicast Data" |
1 | Group Id | 1 | 0 - 255 | Group Id that SDR node belongs to |
2 | Duration | 2 | unsigned short | Time that the command executes in ms. 0 to stop. |
4 | Len | 1 | 1 - 251 | SDR multicast data length |
5 | Date | <Len> | - | Multicast data |
Response:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 5 | Command Id for "Set Scan Filter" |
1 | Result | 2 | 16bits unsigned integer | Command 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
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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 6 | Command Id for "SDR Private Data Exchange" |
1 | Virtaul ID | 4 | unsigned long | Virtual ID of SDR node |
5 | Group ID | 1 | unsigned char | Group ID that SDR node belongs |
6 | SDR Node Type | 1 | 6 | 6: SDR Node that support Private Data Exchange |
7 | Len | 1 | 1 - 251 | SDR Private Data length |
8 | Data | <Len> | byte array | SDR Private Data |
Response:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Command Id | 1 | 6 | Command Id for "SDR Private Data Exchange" |
1 | Virtaul ID | 4 | unsigned long | Virtual ID of SDR node |
5 | Group ID | 1 | unsigned char | Group ID that SDR node belongs |
6 | SDR Node Type | 1 | 6 | 4: SDR Broadcast only Node 6: SDR Node that support Private Data Exchange |
7 | Result | 2 | 16bits unsigned integer | Command 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
BLE Connection #
TBD
BLE GATT Service Discovery #
TBD
BLE GATT Read #
TBD
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.
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.
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Event Id | 1 | 0x64 | Event Id for "SDR Broadcast Report" |
1 | Virtaul ID | 4 | unsigned long | Virtual ID of SDR node |
5 | Group ID | 1 | unsigned char | Group ID that SDR node belongs |
6 | SDR Node Type | 1 | 4 | 4: SDR Broadcast only Node 6: SDR Node that support Private Data Exchange |
7 | Time Stamp | 2 | unsigned short | Time stamp in 10ms unit when SDR broadcast is captured |
9 | RSSI | 1 | signed char | Received Signal Strength Indicator in dBm |
10 | Len | 1 | 1 - 27 | SDR broadcast payload length |
11 | Payload | <Len> | byte array | SDR 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
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.
OFFSET | NAME | LENGTH | VALUE | NOTE | ||||
---|---|---|---|---|---|---|---|---|
0 | Event Id | 1 | 0x65 | Event Id for "BLE Advertising Report" | ||||
1 | MAC Adddress | 6 | - | MAC Address of BLE advertiser (Beacon) | ||||
7 | Time Stamp | 2 | unsigned short | Time stamp in 10ms unit when advertisement is captured | ||||
9 | RSSI | 1 | signed char | Received Signal Strength Indicator in dBm | ||||
10 | Flag | 1 | - |
| ||||
11 | Len | 1 | 1 - 27 | BLE advertisement payload length | ||||
12 | Payload | <Len> | byte array | BLE 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
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.
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Event Id | 1 | 0x66 | Event Id for "SDR Private Data Recepiton" |
1 | Virtaul ID | 4 | unsigned long | Virtual ID of SDR node |
5 | Group ID | 1 | unsigned char | Group ID that SDR node belongs |
6 | SDR Node Type | 1 | 6 | 4: SDR Broadcast only Node (Beacon) 6: SDR Node that support Private Data Exchange |
7 | Len | 1 | unsigned char | Data Length |
8 | Data | <Len> | byte array | Data |
Example:
//SDR private data reception from node [0x44,0x01,0x06], data “D4 0A”
←66 44 00 00 00 01 06 02 D4 0A
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:
OFFSET | NAME | LENGTH | VALUE | NOTE |
---|---|---|---|---|
0 | Event Id | 1 | 0x67 | Event Id for "BLE Data Recepiton" |
1 | BLE MAC Address | 6 | - | MAC address of peer BLE peripheral |
7 | Handle | 2 | unsigned short | Handle of GATT characteristic that notify or indicate |
9 | Len | 1 | 0 - 255 | Data length |
10 | Data | <Len> | byte array | Data |
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 Code | Description |
---|---|
0 | Command was executed correctly |
0x1001 | Command was executed with error |
0x0111 | Not Ready |
0x100A | Error Command ID |
0x100B | Error Busy |
0x100D | Error Parameter |
0x100E | Error Timeout |
Others | BLE error |