Small Objective-C library for controlling Lovense sex toys (Lush, Hush, Nora, Max) over Bluetooth LE from an iOS device.
To get started, simply include LovenseController.h and LovenseController.m in your project.
The library use Core Bluetooth for communicating with the toys. To connect a Hush or Lush for example, start by scanning for devices:
#import "LovenseController.h"
...
CBCentralManager* blueToothManager = ...;
[blueToothManager scanForPeripheralsWithServices:@[LovenseVibratorController.serviceUUID] options:nil];After connecting to the discovered vibrator using Core Bluetooth, create a LovenseVibratorController from the CBPeripheral to start using it:
- (void) centralManager:(CBCentralManager *)central
didConnectPeripheral:(CBPeripheral *)peripheral
{
// Create a controller for a lush or hush device
[LovenseVibratorController createWithPeripheral:peripheral onReady:^(LovenseVibratorController* toy, NSError* err) {
if (err) {
NSLog(@"Error: %@", err);
return;
}
// Get the battery level
[toy getBattery:^(NSNumber* result, NSError* err) {
NSLog(@"Battery: %@", result);
}];
// Start vibrations
[toy setVibration:5 onComplete:^(BOOL ok, NSError* error) {
NSLog(@"Started vibration");
}];
}];
}
A very basic example iOS application is included in example/. This app shows how to use basic Core Bluetooth to connect to a Lush or Hush or Max toy and control vibration.
This library is a prototype and not production ready.
- Untested on the Nora. I guessed that it works like the Max, but cannot verify this. If you a Nora can help test, please let me know or submit a PR with any fixes.
- No interfaces for reading accelerometer data.
- Unsupported/invalid commands are not handled well.
- Needs more testing around error cases.
- Needs more testing for threading and potential communication interleaving issues.
- The example app is super basic and buggy.
PRs are welcome.
- Inspiration and basic protocol documentation
- Information about the bluetooth chip used in the toys
- Information about serial communication over BLE
Disclaimer: I'm not affiliated with Lovense in any way. This project is for noncommercial, personal use. For commercial applications, try contacting Lovense.