Remote Part

Welcome to the Remote SDK Reference. Here you will find the various JavaScript methods you can use to send data between HEXA and your device.

Usage

Include MIND Remote SDK inindex.html

<script src="mind-framework.js">
</script>

Invokemind.initto initialize MIND.

mind.init({
  callback: function(robot) { } 
  error: function(err) { } 
})

API Methods

In the callback ofmind.inityou can invoke the following API methods:

getInfo- Get basic information from the robot.

robot.getInfo({
  callback: function(info) { },
  error: function(err) { }
})

connectSkill- Has to be invoked before using your Skill.

robot.connectSkill({
  skillID: skillID,
  callback: function() { },
  error: function(err) { }
})

sendData- Sends a JSON or string message to the robot.

robot.sendData({
  skillID: skillID,
  data: {}, 
  callback: function() { },
  error: function(err) { }
})

disconnectSkill- Disconnects one skill, but it will still be running on the robot in the background.

robot.disconnectSkill({
  skillID: skillID,
  callback: function() { },
  error: function(err) { }
})

stopSkill- Stops one skill.

robot.stopSkill({
  skillID: skillID,
  callback: function() { },
  error: function(err) { }
})

onRecvSkillData- Callback function for receiving JSON or string data from the robot.

robot.onRecvSkillData(function(skillID, data) { 
})

onDisconnected- Callback function triggers when connection to robot is lost.

robot.onDisconnect(function(reason) {  
})

Storage

You can use LocalStorage to store your data.