send GPS data via LoRaWAN
Dependencies: TinyGPS mbed ADXL345_I2C Sht31
Diff: EEAB-P1/Eeabp1.h
- Revision:
- 0:97a57be77fbb
- Child:
- 1:195da8230785
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EEAB-P1/Eeabp1.h Sat Jun 24 03:45:00 2017 +0000 @@ -0,0 +1,46 @@ +#if !defined(EEAPP1_H) +#define EEAPP1_H +#include "mbed.h" +#include "types.h" + +enum EeabLedState { + LED_OFF, + LED_ON, + LED_BLINK_FAST, + LED_BLINK_MID, + LED_BLINK_SLOW, +}; + +class Eeabp1 +{ +public: + Eeabp1(); + int setLedState(EeabLedState state); + void loop(void); + int debug(const char * format, ...); + int setLoRaPower(bool on); + int sendLoRaString(const char * format, ...); + void setGrovePower(bool on); + +private: + DigitalOut pwr_en; + /* state LED */ + DigitalOut led; + EeabLedState led_state; + /* LoRa */ + RawSerial *serial; + DigitalOut lora_power; + DigitalOut lora_reset; + bool lora_enabled; + /* Grove */ + DigitalOut grove_power; + bool grove_enabled; + + void flushSerial(); + int chkSerialChar(const char,uint16_t); + int waitSerialChar(const char,uint16_t); + int chkSerialCharOk(); + int chkSerialCharRes(char); +}; + +#endif /* !defined(EEAPP1_H) */ \ No newline at end of file