[136] | 1 | /*
|
---|
| 2 | This file is part of the GSM3 communications library for Arduino
|
---|
| 3 | -- Multi-transport communications platform
|
---|
| 4 | -- Fully asynchronous
|
---|
| 5 | -- Includes code for the Arduino-Telefonica GSM/GPRS Shield V1
|
---|
| 6 | -- Voice calls
|
---|
| 7 | -- SMS
|
---|
| 8 | -- TCP/IP connections
|
---|
| 9 | -- HTTP basic clients
|
---|
| 10 |
|
---|
| 11 | This library has been developed by Telefónica Digital - PDI -
|
---|
| 12 | - Physical Internet Lab, as part as its collaboration with
|
---|
| 13 | Arduino and the Open Hardware Community.
|
---|
| 14 |
|
---|
| 15 | September-December 2012
|
---|
| 16 |
|
---|
| 17 | This library is free software; you can redistribute it and/or
|
---|
| 18 | modify it under the terms of the GNU Lesser General Public
|
---|
| 19 | License as published by the Free Software Foundation; either
|
---|
| 20 | version 2.1 of the License, or (at your option) any later version.
|
---|
| 21 |
|
---|
| 22 | This library is distributed in the hope that it will be useful,
|
---|
| 23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 25 | Lesser General Public License for more details.
|
---|
| 26 |
|
---|
| 27 | You should have received a copy of the GNU Lesser General Public
|
---|
| 28 | License along with this library; if not, write to the Free Software
|
---|
| 29 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
| 30 |
|
---|
| 31 | The latest version of this library can always be found at
|
---|
| 32 | https://github.com/BlueVia/Official-Arduino
|
---|
| 33 | */
|
---|
| 34 | #ifndef __GSM3SHIELDV1BANDMANAGEMENT__
|
---|
| 35 | #define __GSM3SHIELDV1BANDMANAGEMENT__
|
---|
| 36 |
|
---|
| 37 | // This class executes band management functions for the ShieldV1
|
---|
| 38 | #include <GSM3ShieldV1DirectModemProvider.h>
|
---|
| 39 |
|
---|
| 40 | #define NUMBEROFBANDS 7
|
---|
| 41 | #define GSM_MODE_UNDEFINED "UNDEFINED"
|
---|
| 42 | #define GSM_MODE_EGSM "EGSM_MODE"
|
---|
| 43 | #define GSM_MODE_DCS "DCS_MODE"
|
---|
| 44 | #define GSM_MODE_PCS "PCS_MODE"
|
---|
| 45 | #define GSM_MODE_EGSM_DCS "EGSM_DCS_MODE"
|
---|
| 46 | #define GSM_MODE_GSM850_PCS "GSM850_PCS_MODE"
|
---|
| 47 | #define GSM_MODE_GSM850_EGSM_DCS_PCS "GSM850_EGSM_DCS_PCS_MODE"
|
---|
| 48 |
|
---|
| 49 | typedef enum GSM3GSMBand {UNDEFINED, EGSM_MODE, DCS_MODE, PCS_MODE, EGSM_DCS_MODE, GSM850_PCS_MODE, GSM850_EGSM_DCS_PCS_MODE};
|
---|
| 50 |
|
---|
| 51 | //
|
---|
| 52 | // These are the bands and scopes:
|
---|
| 53 | //
|
---|
| 54 | // E-GSM(900)
|
---|
| 55 | // DCS(1800)
|
---|
| 56 | // PCS(1900)
|
---|
| 57 | // E-GSM(900)+DCS(1800) ex: Europe
|
---|
| 58 | // GSM(850)+PCS(1900) Ex: USA, South Am.
|
---|
| 59 | // GSM(850)+E-GSM(900)+DCS(1800)+PCS(1900)
|
---|
| 60 |
|
---|
| 61 | class GSM3ShieldV1BandManagement
|
---|
| 62 | {
|
---|
| 63 | private:
|
---|
| 64 |
|
---|
| 65 | GSM3ShieldV1DirectModemProvider modem; // Direct access to modem
|
---|
| 66 |
|
---|
| 67 | char* quectelStrings[NUMBEROFBANDS];// = {"\"EGSM_MODE\"", "\"DCS_MODE\"", "\"PCS_MODE\"",
|
---|
| 68 | //"\"EGSM_DCS_MODE\"", "\"GSM850_PCS_MODE\"",
|
---|
| 69 | //"\"GSM850_EGSM_DCS_PCS_MODE\""};
|
---|
| 70 |
|
---|
| 71 |
|
---|
| 72 | public:
|
---|
| 73 |
|
---|
| 74 | /** Constructor
|
---|
| 75 | @param trace If true, dumps all AT dialogue to Serial
|
---|
| 76 | */
|
---|
| 77 | GSM3ShieldV1BandManagement(bool trace=false);
|
---|
| 78 |
|
---|
| 79 | /** Forces modem hardware restart, so we begin from scratch
|
---|
| 80 | @return always returns IDLE status
|
---|
| 81 | */
|
---|
| 82 | GSM3_NetworkStatus_t begin();
|
---|
| 83 |
|
---|
| 84 | /** Get current modem work band
|
---|
| 85 | @return current modem work band
|
---|
| 86 | */
|
---|
| 87 | String getBand();
|
---|
| 88 |
|
---|
| 89 | /** Changes the modem operating band
|
---|
| 90 | @param band Desired new band
|
---|
| 91 | @return true if success, false otherwise
|
---|
| 92 | */
|
---|
| 93 | bool setBand(String band);
|
---|
| 94 |
|
---|
| 95 | };
|
---|
| 96 | #endif
|
---|