send GPS data via LoRaWAN

Dependencies:   TinyGPS mbed ADXL345_I2C Sht31

EEAB-P1/Eeabp1.h

Committer:
koyo_take
Date:
2017-06-24
Revision:
0:97a57be77fbb
Child:
1:195da8230785

File content as of revision 0:97a57be77fbb:

#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) */