The user can send command with the command line interface, then our client with encode the command
{
"command": {
"mesg": {
"info": "hello world",
"uri": "fd9d8b64610500a8f7b87579fbfc75562ff97f3c "
}
}
}
```
While the other ring-client-iot receives this message, it will parse the command and call the *sendTextMessage* API to send text message.
2). The *call* command can tell the iot client peer to place video call to some other peers. The command format is like this:
```
<cmd> <uri> e.g. call fd9d8b64610500a8f7b87579fbfc75562ff97f3c
```
The user can send command with the command line interface, then our client with encode the command
to the json format like this
```
{
"command": {
"call": {
"uri": "ring:fd9d8b64610500a8f7b87579fbfc75562ff97f3c "
}
}
}
```
While the other ring-client-iot receives this message, it will parse the command and call the *placeCall* API to start a video call.
The call command may not so stable and may have the "Can't put ICE descriptor on DHT" warning sometime. Maybe I need to dive into the API more.
3. Test the 2 commands with my smartphone.
Sine I only have one device(Mac OS X) with the compiled Ring-client-iot, So I made the test with my Andriod smartphone in the following 2 steps:
1). send command with ring-client-iot to my smart phone and check the received message format. It should be like the JSON format above.
2). send ALREADY wrapped JSON message through my smart phone to ring-client-iot, and see if the API call can work.
It turns that the 2 commands can do their job now , Quite exciting! Maybe You can have a try too : )
Plan for week7:
The account of my code are hardcoded now, I should try to make it more flexible now.
Thanks .