Sigfox Communication library, allowing you to use any kind of UART able Sigfox Transmitter
Diff: sigfox.h
- Revision:
- 0:996eb84c895e
- Child:
- 2:975b82a3cde0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sigfox.h Fri Mar 11 08:24:52 2016 +0000 @@ -0,0 +1,39 @@ +#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 \ No newline at end of file