7.
Cassia RESTful APIs
The Cassia RESTful APIs were developed to enable third-party developers and device
manufacturers to utilize Cassia’s gateway Bluetooth routing and extended range capabilities
while using their Cloud services to connect and control multiple Bluetooth Low Energy
devices per gateway simultaneously.
Furthermore, the Cassia RESTful APIs are designed to integrate directly into the
application/server using an HTTP/HTTPS-based communication protocol, which provides
programming language flexibility. Cassia supports C#, Node.js, and Java, but the user can
choose other languages as needed.
The Cassia RESTful APIs are built into the Cassia IoT Access Controller (AC) and Bluetooth
gateways and provide the following functions:
a.
Monitor Bluetooth gateways and Bluetooth Low Energy devices
b.
Connect and control Bluetooth Low Energy devices
c.
Support three modes: scanning, connecting, broadcasting/advertising
d.
Write/read data to/from the Bluetooth Low Energy device via the Cloud server
e.
Read data as notification/indication events from the Bluetooth Low Energy device via
the Cloud server
f.
Bluetooth 4.2 Secure Pairing
g.
Room based and triangle-based location tracking
Cassia RESTful API supports HTTP (port 80) and HTTPS (port 443). We strongly suggest you to
use HTTPS. Please switch on “Enable HTTPS” in AC setting page and fill in your SSL server
certificate and private key. For more information about how to generate SSL certificate and
key, please see section 5.5.
From firmware 2.1.0, a PHY update API is introduced to support Bluetooth Low Energy 5.0
higher data rates (2M PHY) and long range features. PHY update API is used to switch to a
different PHY after a Bluetooth connection is set up. Different PHY (2M, 1M, Coded w/ S2,
Coded w/ S8) can be used in two directions of a connected device or used in two
connections of two devices. The BLE5.0 advertising extensions don’t need a new API.
NOTE: The maximum number of SSE connections for one gateway is 32. Cassia’s RESTful API
will return '502 Bad Gateway' when this limit is exceeded. Currently, there are 4 types of SSE
connections: "/gap/nodes?event=1", "/gatt/nodes?event=1",
"/management/nodes/connection-state", and "/gap/rssi". It is recommended to maintain
only one stable SSE connection for each type and close unused SSE connections by closing
the HTTP connection. It is not recommended to frequently open and close combined SSE
connections.