Communication Specification

Client -> Server

  • On Open
    • type - "connection_open"
    • api
      • "version" - string

Ex.)

{
     "type" : "connection_open",
     "api" :
     {
          "version" : "1.0",
     },
}

  • Message
    • type - "oscilloscope"
    • channel - [0,n] channels
    • data - different fields ex.) { "vscale": 3 } , {"enable": true}

Ex.)

{
     "type" : "oscilloscope",
     "channel" : 0,
     "data" :
     {
          "vscale" : 3,
     },
}

{
     "type" : "oscilloscope",
     "channel" : 0,
     "data" :
     {
          "enable" : true,
     },
}
{
     "type" : "oscilloscope",
     "channel" : 0,
     "data" :
     {
          "enable" : true,
          "vscale" : 3,
     },
}

Server->Client

  • On Open
    • type
    • version - string
    • battery
      • rating - mAh
    • devices
      • oscilloscopes - list of each oscilloscope channel parameters
        • channel
        • voltages
          • min
          • max
        • frequency

Ex.)

{
     "type" : "connection_open",
     "version" : "1.0.0",
     "devices" :
     {
          "batteries :
          [
              {
                  "channel" : 0,
                  "rating" : 3600
              }
          ],
          "oscilloscopes" : 
          [
               {
                    "channel" : 0,
                    "voltages" : 
                    {
                         "min" : -20
                         "max" : 20
                    }, 
                    "frequency" : 20000,
               },
               {
                    "channel" : 1,
                    "voltages" : 
                    {
                         "min" : 0
                         "max" : 30
                    }, 
                    "frequency" : 40000,
               },
          ],
     },
}

  • Message
    • type - "oscilloscope" or "battery"
    • channel - [0,n] channels
    • data - different fields ex.) { "life": 30 "time": 30 - in minutes } , {"waveform": [10,10,30,40,50,-10] }

Ex.)

{
     "type" : "oscilloscope",
     "channel" : 0,
     "data":
     {
          "waveform" : [ -30 , 30 , 10 , 10.4 , -11.2 , 5.4 ],
     },
}

{
     "type" : "battery",
     "channel" : 0,
     "data":
     {
          "life": 30,
          "time": 40,
     },
}