List serial ports

Role

List the serial ports of the computer that is running SpringCard Companion Service.

Prototype

URL : /utilities/list-serial-ports

Method : GET

URL Params : None

Request data : None

Success Response

Code : 200 OK

Content : a list of SERIAL-PORT objects, as specified below.

SERIAL-PORT object definition

Field name Type Status Description
SerialPort string always The name of the port (COM4, /dev/ttyS0…)
Attached boolean option true if Attach_Device has been called over this serial port
Persistent boolean option true if Attach_Device has been called with the persistent parameter set
SerialSettings string option Communication settings (if they are known)
DevicePresent boolean option true is a device is actually present on this serial port
DeviceId string option If a device is actually present, its DeviceId

Example

[
    { 
    	"SerialPort": "COM1",
        "Attached": false        
    },
    { 
    	"SerialPort": "COM2",
        "Attached": false        
    },    
    {
        "SerialPort": "COM4",
        "Attached": true,
        "Persistent": true,        
        "SerialSettings": "38400:8:N:1",
        "DevicePresent": false
    },
    {
        "SerialPort": "COM27",
        "Attached": true,
        "Persistent": false,        
        "SerialSettings": "38400:8:N:1",
        "DevicePresent": true,
        "DeviceId": "z1FyhlpOKF72WuAdurpwaa"
    }
]

Error Response

See Error Responses.