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

Dependents:   TestVirtualisation

Committer:
Sidibe
Date:
Tue Jan 15 15:18:38 2019 +0000
Revision:
3:3ef537a95c15
Parent:
2:975b82a3cde0
bonjour

Who changed what in which revision?

UserRevisionLine numberNew contents of line
adrien3d 0:996eb84c895e 1 #ifndef SIGFOX_H
adrien3d 0:996eb84c895e 2 #define SIGFOX_H
adrien3d 0:996eb84c895e 3
adrien3d 0:996eb84c895e 4 #include "mbed.h"
adrien3d 0:996eb84c895e 5
adrien3d 0:996eb84c895e 6 //Define your baudrate and pins here
RB62680 2:975b82a3cde0 7 #define BAUDRATE 9600
Sidibe 3:3ef537a95c15 8 #define PIN_RX PA_10
Sidibe 3:3ef537a95c15 9 #define PIN_TX PA_9
adrien3d 0:996eb84c895e 10
adrien3d 0:996eb84c895e 11 class Sigfox_ {
adrien3d 0:996eb84c895e 12
adrien3d 0:996eb84c895e 13 public:
adrien3d 0:996eb84c895e 14 Sigfox_();
adrien3d 0:996eb84c895e 15 //Sigfox_(PinMode TX, PinMode RX);
adrien3d 0:996eb84c895e 16
adrien3d 0:996eb84c895e 17 void begin();
adrien3d 0:996eb84c895e 18 bool isReady();
adrien3d 0:996eb84c895e 19 bool send(const void* data, uint8_t len);
adrien3d 0:996eb84c895e 20 unsigned long getID();
adrien3d 0:996eb84c895e 21 unsigned long getPAC();
adrien3d 0:996eb84c895e 22 bool setPowerMode(uint8_t power);
adrien3d 0:996eb84c895e 23
adrien3d 0:996eb84c895e 24 enum RETURN_CODE {
adrien3d 0:996eb84c895e 25 OK = 'O',
adrien3d 0:996eb84c895e 26 KO = 'K',
adrien3d 0:996eb84c895e 27 SENT = 'S'
adrien3d 0:996eb84c895e 28 };
adrien3d 0:996eb84c895e 29
adrien3d 0:996eb84c895e 30 private:
adrien3d 0:996eb84c895e 31 //Serial device(p9, p10);
adrien3d 0:996eb84c895e 32 //Serial _serial;
adrien3d 0:996eb84c895e 33 unsigned long _lastSend;
adrien3d 0:996eb84c895e 34
adrien3d 0:996eb84c895e 35 uint8_t _nextReturn();
adrien3d 0:996eb84c895e 36 };
adrien3d 0:996eb84c895e 37
adrien3d 0:996eb84c895e 38 extern Sigfox_ Sigfox;
adrien3d 0:996eb84c895e 39 #endif