Example program demonstrating sending and reading SMS messages from the cellular modem using the MTSAS library.
Revision 11:159b76eafb5c, committed 2015-07-09
- Comitter:
- leon123
- Date:
- Thu Jul 09 19:04:55 2015 +0000
- Parent:
- 10:9eef9183a9f6
- Commit message:
- Added #defines for the possible hardware platform selections. Re-ordered the hardware selection code to the top. Added a note for the log output and fixed a misspelling.
Changed in this revision
diff -r 9eef9183a9f6 -r 159b76eafb5c main.cpp --- a/main.cpp Thu Jul 09 15:44:59 2015 +0000 +++ b/main.cpp Thu Jul 09 19:04:55 2015 +0000 @@ -1,7 +1,45 @@ #include "mbed.h" #include "mtsas.h" +/******************************** NOTE *******************************/ +/******** Uncomment the hardware platform you are working on. ********/ +#define DRAGONFLY +//#define NUCLEO_F401RE +//#define FREESCALE_KL46Z +//#define FREESCALE_K64F +/*********************************************************************/ + int main(){ + +#if defined(DRAGONFLY) + /** Dragonfly + * To configure the serial pins for the Dragonfly board, use: + * RADIO_TX = pin PC_7, RADIO_RX = pin PC_6 + * RADIO_RTS = pin PB_10,RADIO_CTS = pin PB_12 + */ + MTSSerialFlowControl* io = new MTSSerialFlowControl(RADIO_TX, RADIO_RX, RADIO_RTS, RADIO_CTS); +#elif defined(NUCLEO_F401RE) + /** STMicro Nucleo F401RE + * The supported jumper configurations of the MTSAS do not line up with + * the pin mapping of the Nucleo F401RE. Therefore, the MTSAS serial TX + * pin (JP8 Pin 2) must be manually jumped to Serial1 RX (Shield pin D2) + * and the MTSAS serial RX pin (JP9 Pin 2) pin must be manually jumped to + * Serial1 TX (Shield pin D8). + */ + MTSSerialFlowControl* io = new MTSSerialFlowControl(D8, D2, D3, D6); +#elif defined(FREESCALE_KL46Z) + /** Freescale KL46Z + * To configure the serial pins for the Freescale KL46Z board, use MTSAS jumper + * configuration B. + */ + MTSSerialFlowControl* io = new MTSSerialFlowControl(D2, D9, D3, D6); +#elif defined(FREESCALE_K64F) + /** Freescale K64F + * To configure the serial pins for the Freescale K64F board, use MTSAS jumper + * configuration A. + */ + MTSSerialFlowControl* io = new MTSSerialFlowControl(D1, D0, D3, D6); +#endif //Sets the log level to INFO, higher log levels produce more log output. //Possible levels: NONE, FATAL, ERROR, WARNING, INFO, DEBUG, TRACE @@ -17,36 +55,6 @@ txtmsg.phoneNumber = PHONE_NUMBER; txtmsg.message = "Hello World! MTSAS is up and running!"; - /** STMicro Nucelo F401RE - * The supported jumper configurations of the MTSAS do not line up with - * the pin mapping of the Nucleo F401RE. Therefore, the MTSAS serial TX - * pin (JP8 Pin 2) must be manually jumped to Serial1 RX (Shield pin D2) - * and the MTSAS serial RX pin (JP9 Pin 2) pin must be manually jumped to - * Serial1 TX (Shield pin D8). - * Uncomment the following line to use the STMicro Nuceleo F401RE - */ - MTSSerialFlowControl* io = new MTSSerialFlowControl(D8, D2, D3, D6); - - /** Dragonfly - * To configure the serial pins for the Dragonfly board, use: - * RADIO_TX = pin PC_7, RADIO_RX = pin PC_6 - * RADIO_RTS = pin PB_10,RADIO_CTS = pin PB_12 - * Uncomment the following line to use the Dragonfly board - */ - //MTSSerialFlowControl* io = new MTSSerialFlowControl(RADIO_TX, RADIO_RX, RADIO_RTS, RADIO_CTS); - - /** Freescale KL46Z - * To configure the serial pins for the Freescale KL46Z board, use MTSAS jumper - * configuration B. Uncomment the following line to use the Freescale KL46Z board - */ - //MTSSerialFlowControl* io = new MTSSerialFlowControl(D2, D9, D3, D6); - - /** Freescale K64F - * To configure the serial pins for the Freescale K64F board, use MTSAS jumper - * configuration A. Uncomment the following line to use the Freescale K64F board - */ - //MTSSerialFlowControl* io = new MTSSerialFlowControl(D1, D0, D3, D6); - //Sets the baud rate for communicating with the radio io->baud(115200);
diff -r 9eef9183a9f6 -r 159b76eafb5c mbed-src.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-src.lib Thu Jul 09 19:04:55 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-src/#dfaf40375987
diff -r 9eef9183a9f6 -r 159b76eafb5c mbed.bld --- a/mbed.bld Thu Jul 09 15:44:59 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0 \ No newline at end of file