#include <XLinkConnection.hpp>
Represents connection between host and device over XLink protocol
Definition at line 51 of file XLinkConnection.hpp.
◆ XLinkConnection() [1/3]
dai::XLinkConnection::XLinkConnection |
( |
const DeviceInfo & |
deviceDesc, |
|
|
std::vector< std::uint8_t > |
mvcmdBinary, |
|
|
XLinkDeviceState_t |
expectedState = X_LINK_BOOTED |
|
) |
| |
◆ XLinkConnection() [2/3]
dai::XLinkConnection::XLinkConnection |
( |
const DeviceInfo & |
deviceDesc, |
|
|
dai::Path |
pathToMvcmd, |
|
|
XLinkDeviceState_t |
expectedState = X_LINK_BOOTED |
|
) |
| |
◆ XLinkConnection() [3/3]
dai::XLinkConnection::XLinkConnection |
( |
const DeviceInfo & |
deviceDesc, |
|
|
XLinkDeviceState_t |
expectedState = X_LINK_BOOTED |
|
) |
| |
|
explicit |
◆ ~XLinkConnection()
dai::XLinkConnection::~XLinkConnection |
( |
| ) |
|
◆ bootAvailableDevice() [1/2]
bool dai::XLinkConnection::bootAvailableDevice |
( |
const deviceDesc_t & |
deviceToBoot, |
|
|
const dai::Path & |
pathToMvcmd |
|
) |
| |
|
staticprivate |
◆ bootAvailableDevice() [2/2]
bool dai::XLinkConnection::bootAvailableDevice |
( |
const deviceDesc_t & |
deviceToBoot, |
|
|
std::vector< std::uint8_t > & |
mvcmd |
|
) |
| |
|
staticprivate |
◆ bootBootloader()
Tries booting the given device into bootloader state
- Parameters
-
devInfo | Information of device which it should boot into bootloader state |
- Returns
- New device information if successful
Definition at line 221 of file XLinkConnection.cpp.
◆ close()
void dai::XLinkConnection::close |
( |
| ) |
|
Explicitly closes xlink connection.
- Note
- This function does not need to be explicitly called as destructor closes the connection automatically
Definition at line 315 of file XLinkConnection.cpp.
◆ convertErrorCodeToString()
std::string dai::XLinkConnection::convertErrorCodeToString |
( |
XLinkError_t |
errorCode | ) |
|
|
staticprivate |
◆ getAllConnectedDevices()
std::vector< DeviceInfo > dai::XLinkConnection::getAllConnectedDevices |
( |
XLinkDeviceState_t |
state = X_LINK_ANY_STATE , |
|
|
bool |
skipInvalidDevices = true , |
|
|
XLinkPlatform_t |
platform = X_LINK_MYRIAD_X |
|
) |
| |
|
static |
Returns information of all connected devices with given state
- Parameters
-
state | State which the devices should be in |
skipInvalidDevices | whether or not to skip over devices that cannot be successfully communicated with |
platform | Which platforms to search for |
- Returns
- Vector of connected device information
Definition at line 113 of file XLinkConnection.cpp.
◆ getDeviceByMxId()
std::tuple< bool, DeviceInfo > dai::XLinkConnection::getDeviceByMxId |
( |
std::string |
mxId, |
|
|
XLinkDeviceState_t |
state = X_LINK_ANY_STATE , |
|
|
bool |
skipInvalidDevice = true |
|
) |
| |
|
static |
Finds a device by MX ID. Example: 14442C10D13EABCE00
- Parameters
-
mxId | MyraidX ID which uniquely specifies a device |
state | Which state should the device be in |
skipInvalidDevices | Whether or not to skip devices that cannot be fully detected |
- Returns
- Tuple of bool and DeviceInfo. Bool specifies if device was found. DeviceInfo specifies the found device
Definition at line 192 of file XLinkConnection.cpp.
◆ getFirstDevice()
std::tuple< bool, DeviceInfo > dai::XLinkConnection::getFirstDevice |
( |
XLinkDeviceState_t |
state = X_LINK_ANY_STATE , |
|
|
bool |
skipInvalidDevices = true |
|
) |
| |
|
static |
Returns information of first device with given state
- Parameters
-
state | State which the device should be in |
- Returns
- Device information
Definition at line 160 of file XLinkConnection.cpp.
◆ getGlobalProfilingData()
◆ getLinkId()
int dai::XLinkConnection::getLinkId |
( |
| ) |
const |
◆ getProfilingData()
◆ getRebootOnDestruction()
bool dai::XLinkConnection::getRebootOnDestruction |
( |
| ) |
const |
◆ initDevice()
void dai::XLinkConnection::initDevice |
( |
const DeviceInfo & |
deviceToInit, |
|
|
XLinkDeviceState_t |
expectedState = X_LINK_BOOTED |
|
) |
| |
|
private |
◆ isClosed()
bool dai::XLinkConnection::isClosed |
( |
| ) |
const |
Is the connection already closed (or disconnected)
- Warning
- This function is thread-unsafe and may return outdated incorrect values. It is only meant for use in simple single-threaded code. Well written code should handle exceptions when calling any DepthAI apis to handle hardware events and multithreaded use.
Definition at line 310 of file XLinkConnection.cpp.
◆ setRebootOnDestruction()
void dai::XLinkConnection::setRebootOnDestruction |
( |
bool |
reboot | ) |
|
◆ XLinkReadError
◆ XLinkWriteError
◆ bootDevice
bool dai::XLinkConnection::bootDevice = true |
|
private |
◆ bootWithPath
bool dai::XLinkConnection::bootWithPath = true |
|
private |
◆ closed
bool dai::XLinkConnection::closed {false} |
|
private |
◆ closedMtx
std::mutex dai::XLinkConnection::closedMtx |
|
mutableprivate |
◆ deviceInfo
◆ deviceLinkId
int dai::XLinkConnection::deviceLinkId = -1 |
|
private |
◆ mvcmd
std::vector<std::uint8_t> dai::XLinkConnection::mvcmd |
|
private |
◆ pathToMvcmd
◆ POLLING_DELAY_TIME
constexpr std::chrono::milliseconds dai::XLinkConnection::POLLING_DELAY_TIME {10} |
|
staticconstexprprivate |
◆ rebootOnDestruction
bool dai::XLinkConnection::rebootOnDestruction {true} |
|
private |
◆ WAIT_FOR_BOOTUP_TIMEOUT
constexpr std::chrono::milliseconds dai::XLinkConnection::WAIT_FOR_BOOTUP_TIMEOUT {15000} |
|
staticconstexprprivate |
◆ WAIT_FOR_CONNECT_TIMEOUT
constexpr std::chrono::milliseconds dai::XLinkConnection::WAIT_FOR_CONNECT_TIMEOUT {5000} |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: