DeveloperDeveloper
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • App Gallery (with Lovense Remote)
    • Get Started
    • Development
    • Deploy
  • Basic API
    • Life Cycle
  • Platform API
    • App Info
      • AppBaseInfo
    • Toy
      • Toy Info
      • Command
      • Feedback Mode
    • Device
      • Accelerometer
      • Screen Orientation
      • Shake
      • Vibrate
    • File System
      • Save Image
  • Open API
    • User Authorization
      • Client API
      • Server API
  • Error Code
  • sendCommand
Got Stuck?
Forum for Lovense Developers
Support
Document Feedback

Command

sendCommand

  • Description

    Send toy command.

  • Parameters

    AttributeTypeDefaultRequiredIntroduction
    commandobjectYesToy command, for the reference about the toy command API, please check: Standard API
    successfunctionNoCallback function for successful API call
    failfunctionNoCallback function for failed API call

    Success callback function will receive an object with the following attributes:

    AttributeTypeIntroduction
    codestringSuccess code

    Fail callback function will receive an object with the following attributes:

    AttributeTypeIntroduction
    codestringError code
    msgstringError 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)
      },
    })
    
Last Updated:
Prev
Toy Info
Next
Feedback Mode
Explore our Forum or Support to get more inspiration or solve your problems.
Discord Channel
It is an online real-time channel where you can communicate directly with our official administrators or many excellent developers.
Forum
It is a place for Lovense developers to communicate, where you can find solutions to problems or get inspired for your projects.
Support
Find documents and tutorials that may be helpful to you.