jetperch / pyjoulescope

Joulescope driver and utilities
https://www.joulescope.com
Apache License 2.0
38 stars 11 forks source link

Add socket API #10

Closed mliberty1 closed 4 years ago

mliberty1 commented 4 years ago

Using Joulescopes with Python is great, but what about other languages? Yes, you can invoke Python from C. However, having a less convoluted integration path would be better. Sockets would allow for both local cross-language integration and networking.

The socket API would need to support:

  1. Discovery: automatically announce device insertion and removal
  2. Scan: list connected Joulescopes
  3. Device:
    1. Parameters: list, get, set
    2. open/close
    3. info: get
    4. streaming: start/stop, statistics
    5. read: for a duration, option to provide average value only

I have considered implementing to a standard, such as SCPI, HiSLIP, or VXI-11, but all seem poorly suited for streaming data. I would probably select a very simple tag-length-value format. Something very close (possibly identical) to the format used by JLS files documented in datafile.py.

mliberty1 commented 4 years ago

We have created a new joulescope_server repo that contains the initial implementation. Although we may eventually merge this functionality into this core pyjoulescope repo, we plan to keep the socket server and client functionality separate for now.