Class representing a list of devices.
More...
#include <Device.hpp>
|
| DeviceList (std::unique_ptr< DeviceListImpl > impl) |
|
| ~DeviceList () noexcept |
|
uint32_t | deviceCount () |
| Get the number of devices in the list.
|
|
DEPRECATED const char * | name (uint32_t index) |
| Get the name of the device at the specified index (DEPRECATED)
|
|
int | pid (uint32_t index) |
| Get the PID of the device at the specified index.
|
|
int | vid (uint32_t index) |
| Get the VID of the device at the specified index.
|
|
const char * | uid (uint32_t index) |
| Get the UID of the device at the specified index.
|
|
const char * | serialNumber (uint32_t index) |
| Get the serial number of the device at the specified index.
|
|
const char * | connectionType (uint32_t index) |
| Get device connection type.
|
|
const char * | ipAddress (uint32_t index) |
| get the ip address of the device at the specified index
|
|
std::shared_ptr< Device > | getDevice (uint32_t index) |
| Get the device object at the specified index.
|
|
std::shared_ptr< Device > | getDeviceBySN (const char *serialNumber) |
| Get the device object with the specified serial number.
|
|
std::shared_ptr< Device > | getDeviceByUid (const char *uid) |
| Get the specified device object from the device list by uid.
|
|
Class representing a list of devices.
Definition at line 757 of file Device.hpp.
◆ DeviceList()
ob::DeviceList::DeviceList |
( |
std::unique_ptr< DeviceListImpl > |
impl | ) |
|
◆ ~DeviceList()
ob::DeviceList::~DeviceList |
( |
| ) |
|
|
noexcept |
◆ deviceCount()
uint32_t ob::DeviceList::deviceCount |
( |
| ) |
|
Get the number of devices in the list.
- Returns
- uint32_t the number of devices in the list
◆ name()
DEPRECATED const char * ob::DeviceList::name |
( |
uint32_t |
index | ) |
|
Get the name of the device at the specified index (DEPRECATED)
- Parameters
-
index | the index of the device |
- Returns
- int the name of the device
◆ pid()
int ob::DeviceList::pid |
( |
uint32_t |
index | ) |
|
Get the PID of the device at the specified index.
- Parameters
-
index | the index of the device |
- Returns
- int the PID of the device
◆ vid()
int ob::DeviceList::vid |
( |
uint32_t |
index | ) |
|
Get the VID of the device at the specified index.
- Parameters
-
index | the index of the device |
- Returns
- int the VID of the device
◆ uid()
const char * ob::DeviceList::uid |
( |
uint32_t |
index | ) |
|
Get the UID of the device at the specified index.
- Parameters
-
index | the index of the device |
- Returns
- const char* the UID of the device
◆ serialNumber()
const char * ob::DeviceList::serialNumber |
( |
uint32_t |
index | ) |
|
Get the serial number of the device at the specified index.
- Parameters
-
index | the index of the device |
- Returns
- const char* the serial number of the device
◆ connectionType()
const char * ob::DeviceList::connectionType |
( |
uint32_t |
index | ) |
|
Get device connection type.
- Parameters
-
- Returns
- const char* returns connection type,currently supports:"USB", "USB1.0", "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2", "Ethernet"
◆ ipAddress()
const char * ob::DeviceList::ipAddress |
( |
uint32_t |
index | ) |
|
get the ip address of the device at the specified index
- Attention
- Only valid for network devices, otherwise it will return "0.0.0.0".
- Parameters
-
index | the index of the device |
- Returns
- const char* the ip address of the device
◆ getDevice()
std::shared_ptr< Device > ob::DeviceList::getDevice |
( |
uint32_t |
index | ) |
|
Get the device object at the specified index.
- Attention
- If the device has already been acquired and created elsewhere, repeated acquisition will throw an exception
- Parameters
-
index | the index of the device to create |
- Returns
- std::shared_ptr<Device> the device object
◆ getDeviceBySN()
std::shared_ptr< Device > ob::DeviceList::getDeviceBySN |
( |
const char * |
serialNumber | ) |
|
Get the device object with the specified serial number.
- Attention
- If the device has already been acquired and created elsewhere, repeated acquisition will throw an exception
- Parameters
-
serialNumber | the serial number of the device to create |
- Returns
- std::shared_ptr<Device> the device object
◆ getDeviceByUid()
std::shared_ptr< Device > ob::DeviceList::getDeviceByUid |
( |
const char * |
uid | ) |
|
Get the specified device object from the device list by uid.
On Linux platform, the uid of the device is composed of bus-port-dev, for example 1-1.2-1. But the SDK will remove the dev number and only keep the bus-port as the uid to create the device, for example 1-1.2, so that we can create a device connected to the specified USB port. Similarly, users can also directly pass in bus-port as uid to create device.
- Attention
- If the device has been acquired and created elsewhere, repeated acquisition will throw an exception
- Parameters
-
uid | The uid of the device to be created |
- Returns
- std::shared_ptr<Device> returns the device object
The documentation for this class was generated from the following file:
- E:/Projects/Jenkins/workspace/OrbbecSDK/libobsensor/include/libobsensor/hpp/Device.hpp