BLE Proxy overview
What is BLE Proxy?
When a YP-hosted device is not connected to WiFi or is not WiFi-enabled, communication between the cloud and the device does not happen in real time. Changes to settings, action requests, or notifications generated by the device therefore need to be relayed from the offline device to the cloud by physically visiting it with the mobile app (i.e. “touring” it).
On YP, this is done via what is known as BLE Proxy, available in the YP Device Communication SDK. BLE Proxy acts as a bridge between the device and cloud by maintaining a secure BLE session with the device while forwarding messages. All messages being relayed are encrypted. BLE Proxy does not know the content of the payloads it is relaying.
Which SDK do I need?
The YP Device Communication SDK, available on iOS and Android, provides the BLE Proxy functionality. This is the same SDK that is used for initial setup of a YP-hosted device, including scanning nearby devices, obtaining the claim token, and connecting a device to WiFi.
Please see the README file in GitHub for more details.
GraphQL and BLE Proxy use cases
BLE Proxy relays messages between the cloud and the device when a device is offline. Depending on the workflow, there are different SDK actions that need to be used (see the README file for additional details):
- syncProperties, which relays messages from the cloud to the device relating to updating a setting value, such as AutoRelockDelayV1. Typically, this covers any trait action mutation that includes the word “Set”, e.g. SetAutoRelockDelay. Any DEVICE_STATE_UPDATED or DEVICE_BULK_DATA_STATE_UPDATED event requires syncProperties;
- syncDeviceCommands, which relays messages from the cloud to the device relating to an action request. Typically, any trait action mutation with "Execute", "Trigger", or "Schedule" would require syncDeviceCommands. Current examples are:
- syncTelemetry, which relays device-generated messages from the device to the cloud, such as notifications regarding battery levels (see BatteryV1). Any DEVICE_NOTIFICATION_REPORTED event requires syncTelemetry.
What made this section unhelpful for you?
On this page
- BLE Proxy overview