Detecting if a device is connected


I’ve been working with the Astra for about a month now. We are in the process of replacing another sensor with the Astra in a C# .Net application. I have no problems connecting to the sensor and getting all the streams that I need, but where I’m running into an issue is the software needs to detect which of the sensors, the old or the Astra, is actually connected. With the previous sensors we are using there is an IsConnected that you can call and see if it’s connected. There doesn’t seem to be an equivalent here. I am trying a rather backwards way to detect if there is a sensor connected by starting everything (context, streamset, and color stream) and then trying to get the USBInfo on the color stream, which if the sensor is not connected (usually) throws an exception so I know it’s not connected, but that is very hoakey and I don’t like it. I also experienced that using that method is not reliable if the sensor was connected and then you disconnect it. Somehow it retains the USBInfo. Is there something that I missed in the library that actually performs this function, or how are other people dealing with this issue?

Thanks in advance for any suggestions!

In theory we should be seeing a new build of the SDK within days - I would wait till then to see if they have sorted out the device management elements.