Skip to main content
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.
ParameterValue
BLE RoleCentral
Device NameOSSM-REMOTE
Transmit Power9 dBm
StackNimBLE

Scan Parameters

ParameterValue
Scan Interval100ms
Scan Window100ms
Scan TypeActive
Scan Duration5000ms (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:
ParameterValueDescription
Min Interval1215ms minimum connection interval
Max Interval1215ms maximum connection interval
Latency0No slave latency (immediate responses)
Supervision Timeout1501500ms timeout for lost connections
Connect Timeout5000msMaximum 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

DeviceService UUID
OSSM522B443A-4F53-534D-0001-420BADBABE69
LKBXPending implementation
DTTPending implementation

Lovense Devices

DeviceService UUID
Domi 257300001-0023-4BD4-BBD5-A6920E4C5653
OtherVia 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

Command Format

Commands are sent as byte arrays to the appropriate characteristic:
ParameterData TypeRange
Speeduint8_t0-100
Depthuint8_t0-100
Sensationuint8_t0-100
Strokeuint8_t0-100
Patternuint8_tPattern index

Pattern Selection

Patterns are selected by index:
IndexPattern Name
0Simple Stroke
1Teasing Pounding
2Robo Stroke
3Half’n’Half
4Deeper
5Stop’n’Go
6Insist

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

Command: PowerOff;

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:
  1. Detection — Connection loss detected within supervision timeout (1500ms)
  2. Reconnection — Automatic reconnection attempt within 2-5 seconds
  3. Safety — For OSSM, gradual ramp-down during disconnection
  4. 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:
  1. Use a BLE sniffer (nRF Connect, Wireshark with BLE adapter)
  2. Enable serial logging in firmware (LOG_LEVEL_DEBUG)
  3. Monitor connection events and characteristic writes

Further Reading