sigfox
Fork of Sigfox by
Embed:
(wiki syntax)
Show/hide line numbers
Sigfox.h
00001 #ifndef SIGFOX_H 00002 #define SIGFOX_H 00003 00004 #include "ATParser.h" 00005 #include "mbed.h" 00006 00007 00008 typedef struct _sigfoxvoltage { 00009 double current; 00010 double last; 00011 } sigfoxvoltage_t; 00012 00013 class Sigfox 00014 { 00015 private: 00016 ATParser *_at; 00017 public: 00018 char *ID; 00019 char *PAC; 00020 00021 public: 00022 Sigfox(ATParser &at) : _at(&at) {ID= new char[9];PAC= new char[17];}; 00023 00024 bool ready(); 00025 bool reset(); 00026 00027 bool send(const char *data); 00028 /** 00029 * true = public 00030 * false = private 00031 */ 00032 bool setKey(bool type); 00033 /** 00034 * mode = 0 / 1 00035 * power = default 15 | 0 .. 15 00036 */ 00037 00038 bool setCwEU(uint8_t mode ,uint8_t power=15 ) ; 00039 00040 bool setPower(uint8_t power=15); 00041 00042 bool setPowerMode(uint8_t power); 00043 00044 void wakeup(DigitalInOut sig_rst, float time=0.2); 00045 00046 bool saveConfig(); 00047 00048 char *getID(); 00049 00050 char *getPAC(); 00051 00052 sigfoxvoltage_t getVoltages(); 00053 00054 float getTemperature(); 00055 }; 00056 00057 #endif /* SIGFOX_H */
Generated on Fri Jul 29 2022 16:15:33 by
1.7.2
