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 USBHostWANDongle lwip-sys lwip
Fork of VodafoneUSBModem by
Revision 49:978bffab17a8, committed 2012-09-27
- Comitter:
- nherriot
- Date:
- Thu Sep 27 10:13:44 2012 +0000
- Parent:
- 48:aa66bfc3a3fb
- Child:
- 50:8ad4cb12749d
- Commit message:
- changed AT string for getLinkStatus method so that it does not request cell ID. Also changed the init function so that it tells the modem to report operator in the CC and NC 5 digit BCD number.
Changed in this revision
| link/LinkMonitor.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/link/LinkMonitor.cpp Wed Sep 26 17:19:43 2012 +0000
+++ b/link/LinkMonitor.cpp Thu Sep 27 10:13:44 2012 +0000
@@ -38,6 +38,17 @@
int LinkMonitor::init()
{
+ // we need to make sure that we setup the operator selection to be in 'numeric' format.
+ // i.e. it is made up of a network and country code when returned by the modem e.g. Operator = 23415. This allows easy logic parsing for
+ // setting up other network parameters in future.
+
+ DBG("LinkMonitor::init() being called. This should only happen once: executinging AT+COPS=0,2");
+ int ret = m_pIf->execute("AT+COPS=0,2", this, NULL, DEFAULT_TIMEOUT); //Configure to set the operator string to Country Code and mobile network code
+ if(ret != OK)
+ {
+ WARN(" NET_PROTOCOL error from sending the AT+COPS command to the modem. ");
+ return NET_PROTOCOL;
+ }
return OK;
}
@@ -126,7 +137,7 @@
m_rssi = 0;
m_registrationState = REGISTRATION_STATE_UNKNOWN;
m_bearer = BEARER_UNKNOWN;
- int ret = m_pIf->execute("AT+CREG=2;+CREG?;+CREG=0;+COPS?;+CSQ", this, NULL, DEFAULT_TIMEOUT); //Configure to get registration info & get it; get signal quality
+ int ret = m_pIf->execute("AT+CREG=0;+CREG?;+COPS?;+CSQ", this, NULL, DEFAULT_TIMEOUT); //Configure to get registration info & get it; get signal quality
if(ret != OK)
{
return NET_PROTOCOL;
