Checking USB connection state using cdc_acm with nRF52840 outside of the USB library

Hi guys,

I'm writing firmware for the nRF52840 using Zephyr, based on the cdc_acm example, using zephyr,cdc-acm-uart. I'm trying to blast out a ton of data, and need to capture elsewhere in the application when the USB connection goes to the "Device suspended" or "Device disconnected" states, to cancel the data transfer. Does anybody know how to check for the USB connection state from outside of the USB driver, specifically to see if it is still connected please?

Using nrfconnect v2.1.0

Thanks!

Andrew

Related