cbrx_find
Search for devices attached to local Cambrionix units.
Syntax: see API Call Structure
{ "method": "cbrx_find", "params": [ID] } |
ID can be any of the following forms:
ID Paramater | Description |
---|---|
VID | Search for any devices matching the vendor ID. Displayed as an Integer |
VID & PID | Search for devices exactly matching the vendor and product IDs. Displayed as an Integer |
NAME |
Search for anything that matches the provided regex. The regex is run against a string made up of the manufacturer, product name, USB serial number and DeviePath (For an iPhone this is the UDID). "<manufacturer-name>\x1D<product-name>\x1D<serial-number>". The regex is performed as a search, rather than a match, so you do not need to do things like ".*iPhone.*" to match substrings; "iPhone" is sufficient. You can be as strict as you like. Additionally, if the phone’s identity or internal serial number have been detected, then these will also be matched. |
Returns:
{ "result": { "usb-serial": { "HostDevice": "hub-serial", "HostPort": device-port, "HostDescription": "product-name", "HostSerial": "serial-port", "Device": ["device-string"] } } } } |
Output | Description |
---|---|
usb-serial | The serial number of the device |
hub-serial | This is the serial number of the hub returned from cbrx_discover |
device-port | Port number of the hub the device is attached too |
product-name | Hardware name of product |
serial-port | The Serial port the product is connected to. |
device-string | Information from connected devices, see Device string |
The returned data is keyed on the serial number of any devices matching the search criteria. The value of each node holds details of the location and the exact device details.
The entire USB tree is searched for the specified items, and if found anywhere beneath a Cambrionix hub, then the connection details will be returned. This would be especially useful for devices that are plugged into an intermediate hub device rather than being directly connected to the Cambrionix hub, such as a phone with battery extended and extra USB slots.
For any search results that do not have their own USB serial number, there will be an additional entry of NoSerial that is an array of such results, see information in below example.
Example
Example JSON-RPC request:
{
"jsonrpc": "2.0",
"id": 0,
"method": "cbrx_find",
"params": [
"i(Phone|Pad)"
]
}
Example successful response
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"974a9d1e6848316264a8a9d8b094b7d5e63a7ae5": {
"HostDevice": "60003",
"HostPort": 2,
"HostDescription": "TS3-C10",
"Device": {
"VID": 1452,
"PID": 4779,
"Manufacturer": "Apple Inc.",
"Description": "iPad",
"SerialNumber": "974a9d1e6848316264a8a9d8b094b7d5e63a7ae5",
"DeviceType": "Apple",
"LocationID": 856686592,
"DevicePath": "\\\\?\\usb#vid_1234&pid_5678##{a5dcbf10-653004fb951ed}",
"USBVersion": 2,
"USBPower": {
"State": "D0",
"Description": "On"
},
"USBSpeed": {
"Speed": "480Mbps",
"Description": "High"
},
"Endpoints": {
"Active": 6,
"Maximum": 8,
"Memory": 32768
},
"Battery": {
"DataSource": "imobiledevice",
"TrustLevel": "paired",
"PairingSupported": true,
"CurrentLevel": 100,
"CurrentTime": 1663145986,
"StartingLevel": 100,
"StartingTime": 1663145986,
"CapacityNew": 11560,
"Capacity": 11441,
"ChargingStatus": "full",
"HealthPercent": 98
},
"PhoneSerialNumber": "DLXKJ4QAF182",
"PhoneIdentity": "iPad",
"MacAddress": "60:fe:c5:b1:98:8c",
"PhoneSoftwareVersion": "10.3.3"
}
},
"8b2f4103b3b74117c5bc7ca57829cb0daedcad19": {
"HostDevice": "60003",
"HostPort": 1,
"HostDescription": "TS3-C10",
"Device": {
"VID": 1452,
"PID": 4779,
"Manufacturer": "Apple Inc.",
"Description": "iPad",
"SerialNumber": "8b2f4103b3b74117c5bc7ca57829cb0daedcad19",
"DeviceType": "Apple",
"LocationID": 857735168,
"USBVersion": 2,
"USBPower": {
"State": "D0",
"Description": "On"
},
"USBSpeed": {
"Speed": "480Mbps",
"Description": "High"
},
"Endpoints": {
"Active": 6,
"Maximum": 8,
"Memory": 32768
},
"Battery": {
"DataSource": "imobiledevice",
"LastError": "ideviceinfo returned PASSWORD_PROTECTED",
"TrustLevel": "error",
"PairingSupported": true
}
}
}
}
}