Skip to main content

Finding USB ports on Android

Multiple USB devices such as sensors can be connected to an Android device, in this case the target USB port for the different sensor configurations have to be defined to let the application know which configuration is meant to which sensor.

info

The USB port name can be different between different devices keep this in mind before applying the configurations on devices

Discover USB ports table

You can find the Discover USB ports table in the Recovery menu (You can find more information about the Recovery menu here) In the Recovery menu look for the Discover connected ports option and there you will see this table: img.png

Contents

  • Port: Here you can see the port of the connected device
  • Type: The type of the connected device it can be USB or SERIAL
  • Pid: The PID of the connected device (only applicable for USB devices)
  • Vid: The VID of the connected device (only applicable for USB devices)

Using the port in Sensor or Advanced configurations

Sensor configuration

Here is an example on how to use the port in a sensor configuration:

{
"services": [
{
"uid": "CONFIG",
"type": "GENERIC",
"connection": {
"port": "/dev/ttyS0"
},
"settings": {
"rules": [
{
"pattern": "(\\w\\d{3}\\w)\\[(\\d*)]\r\n",
"eventGroupIndex": 1,
"valueGroupIndex": 2
}
]
}
}
]
}

Advanced configuration

Here is an example on how to use the port in an advanced configuration:

{
"configuration": [
{
"type": "SCREEN_CONTROL",
"serialConnection": {
"port": "1.1-2"
},
"commands": [
{
"action": "SCREEN_ON",
"method": "serial",
"messageType": "string",
"message": "TOF/n"
}
]
}
]
}