Got Stuck?
Forum for Lovense Developers
Support
Document Feedback
Command
sendCommand
Description
Send toy command.
Parameters
Attribute Type Default Required Introduction command object Yes Toy command, for the reference about the toy command API, please check: Standard API success function No Callback function for successful API call fail function No Callback function for failed API call Success callback function will receive an object with the following attributes:
Attribute Type Introduction code string Success code Fail callback function will receive an object with the following attributes:
Attribute Type Introduction code string Error code msg string Error message Example
const toyManager = appGallery.getToyManager() // Send toy command toyManager.sendCommand({ command: { command: "Function", action: "Vibrate:16", timeSec: 20.28, loopRunningSec: 9.2, loopPauseSec: 4.3, stopPrevious: 1, toy: "", apiVer: 1, }, success(res) { console.log(res.code) }, fail(err) { console.error(err.code) console.error(err.msg) }, })