CONNECTION

Connect to bibox using WebSockets

Establishing connection to the iot server.

    socket = new WebSocket('ws://HOST:PORT/PATH');

Parameter

Name Description
HOST iot.bibox.in
PORT 8005
PATH iot
  /**
      javaScript webSocket Object.
  */
      socket = new WebSocket('ws://iot.bibox.in:8005/iot');

DISCONNECTION

Disconnect app from bibox

Disconnecting the connection created above in socket by calling close() on it.

    socket.close();

Parameter

Name Description
N.A null
  /**
      socket.close();
  */

IOT Operations

Read

Read from bibox for 1-10 Iot Variables. IOT_1, IOT_2, IOT_3, etc. are Iot Variables.

    " IOT_Action, Mac_Id "

Parameter

Name Type Value Description
IOT_Action String read

command for reading.

Mac_Id String 00:00:00:00:00:00

Mac id of bibox.

  /**
      javaScript webSocket Object.
  */
      socket.send("read,00:00:00:00:00:00");

      {
          "IOT_1"   :   "1450",
          "IOT_2"   :   "20",
          "IOT_3"   :   "200",
          "IOT_4"   :   "500",
          "IOT_5"   :   "450",
          "IOT_6"   :   "254",
          "IOT_7"   :   "650",
          "IOT_8"   :   "820",
          "IOT_9"   :   "120",
          "IOT_10"  :   "3235"
      }
            

Write

Write to any One or Multiple Iot Variables. IOT_1, IOT_2, IOT_3, etc. are Iot Variables.

    " IOT_Action, Mac_Id, IOT_Variable, IOT_Variable_Value "

Parameter

Name Type Value Description
IOT_Action String write

command for writing.

Mac_Id String 00:00:00:00:00:00

Mac id of bibox.

IOT_Variable String IOT_1/ IOT_2/ ...

Port to which value is to be written on bibox.

IOT_Variable_Value Integer ..., -1, 0, 1, ...

Value which is to be written to bibox.

  /**
      javaScript webSocket Object.
  */
      socket.send("write,00:00:00:00:00:00,IOT_1,2");

Support for Iot port and values till IOT_10 in sequential order.

    " IOT_Action, Mac_Id, IOT_Variable1, IOT_Variable_Value1, IOT_Variable2, IOT_Variable_Value2 "
  /**
      javaScript webSocket Object.
  */
      socket.send("write,00:00:00:00:00:00,IOT_1,2,IOT_2,8");
      socket.send("write,00:00:00:00:00:00,IOT_1,2,IOT_2,8,IOT_3,5");

Support for Iot port and values till IOT_10 in any order.

    " IOT_Action, Mac_Id, IOT_Variable10, IOT_Variable_Value10, IOT_Variable4, IOT_Variable_Value4 "
  /**
      javaScript webSocket Object.
  */
      socket.send("write,00:00:00:00:00:00,IOT_10,2,IOT_4,8");
      socket.send("write,00:00:00:00:00:00,IOT_10,2,IOT_4,8,IOT_7,5");

Read - repeat

Reading repeatedly from bibox for 1-10 Iot Variables at particular time interval. IOT_1, IOT_2, IOT_3, etc. are Iot Variables.

    " IOT_Action, Mac_Id, Time_In_ms "

Parameter

Name Type Value Description
IOT_Action String read_repeat

command for reading.

Mac_Id String 00:00:00:00:00:00

Mac id of bibox.

Time_In_ms Integer 0, 1, ...

Time in mili-seconds.

  /**
      javaScript webSocket Object.
  */
      socket.send("read_repeat,00:00:00:00:00:00,1000");

      {
          "IOT_1"   :   "1450",
          "IOT_2"   :   "20",
          "IOT_3"   :   "200",
          "IOT_4"   :   "500",
          "IOT_5"   :   "450",
          "IOT_6"   :   "254",
          "IOT_7"   :   "650",
          "IOT_8"   :   "820",
          "IOT_9"   :   "120",
          "IOT_10"  :   "3235"
      }
            

Write - repeat

Writing repeatedly to any One or Multiple Iot Variables at particular time interval. IOT_1, IOT_2, IOT_3, etc. are Iot Variables.

    " IOT_Action, Mac_Id, Time_In_ms, IOT_Variable, IOT_Variable_Value "

Parameter

Name Type Value Description
IOT_Action String write_repeat

command for writing.

Mac_Id String 00:00:00:00:00:00

Mac id of bibox.

Time_In_ms Integer 0, 1, ...

Time in mili-seconds.

IOT_Variable String IOT_1/ IOT_2/ ...

Port to which value is to be written on bibox.

IOT_Variable_Value Integer ..., -1, 0, 1, ...

Value which is to be written to bibox.

  /**
      javaScript webSocket Object.
  */
      socket.send("write_repeat,00:00:00:00:00:00,1000,IOT_1,2");

Support for Iot port and values till IOT_10 in sequential order.

    " IOT_Action, Mac_Id, Time_In_ms, IOT_Variable1, IOT_Variable_Value1, IOT_Variable2, IOT_Variable_Value2 "
  /**
      javaScript webSocket Object.
  */
      socket.send("write_repeat,00:00:00:00:00:00,1000,IOT_1,2,IOT_2,8");
      socket.send("write_repeat,00:00:00:00:00:00,1000,IOT_1,2,IOT_2,8,IOT_3,5");

Support for Iot port and values till IOT_10 in any order.

    " IOT_Action, Mac_Id, Time_In_ms, IOT_Variable10, IOT_Variable_Value10, IOT_Variable4, IOT_Variable_Value4 "
  /**
      javaScript webSocket Object.
  */
      socket.send("write_repeat,00:00:00:00:00:00,1000,IOT_10,2,IOT_4,8");
      socket.send("write_repeat,00:00:00:00:00:00,1000,IOT_10,2,IOT_4,8,IOT_7,5");

Stop Read

Stop reading from bibox

    " IOT_Action, Mac_Id "

Parameter

Name Type Value Description
IOT_Action String stop_read

command for stop reading.

Mac_Id String 00:00:00:00:00:00

Mac id of bibox.

  /**
      javaScript webSocket Object.
  */
      socket.send("stop_read,00:00:00:00:00:00");

Stop Write

Stop writing to bibox

    " IOT_Action, Mac_Id "

Parameter

Name Type Value Description
IOT_Action String stop_write

command for stop writing.

Mac_Id String 00:00:00:00:00:00

Mac id of bibox.

  /**
      javaScript webSocket Object.
  */
      socket.send("stop_write,00:00:00:00:00:00");
Generated v.1.0 on - Tue Dec 20 2016 18:47:32 GMT+0530