Sigfox Communication library, allowing you to use any kind of UART able Sigfox Transmitter

Dependencies:   SoftSerial

Dependents:   RUCHE2-CODES RUCHE2-CODES_correctionpoids RUCHE2-CODES

sigfox.h

Committer:
RB62680
Date:
2016-03-12
Revision:
2:975b82a3cde0
Parent:
0:996eb84c895e
Child:
3:7625fe7cd1b6

File content as of revision 2:975b82a3cde0:

#ifndef SIGFOX_H
#define SIGFOX_H

#include "mbed.h"

//Define your baudrate and pins here
#define BAUDRATE     9600
#define PIN_RX       p19
#define PIN_TX       p18

class Sigfox_ {

public:
    Sigfox_();
    //Sigfox_(PinMode TX, PinMode RX);
    
    void begin();
    bool isReady();
    bool send(const void* data, uint8_t len);
    unsigned long getID();
    unsigned long getPAC();
    bool setPowerMode(uint8_t power);

    enum RETURN_CODE {
        OK = 'O',
        KO = 'K',
        SENT = 'S'
    };
    
private:
    //Serial device(p9, p10); 
    //Serial _serial;
    unsigned long _lastSend;

    uint8_t _nextReturn();
};

extern Sigfox_ Sigfox;
#endif