# Detecting Device
For all operations, detecting the device is always the first step. Through the detection, you should be able to know the number and detailed information of the video controller.
# The process of detecting device
The following steps are required for detecting device:
Step 1. You can search for video controller connected either through the USB or the LAN ports. By default, when the device connected through USB is detected, the device connected to the LAN port will not be searched. This strategy is more time-saving, considering that in most situation, only one connection method is adopted.
Refer to Get Device Sets
Step 2. Select the device collection to operate next. The first device collection is selected by default.
Refer to Change Device Sets
Step 3. Get the detail information of the device.
Refer to Get Device General Info
# Advanced: Device set
Device set: Refers to a collection of devices controlled by one or multiple (cascaded) video controller(s).
The device is mainly controlled via the USB port and LAN port on its motherboard: the computer is directly connected to the USB port of the device, or directly connected to the LAN port of the device. The computer can only connect to one device set; For connection to multiple device sets, you can connect the computer to a switch and then connect the switch to the LAN port of another video controller.
# Detecting methods for device set connected in different ways
By USB The computer is connected to the USB port (Type-B) of the device. There is only one device set in this connection way:
By LAN port
If the computer is connected to the LAN port of the device through the network cable, you should ensure the computer and the device share the same IP first. There is only one device set in this connection way:By Switch
If the computers is connected to a switch and the switch is connected to the devices, you should ensure all video controllers are in the same LAN. There could be multiple device sets in this connection way:
Example of detecting device:
// detect device info
CLTSearchAllDevice();
// get device counts
int deviceCount = CLTGetDeviceCounts();
if (deviceCount <= 0) {
return;
}
// get device set counts
int deviceSetCount = 0;
bool bConnectByNet = CLTGetDeviceIsNetConnected();
if(bConnectByNet)
{
// connecting via network cable
// get ip address
unsigned int ips[256] = {0};
int ipAddrCount = CLTGetAllDeviceIp(ips);
if(ipAddrCount>0)
{
for (int i=0;i<ipAddrCount;i++)
{
DWORD ipAddr = ips[i];
std::string strIPAddress = inet_ntoa(*((in_addr*)&(ipAddr)));
}
// change current device set.
CLTChangeCurDeviceSet(ips[0]);
}
deviceSetCount = ipAddrCount;
}
else
{
// connecting via USB
deviceSetCount = 1;
// changing device set is not supported.
}