The Windows SDK is a library for Windows that allows you to directly access Lovense toys through the Lovense USB Bluetooth Adater. If you need to make your own Windows application, you usually choose this option.
Go to the Dashboard, get your developer token.
Note: You need to fill in the developer token when using the SDK, otherwise the SDK will not work.
From the demo, you can find a quick way to get started.
For example, the method below is to configure SDK in Visual Studio 2019
#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);
What commands are supported?
You can see the following definition in 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,
.
.
.
}
}
- Insert the usb Bluetooth adapter into the usb interface of the PC.
- Then turn on the toy power and you will see the toy light flashing.
- Open the app and start searching for toys.
- When Dongle is searching for toys, it will not be able to send other commands for toys.
- If you need to get the toy's power regularly, the best way is to start a thread loop to get it.
- Don't send toy instructions frequently, because Dongle cannot process a large number of instructions in a short period of time.
- If you use it for the first time, you can refer to the usage method in SDK Demo.
Here is a simple way, is to use the editbin command.
(You can see that there are logs output from the console.)
Note:If there is an "editbin not found" error when compiling, there is a solution.