There are still too many areas where the ADL APIs are incomplete (or still entirely missing) and one still has to resort to messing about with AT Commands; eg,
Nope.
But something HAS to know that the cable bas been connected and the USB hardware is active, because the HOST device (i.e. PC) gets some sort of message and starts bus enumeration. The (PC) HOST knows that enumeration is complete because it goes ‘Bing’…
You can use the adl_portEvent() API to get an DTR event when a client opens or closes a connection to the USB flow - but this happens long after the enumeration is complete.
I’m trying to drive the USB LED in a sane way for the end-user - I only want the LED to illuminate when all the following conditions have been met:
USB module is enabled (i.e. AT+WMFM= has been issued to enable the device)
AND
A HOST device has been connected (i.e. VPAD_USB line has 3V3 on it)
AND
Bus enumeration has been completed (i.e. Host PC goes ‘bing’).
Can get the first two by using a second GPIO to sense the VPAD_USB signal and then read the state of the USB hardware using AT+WMFM? when the GPIO changes. Have to guess the last…
Maybe something like a DCD event using the adl_portEvent() API when the bus has enumerated?
If you enable the ATI level 1 traces, you will see that ADL does actually issue AT+CLCC internally, and this does give the caller’s number - so why can’t it make that information available via the API??!
Well I just moved over from development on Telit modules where there are no APIs to speak of… just AT-command this, AT-command that. If you want to retrieve any type of data you have to send the command and literally write code to break apart the response string to pull out what you want. So when your app fails 3 weeks later it’s probably because you received an ever-so-slightly different response that doesn’t fit your code… (maybe the +CMGS count goes into double digits! oh no)
Anyways as far as I’m concerned SW is leagues ahead in this department. I am still thrilled when I come across functions like wm_strGetParameterString