How to check if ASIO device is connected

When scanning for devices, ASIO devices is always in the list of devices. even if it is no longer connected to the PC.

deviceManager.getCurrentDeviceTypeObject()->scanForDevices();
                    
bool deviceConnected = deviceManager.getCurrentDeviceTypeObject()->getDeviceNames().contains(m_deviceName);

how to check if a ASIO device is connected or not?