I'm using a modified Due to control the timing of a USB camera, which sends images to C++ software on a PC.
The Due is connected to the PC by its native USB port (the programming port isn't present in the modified design) and I'm using the SerialUSB class to communicate to the C++ application on the PC.
I'm trying to come up with a way to automatically detect when the connection to the PC is lost, on the Due program, in the hopes that I can act on it somehow to help restore that connection. I did some research but documentation on the SerialUSB class seems hard to come by. I know the only way to do that when using regular Serial communication is by periodically sending a "heartbeat" message, but I imagine SerialUSB would work differently since it's actually USB.
I have an Atmel ICE debugger hooked up to the JTAG headers and by stepping through the code, I can see that:
Returns false until a connection is established to the PC (my application or any serial monitor), after which point it always returns true, even after the connection ceases. I was also looking through the available methods in the SerialUSB class but none of them seemed relevant to what I'm trying to do.
Input and ideas would be greatly appreciated!