aboutsummaryrefslogtreecommitdiff
path: root/libraries/GSM/GSM3ShieldV1BandManagement.cpp
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2013-08-23 15:59:24 +0200
committerCristian Maglie <c.maglie@bug.st>2013-08-23 15:59:24 +0200
commit540743129b2badb813b703208d121ff14553c147 (patch)
tree6fadb4ebce68e1f0cb298a282be135c23fd156ed /libraries/GSM/GSM3ShieldV1BandManagement.cpp
parent073b3ac9d4ae93ac0bb3a91afc65ae9d8f1d5d59 (diff)
parent67c84855c2f3ce99b091a756bb2ca1a016260659 (diff)
Merge branch 'ide-1.5.x' into dev-ide-1.5.x-discovery
Conflicts: app/src/processing/app/Preferences.java app/src/processing/app/debug/Uploader.java
Diffstat (limited to 'libraries/GSM/GSM3ShieldV1BandManagement.cpp')
-rw-r--r--libraries/GSM/GSM3ShieldV1BandManagement.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/libraries/GSM/GSM3ShieldV1BandManagement.cpp b/libraries/GSM/GSM3ShieldV1BandManagement.cpp
deleted file mode 100644
index 94dec9a..0000000
--- a/libraries/GSM/GSM3ShieldV1BandManagement.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <GSM3ShieldV1BandManagement.h>
-
-GSM3ShieldV1BandManagement::GSM3ShieldV1BandManagement(bool trace): modem(trace)
-{
- quectelStrings[UNDEFINED]="";
- quectelStrings[EGSM_MODE]="\"EGSM_MODE\"";
- quectelStrings[DCS_MODE]="\"DCS_MODE\"";
- quectelStrings[PCS_MODE]="\"PCS_MODE\"";
- quectelStrings[EGSM_DCS_MODE]="\"EGSM_DCS_MODE\"";
- quectelStrings[GSM850_PCS_MODE]="\"GSM850_PCS_MODE\"";
- quectelStrings[GSM850_EGSM_DCS_PCS_MODE]="\"GSM850_EGSM_DCS_PCS_MODE\"";
-}
-
-GSM3_NetworkStatus_t GSM3ShieldV1BandManagement::begin()
-{
- // check modem response
- modem.begin();
-
- // reset hardware
- modem.restartModem();
-
- return IDLE;
-}
-
-String GSM3ShieldV1BandManagement::getBand()
-{
- String modemResponse=modem.writeModemCommand("AT+QBAND?", 2000);
-
- for(GSM3GSMBand i=GSM850_EGSM_DCS_PCS_MODE;i>UNDEFINED;i=(GSM3GSMBand)((int)i-1))
- {
- if(modemResponse.indexOf(quectelStrings[i])>=0)
- return quectelStrings[i];
- }
-
- Serial.print("Unrecognized modem answer:");
- Serial.println(modemResponse);
-
- return "";
-}
-
-bool GSM3ShieldV1BandManagement::setBand(String band)
-{
- String command;
- String modemResponse;
- bool found=false;
-
- command="AT+QBAND=";
- for(GSM3GSMBand i=EGSM_MODE;((i<=GSM850_EGSM_DCS_PCS_MODE)&&(!found));i=(GSM3GSMBand)((int)i+1))
- {
- String aux=quectelStrings[i];
- if(aux.indexOf(band)>=0)
- {
- command+=aux;
- found=true;
- }
- }
-
- if(!found)
- return false;
- // Quad-band takes an awful lot of time
- modemResponse=modem.writeModemCommand(command, 15000);
-
- if(modemResponse.indexOf("QBAND")>=0)
- return true;
- else
- return false;
-} \ No newline at end of file