**************** Report of week5/6 **********************

During the past 2 weeks, I have made great progress on Ring-client-iot and
pushed the first version to gerrit.

1. To detect standard input from keyboard during the while loop, and to
deal with the ring daemon events at the same time,  I use the *select*
method to detect input of the stdin descriptor, named *kbhit* function.

In this way, we implement the command line interface to send our Ring
command and can detect Ring events at the same time.

2. I implement *mesg* and *call* command for the ring-client-iot.

1). The *mesg* command can tell the iot client peer to send text message to
some other peers. The command format is like this:
```
<cmd> <uri> <message>  e.g.  mesg
fd9d8b64610500a8f7b87579fbfc75562ff97f3c hello world
```
The user can send command with the command line interface, then our client
with encode the command
to the json format like this
```
{
    "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 .


———————————————————————————————————————
Houmin Wei  ( 魏后民 )
Undergraduate,School of Electronics Engineering and Computer Science
Peking University, Beijing, 100871.

Reply via email to