Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Socket USBHost lwip-sys lwip
Dependents: VodafoneUSBModemSMSTest
Diff: ussd/USSDInterface.cpp
- Revision:
- 83:897a0de9d668
- Parent:
- 59:593fb493172f
- Child:
- 85:d74a2a9d2b01
diff -r ab4d6263f25c -r 897a0de9d668 ussd/USSDInterface.cpp
--- a/ussd/USSDInterface.cpp Tue Jan 29 13:49:23 2013 +0000
+++ b/ussd/USSDInterface.cpp Tue Mar 05 14:54:15 2013 +0000
@@ -17,7 +17,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#define __DEBUG__ 0
+#define __DEBUG__ 4
#ifndef __MODULE__
#define __MODULE__ "USSDInterface.cpp"
#endif
@@ -34,6 +34,7 @@
USSDInterface::USSDInterface(ATCommandsInterface* pIf) : m_pIf(pIf), m_responseMtx(), m_responseSphre(1), m_result(NULL), m_maxResultLength(0)
{
m_responseSphre.wait(0); //Take ownership of the semaphore
+ DBG("events handler reg ussd");
m_pIf->registerEventsHandler(this); //Add us to the unsolicited result codes handlers
}
@@ -45,7 +46,7 @@
int USSDInterface::send(const char* command, char* result, size_t maxLength)
{
- if (strlen(command) > 20) //Prevent buffer overflow
+ if (strlen(command) > 20) //Prevent buffer overflow XXX shouldn't this be 19 as the AT+CUSD=1,"" is 12
{
return NET_TOOSMALL;
}
@@ -188,6 +189,7 @@
return;
}
size_t cpyLen = MIN( pEnd - pStart, m_maxResultLength - 1 );
+ DBG("cpyLen: %d",cpyLen);
memcpy((void*)m_result, pStart, cpyLen);
m_result[cpyLen] = '\0';
DBG("Got USSD response: %s", m_result);