-
Notifications
You must be signed in to change notification settings - Fork 7
MQTT API ‐ Convention
QA edited this page Oct 25, 2024
·
1 revision
- MACs should be uppercase with colons.
- Include in both message body and topic.
- Applies to both gateway and device MACs.
Data Direction | Description |
---|---|
Upstream | Cassia Bluetooth Gateway -> User MQTT Server -> User Application Service |
Downstream | User Application Service -> User MQTT Server -> Cassia Bluetooth Gateway |
Topic | Data Direction | Category | Description |
---|---|---|---|
up/{gateway}/gateway_status | Upstream | GATEWAY_STATUS | Gateway status |
up/{gateway}/heartbeat | Upstream | HEARTBEAT | Heartbeat request |
down/{gateway}/heartbeat_reply | Downstream | HEARTBEAT | Heartbeat response |
down/{gateway}/api | Downstream | API | RESTful API request |
up/{gateway}/api_reply | Upstream | API | RESTful API response |
up/{gateway}/scan | Upstream | BLE Data | BLE scan data |
up/{gateway}/notification | Upstream | BLE Data | BLE notification data |
up/{gateway}/connection_state | Upstream | BLE Data | BLE connection state event |
{
"id": "35656",
"action": "api",
"timestamp": 1678698297028,
"gateway": "CC:1B:E0:E2:8F:2C",
"data": {}
}
Field | Type | Required | Default | Description |
---|---|---|---|---|
id | string | Yes | - | Message ID, unique identifier, consistent with request in responses |
action | string | Yes | - | Distinguishes message type |
timestamp | uint32 | Yes | - | Timestamp in milliseconds |
gateway | string | Yes | - | Gateway MAC address |
data | object | Yes | - | Message payload |
- Use the action field for message processing, not the topic.
- Request/response pairs use {action}/{action}_reply.
- For hierarchical messages, use a period (.) to separate levels.
Action Type | Description |
---|---|
gateway_status | Gateway status |
heartbeat | Heartbeat request |
heartbeat_reply | Heartbeat response |
api | RESTful API request |
api_reply | RESTful API response |
data.scan | BLE scan data |
data.notification | BLE notification data |
data.connection_state | BLE connection state event |
Copyright © 2021 Cassia Networks, Inc.
RESTful API
-
Traffic Related API
- Scan Bluetooth Devices
- Filter Scanned Data based on Device MAC, RSSI, Name, and UUID
- Enhanced Scan Filter (v2.0 and above)
- Connect/Disconnect to a Target Device
- Batch Connect to a Target Device (v2.0 and above)
- Discover GATT Services and Characteristics
- Read/Write the Value of a Specific Characteristic
- Send Advertise Data
- Get Device Connection Status
- Receive Notification and Indication
- Get RSSI for BLE Connection (v2.0 and above)
-
Secure Pairing API
-
Router Auto-Selection API