API Notifications
API notification packets are the same as other JSON-RPC packets, except that they do not have an "id" field. Most of these notifications do not supply anything in the "params" field. These notifications will only be sent if they are enabled using the cbrx_notifications method.
A list of possible notitifcations available using our API can be found in the table below. Most of these notifications do not supply anything in the "params" field.
Notification | Description |
---|---|
all | Request all notifications |
discover-changed | The API detected a change in the available hubs. You should re-run cbrx_discover at this point. |
dead-hub-changed | The API detected that a hub has either become unresponsive or cannot be connected to |
firmware-progress | Request updates on firmware update progress |
over-temperature | Hub is over temperature |
over-voltage | Hub is over voltage |
rfid-received | Receive notification when a RFID card is presented to a sensor |
rfid-removed | Receive notification when an RFID card is removed from a sensor |
usb-device-attached | More detailed than usb-changed, this will tell you of specific devices that have attached. |
usb-device-detached | More detailed than usb-changed, this will tell you of specific devices that have detached. |
under-voltage | Hub is under voltage |
usb-changed | The API detected a change in the USB Tree. |
discover-changed
A change in the hubs that are available to the API has been detected.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "discover-changed"
}
dead-hub-changed
The API detected that a hub has either become unresponsive or cannot be connected to, for example because another program has it's serial port opened.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "dead-hub-changed",
"params": {
"IsDead":True
}
}
firmware-progress
Information on the firmware update progress. For more information on the output see cbrx_firmware (status)
Example notification packet:
{
"jsonrpc": "2.0",
"method": "firmware-progress",
"params": {
"Progress": 60,
"Stage": "flashing",
"Type": "charger",
"HostDevice": "1212343456567878",
"HostSerial": "/dev/tty.usbmodem1421502",
"HostDescription": "PS15-USB3"
}
}
over-temperature
The hub is over operating temperature, see product user manuals for more details.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "over-temperature"
}
over-voltage
The hub is over recomended voltage, see product user manuals for more details.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "over-voltage"
}
rfid-received
An RFID sensor has detected that a RFID card is present.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "rfid-received",
"params": "12784556655489628"
}
rfid-removed
An RFID sensor has detected that a RFID card has been removed.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "rfid-removed",
"params": "12784556655489628"
}
usb-device-attached
A device has become available to the API and a detailed information output is presented about the device.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "usb-device-attached",
"params": {
"HostDevice": "1212343456567878",
"HostSerial": "/dev/tty.usbmodem1421502",
"HostPort": 7,
"HostDescription": "PS15-USB3",
"USB2": {
"Description": "iPhone",
"LocationID": 573710336,
"Manufacturer": "Apple Inc.",
"PID": 4776,
"SerialNumber": "012a37d1fa07617ad7ef0430ba49f479ab9fb6b8",
"USBVersion": 2,
"VID": 1452
}
}
}
usb-device-detached
A device is no longer available to the API and a detailed information output is presented about the device.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "usb-device-detached",
"params": {
"HostDevice": "1212343456567878",
"HostSerial": "/dev/tty.usbmodem1421502",
"HostPort": 7,
"HostDescription": "PS15-USB3",
"USB2": {
"Description": "iPhone",
"LocationID": 573710336,
"Manufacturer": "Apple Inc.",
"PID": 4776,
"SerialNumber": "012a37d1fa07617ad7ef0430ba49f479ab9fb6b8",
"USBVersion": 2,
"VID": 1452
}
}
}
under-voltage
The hub is under recomended voltage, see product user manuals for more details.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "under-voltage"
}
usb-changed
There has been a change in the USB-tree.
Example notification packet:
{
"jsonrpc": "2.0",
"method": "usb-changed"
}