Got Stuck?
Forum for Lovense Developers
Click to explore the release pose for Windows SDK
Support
Document Feedback
Windows SDK
The Windows SDK is a library provided for Windows that allows you to directly access Lovense toys with Lovense Dongle Adapter. You usually choose this option if you are making your own Windows application.
Step 1: Get your developer token
Go to the developer dashboard and get your developer token.
Note: You need to fill in your developer token when using the SDK.
Step 2: Download SDK
Step 3: Configure the SDK in your application
For example, the method below is to configure SDK in Visual Studio 2019
Set the path of the SDK header file
Set the path of SDK lib file
Step 4: Connect Lovense toys and send commands
#include <Lovense.h>
...
class CEventCallBack: public ILovenseSDKNotify
{
public:
/*Call when toy search start*/
virtual void LovenseDidSearchStart();
/*Call when toy searching toy*/
virtual void LovenseSearchingToys(lovense_toy_info_t *info) = 0;
/*Call when something went wrong*/
virtual void LovenseErrorOutPut(int errorCode,const char *errorMsg) = 0;
/*Call when toy search end*/
virtual void LovenseDidSearchEnd();
/*Call when send cmd start*/
virtual void LovenseDidSendCmdStart();
/*Call when send cmd return*/
virtual void LovenseSendCmdResult(const char * szToyID, CLovenseToy::CmdType cmd,const char *result,CLovenseToy::Error errorCode);
/*Call when send cmd end*/
virtual void LovenseDidSendCmdEnd();
/*Call when toy connected, or disconnected*/
virtual void LovenseToyConnectedStatus(const char *szToyID, bool isConnected) ;
};
...
//TODO:This is a simple process
CEventCallBack *callBack = new CEventCallBack();
CLovenseToyManager *manager = GetLovenseToyManager();
manager->SetDeveloperToken(...);
manager->RegisterEventCallBack(callBack);
manager->StartSearchToy();//Search for the toys via USB Dongle
Send a command
CLovenseToyManager *manager = GetLovenseToyManager();
//Send a vibration command
manager->SendCommand(toyID,CLovenseToy::CmdType::COMMAND_VIBRATE,10);
For a list of supported commands, check LovenseDef.h
namespace CLovenseToy
{
typedef enum {
/**
-Power off!
- param Key = no parameter
*/
COMMAND_POWER_OFF = 100,
/**
- Vibrate the toy. The parameter must be between 0 and 20!
- Supported toys = all
*/
COMMAND_VIBRATE = 101,
/**
- Rotate the toy. The parameter must be between 0 and 20!
- Supported toys = Nora
*/
COMMAND_ROTATE = 102,
.
.
.
}
}
Setup
- Insert the Lovense USB Bluetooth Adapter into the PC.
- Turn on the toy. The light will begin flashing.
- Open your application and search for the toy to establish a connection.
Tips
- When searching for toys, do not send other commands to toys.
- If you need to get the toy's battery level frequently, start a thread loop.
- For best results, don't sent toy commands more than once per second.
- First time users, refer to our SDK Demo linked above.
View log output
To view log output, use the editbin command.
Note: If there is an "editbin not found" error when compiling, here is a solution.