REST API Non-PNP devices Routes Begin Lookup
April 13, 2023 at 2:39 AMBegin Lookup
Role
This command activates the device discovery task on the specified communication channel (namely serial, network or BLE).
Use the End Lookup route to terminate the discovery task and retrieve the list of devices that have been found.
Prototype
URL : /lookup/begin
Method : POST
URL Params : None
Request data :
Field name | Type | Status | Description | Condition |
---|---|---|---|---|
Channel |
string | mandatory | Communication channel: serial , ble or network |
|
Timeout |
integer | option | Duration of the discovery task, specified in seconds between 1 and 60. If this value is not set, it defaults to 5 seconds. |
|
SerialPort |
string | option | Name of the communication port. If empty, all the available communication ports are probed one after the other, until a suitable device is found. Use /utilities/list-serial-ports to get the list of communication ports. |
Channel is serial |
SerialSettings |
string | option | Parameters of the communication port. Default is 38400:8:N:1 |
Channel is serial |
Examples
Discover a serial device
{
"Channel": "serial",
"SerialPort": "COM27"
}
Discover devices on the network
{
"Channel": "network",
"Timeout": 3
}
Success Response
Code : 200 OK
Content : a SUCCESS object.
Error Response
See Error Responses.
Specific error messages are:
-
"AlreadyRunning"
: the discovery task is already running. Wait until its timeout occurs or call the end_lookup route to terminate it earlier. -
"CommNotAvailable"
: the specified communication port does not exist on the computer running the SpringCard Companion Service. -
"CommAccessDenied"
: the SpringCard Companion Service failed to open the communication port. It may be already used by another application. -
"BleNotAvailable"
: the computer running the SpringCard Companion Service does not seem to have a BLE interface. -
"BleAccessDenied"
: the SpringCard Companion Service failed to open the BLE interface. -
"NetworkNotAvailable"
: the computer running the SpringCard Companion Service does not seem to have a network connection. -
"NetworkNdduPortAlreadyInUse"
: the UDP port used by the NDDU protocol (SpringCard Network Device Discovery Utility) has already been opened by another software.