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

Dependents:   TestVirtualisation

sigfox.h

Committer:
adrien3d
Date:
2016-03-11
Revision:
0:996eb84c895e
Child:
2:975b82a3cde0

File content as of revision 0:996eb84c895e:

#ifndef SIGFOX_H
#define SIGFOX_H

#include "mbed.h"

//Define your baudrate and pins here
#define BAUDRATE      9600
#define PIN_RX       p7
#define PIN_TX       p8

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