I have a Q2686 or Q2687 with firmware R72 or 7.46 of which I am trying to use the USB port reliably in “Data Mode” (not AT Mode). Is the following procedure correct within an open at application:
Check USB port is enabled
1 Check if USB port is enabled with the at+wmfm=0,2,3 command,
1a On result equals at+wmfm=0,1,3,1 (go to 2, if not go to 1b).
Detecting USB cable plug in
2 Check to see if port is available with ADL function: adl_fcmIsAvailable(ADL_PORT_USB),
2a On result equals true subscribe to FCM using adl_fcmSubscribe(ADL_PORT_USB,CtlHdl,DataHdl) (ensuring an unsubscribe is performed first if already subscribed to). Go to 3 on event,
2b On result equals false repeat step 2 until result equals true (via a timer).
1b On result equals at+wmfm=0,1,3,0 (go to 1c)
1c Enable the port by sending the at+wmfm=0,1,3,1 command,
1d On trigger of 1c’s handler go to step 2
3 On event ADL_FCM_EVENT_FLOW_OPENNED call function adl_fcmSwitchV24State(DataHandle, ADL_FCM_V24_STATE_DATA) to convert the port to Data Mode.
4 After event ADL_FCM_EVENT_V24_DATA_MODE the USB is now ready for data transfer over the USB port.
5 On event ADL_FCM_EVENT_FLOW_CLOSED go to step 2.
The problem I am experiencing is that when plugging in the USB cable the OS system detects the USB device but the port on the device does not always change to data mode.
Any advice would be gratefully received