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: Adafruit_GSM
GSM_Wrapper.h
00001 #include "Adafruit_FONA.h" 00002 #include "main.h" 00003 #include "storage.h" 00004 00005 #define FONA_BAUD_RATE 9600 // FONA baud rate 00006 #define ENABLE_GPRS_ATTEMPTS 5 // Number of attempts to enable GPRS if it fails 00007 00008 #ifndef _GSM_WRAPPER_CLASS 00009 #define _GSM_WRAPPER_CLASS 00010 00011 /* Class: GSM_Sensor 00012 * ----------------- 00013 * A "wrapper" class for the GSM library, abstracting 00014 * the Adafruit GSM library for use in this project. 00015 */ 00016 class GSM_Sensor { 00017 public: 00018 GSM_Sensor(): fona(FONA_TX, FONA_RX, FONA_RST, FONA_RI), key(FONA_KEY) {} 00019 void changePowerState(); 00020 void setup(); 00021 bool send(uint8_t* data, size_t size); 00022 private: 00023 bool sendOverHTTP(char* url, uint8_t* data, int dlength); 00024 Adafruit_FONA fona; 00025 DigitalOut key; 00026 }; 00027 00028 #endif
Generated on Tue Jul 12 2022 19:23:02 by
1.7.2