Flotsam / GSM

Dependencies:   Adafruit_GSM

Dependents:   Full-Project

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GSM_Wrapper.h Source File

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