sigfox
Fork of Sigfox by
Sigfox.h@15:5cac9747f00f, 2018-02-27 (annotated)
- Committer:
- helmi_heyliot
- Date:
- Tue Feb 27 12:45:51 2018 +0000
- Revision:
- 15:5cac9747f00f
- Parent:
- 14:e858a765590a
v0 dev heymag;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Raffaello | 6:799a482a7024 | 1 | #ifndef SIGFOX_H |
| Raffaello | 6:799a482a7024 | 2 | #define SIGFOX_H |
| Raffaello | 0:5e0ae613c18c | 3 | |
| Raffaello | 0:5e0ae613c18c | 4 | #include "ATParser.h" |
| Raffaello | 0:5e0ae613c18c | 5 | #include "mbed.h" |
| Raffaello | 0:5e0ae613c18c | 6 | |
| Raffaello | 9:7b18b2817eba | 7 | |
| Raffaello | 6:799a482a7024 | 8 | typedef struct _sigfoxvoltage { |
| Raffaello | 6:799a482a7024 | 9 | double current; |
| Raffaello | 6:799a482a7024 | 10 | double last; |
| Raffaello | 6:799a482a7024 | 11 | } sigfoxvoltage_t; |
| Raffaello | 6:799a482a7024 | 12 | |
| Raffaello | 0:5e0ae613c18c | 13 | class Sigfox |
| Raffaello | 0:5e0ae613c18c | 14 | { |
| Raffaello | 0:5e0ae613c18c | 15 | private: |
| Raffaello | 0:5e0ae613c18c | 16 | ATParser *_at; |
| helmi_heyliot | 14:e858a765590a | 17 | public: |
| helmi_heyliot | 14:e858a765590a | 18 | char *ID; |
| helmi_heyliot | 14:e858a765590a | 19 | char *PAC; |
| Raffaello | 0:5e0ae613c18c | 20 | |
| Raffaello | 0:5e0ae613c18c | 21 | public: |
| helmi_heyliot | 14:e858a765590a | 22 | Sigfox(ATParser &at) : _at(&at) {ID= new char[9];PAC= new char[17];}; |
| Raffaello | 0:5e0ae613c18c | 23 | |
| Raffaello | 0:5e0ae613c18c | 24 | bool ready(); |
| helmi_heyliot | 14:e858a765590a | 25 | bool reset(); |
| Raffaello | 0:5e0ae613c18c | 26 | |
| dahmani_belkacem | 12:43a4b8ba4635 | 27 | bool send(const char *data); |
| Raffaello | 4:c77d5019b264 | 28 | /** |
| Raffaello | 4:c77d5019b264 | 29 | * true = public |
| Raffaello | 4:c77d5019b264 | 30 | * false = private |
| Raffaello | 4:c77d5019b264 | 31 | */ |
| Raffaello | 4:c77d5019b264 | 32 | bool setKey(bool type); |
| helmi_heyliot | 15:5cac9747f00f | 33 | /** |
| helmi_heyliot | 15:5cac9747f00f | 34 | * mode = 0 / 1 |
| helmi_heyliot | 15:5cac9747f00f | 35 | * power = default 15 | 0 .. 15 |
| helmi_heyliot | 15:5cac9747f00f | 36 | */ |
| helmi_heyliot | 15:5cac9747f00f | 37 | |
| helmi_heyliot | 15:5cac9747f00f | 38 | bool setCwEU(uint8_t mode ,uint8_t power=15 ) ; |
| Raffaello | 1:93450d8b2540 | 39 | |
| Raffaello | 2:d07e3b39ff74 | 40 | bool setPower(uint8_t power=15); |
| Raffaello | 2:d07e3b39ff74 | 41 | |
| Raffaello | 1:93450d8b2540 | 42 | bool setPowerMode(uint8_t power); |
| Raffaello | 1:93450d8b2540 | 43 | |
| Raffaello | 2:d07e3b39ff74 | 44 | void wakeup(DigitalInOut sig_rst, float time=0.2); |
| Raffaello | 1:93450d8b2540 | 45 | |
| Raffaello | 5:66e05787ad5c | 46 | bool saveConfig(); |
| Raffaello | 5:66e05787ad5c | 47 | |
| Raffaello | 2:d07e3b39ff74 | 48 | char *getID(); |
| Raffaello | 2:d07e3b39ff74 | 49 | |
| Raffaello | 2:d07e3b39ff74 | 50 | char *getPAC(); |
| Raffaello | 6:799a482a7024 | 51 | |
| Raffaello | 6:799a482a7024 | 52 | sigfoxvoltage_t getVoltages(); |
| Raffaello | 8:b10abac6a42e | 53 | |
| Raffaello | 8:b10abac6a42e | 54 | float getTemperature(); |
| Raffaello | 6:799a482a7024 | 55 | }; |
| Raffaello | 6:799a482a7024 | 56 | |
| Raffaello | 6:799a482a7024 | 57 | #endif /* SIGFOX_H */ |
