This document covers the Bluetooth Low Energy (BLE) communication protocols used by RADR to communicate with supported devices.
BLE Overview
RADR uses Bluetooth Low Energy (BLE) for all device communication. As a BLE central device, RADR scans for and connects to peripheral devices like the OSSM and Lovense toys.
Parameter Value BLE Role Central Device Name OSSM-REMOTE Transmit Power 9 dBm Stack NimBLE
Scan Parameters
Parameter Value Scan Interval 100ms Scan Window 100ms Scan Type Active Scan Duration 5000ms (5 seconds)
During active scanning, RADR sends scan request packets to devices to retrieve their full advertising data, including device names.
Connection Parameters
RADR uses optimized connection parameters for responsive control:
Parameter Value Description Min Interval 12 15ms minimum connection interval Max Interval 12 15ms maximum connection interval Latency 0 No slave latency (immediate responses) Supervision Timeout 150 1500ms timeout for lost connections Connect Timeout 5000ms Maximum time to establish connection
The 15ms connection interval provides responsive control with minimal latency between encoder turns and device response.
Device Discovery
RADR identifies supported devices by their advertised service UUIDs:
Research And Desire Devices
Device Service UUID OSSM 522B443A-4F53-534D-0001-420BADBABE69LKBX Pending implementation DTT Pending implementation
Lovense Devices
Device Service UUID Domi 2 57300001-0023-4BD4-BBD5-A6920E4C5653Other Via Buttplug.io registry
Buttplug.io Devices
Devices supported via the Buttplug.io protocol are identified using UUIDs from the dynamic registry (registry.json). This registry can be updated via firmware updates without code changes.
OSSM Protocol
RADR communicates with OSSM using a custom BLE protocol:
Service Structure
Service: 522B443A-4F53-534D-0001-420BADBABE69
├── Position Characteristic
├── Speed Characteristic
├── Depth Characteristic
├── Sensation Characteristic
├── Stroke Characteristic
└── Pattern Characteristic
Commands are sent as byte arrays to the appropriate characteristic:
Parameter Data Type Range Speed uint8_t 0-100 Depth uint8_t 0-100 Sensation uint8_t 0-100 Stroke uint8_t 0-100 Pattern uint8_t Pattern index
Pattern Selection
Patterns are selected by index:
Index Pattern Name 0 Simple Stroke 1 Teasing Pounding 2 Robo Stroke 3 Half’n’Half 4 Deeper 5 Stop’n’Go 6 Insist
Lovense Protocol
For Lovense devices with direct integration (Domi), RADR uses the Lovense BLE protocol:
Vibration Control
Command: Vibrate:{level};
Level: 0-16
Battery Query
Command: Battery;
Response: {percentage}
Power Control
Buttplug.io Devices
For devices supported via Buttplug.io, RADR implements a subset of the Buttplug protocol:
Vibrate — Set vibration level (0-1 float, mapped to device range)
Linear — For thrusting devices
Rotate — For rotating devices
Not all devices support all commands. RADR queries device capabilities during connection.
Connection Recovery
If RADR loses connection to a device:
Detection — Connection loss detected within supervision timeout (1500ms)
Reconnection — Automatic reconnection attempt within 2-5 seconds
Safety — For OSSM, gradual ramp-down during disconnection
Failure — After failed reconnection, return to main menu
Security
RADR uses open BLE connections without pairing or bonding:
No PIN required
No encryption (commands are plaintext)
Single connection at a time
BLE communications are not encrypted. Use RADR in private settings where radio interception is not a concern.
Debugging
For BLE debugging during development:
Use a BLE sniffer (nRF Connect, Wireshark with BLE adapter)
Enable serial logging in firmware (LOG_LEVEL_DEBUG)
Monitor connection events and characteristic writes
Further Reading
NimBLE Documentation NimBLE stack documentation.
Buttplug.io Protocol Buttplug device protocol specification.