bitfocus / companion-module-requests

Repository for tracking module requests
95 stars 10 forks source link

3ality SIP CoLA Command Language interface #1530

Open hpostley opened 4 days ago

hpostley commented 4 days ago

Control 3ality SIP2 via CoLA Command Language

Basic CoLa Communication The CoLa command interface of the device is fairly simple. You simply connect to the device on TCP Port 2222 or 23 and send commands of the form

[%WCO 1]

The square brackets mark start and end of the command, the '%' signifies a parameter set command, followed by a 3-letter abbreviation of the parameter, in this case WCO stands for "Wedge COrrection".

The last element of the command is the parameter value.

The device will answer with one of the following. Note the curly brackets delimiting the answer:

{OK %WCO 1} - all went fine {PE %WCO 0}- parameter '1' was invalid, actual parameter value is '0' (PE=Parameter Error) {SE %WCO} - "%WCO" is an invalid command (SE=Syntax Error)

Reading a parameter or status value from the device is similar:

[?WCO]

will result in the device answering

{OK ?WCO 1}

Notification extension To avoid polling, an experimental feature has been added to allow notification when parameters change. Adding and removing parameters from the notification list is done via the + and – prefixes. Lists are managed per connection and therefore need to be filled whenever a new connection is established.

[+WCO] adds WCO to the list of watched parameters. [-WCO] removes WCO from the list of watched parameters. [+ALL] adds all public parameters to the list [-ALL] clears the list

Whenever a parameter changes, a notification will be triggered. The notification has the same format as answers to parameter get requests, but in pointy instead of curly brackets:

<OK ?WCO 1>