sigfox
Fork of Sigfox by
Sigfox.h@14:e858a765590a, 2018-02-20 (annotated)
- Committer:
- helmi_heyliot
- Date:
- Tue Feb 20 15:07:48 2018 +0000
- Revision:
- 14:e858a765590a
- Parent:
- 12:43a4b8ba4635
- Child:
- 15:5cac9747f00f
getID & getPAC function updated
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Raffaello | 0:5e0ae613c18c | 1 | /* Copyright (c) 2015 ARM Limited |
| Raffaello | 0:5e0ae613c18c | 2 | * |
| Raffaello | 0:5e0ae613c18c | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| Raffaello | 0:5e0ae613c18c | 4 | * you may not use this file except in compliance with the License. |
| Raffaello | 0:5e0ae613c18c | 5 | * You may obtain a copy of the License at |
| Raffaello | 0:5e0ae613c18c | 6 | * |
| Raffaello | 0:5e0ae613c18c | 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| Raffaello | 0:5e0ae613c18c | 8 | * |
| Raffaello | 0:5e0ae613c18c | 9 | * Unless required by applicable law or agreed to in writing, software |
| Raffaello | 0:5e0ae613c18c | 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| Raffaello | 0:5e0ae613c18c | 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| Raffaello | 0:5e0ae613c18c | 12 | * See the License for the specific language governing permissions and |
| Raffaello | 0:5e0ae613c18c | 13 | * limitations under the License. |
| Raffaello | 0:5e0ae613c18c | 14 | * |
| Raffaello | 0:5e0ae613c18c | 15 | * @section DESCRIPTION |
| Raffaello | 0:5e0ae613c18c | 16 | * |
| Raffaello | 0:5e0ae613c18c | 17 | * Send command to Sigfox |
| Raffaello | 0:5e0ae613c18c | 18 | * |
| Raffaello | 0:5e0ae613c18c | 19 | */ |
| Raffaello | 6:799a482a7024 | 20 | #ifndef SIGFOX_H |
| Raffaello | 6:799a482a7024 | 21 | #define SIGFOX_H |
| Raffaello | 0:5e0ae613c18c | 22 | |
| Raffaello | 0:5e0ae613c18c | 23 | #include "ATParser.h" |
| Raffaello | 0:5e0ae613c18c | 24 | #include "mbed.h" |
| Raffaello | 0:5e0ae613c18c | 25 | |
| Raffaello | 9:7b18b2817eba | 26 | // https://www.disk91.com/2016/technology/sigfox/test-of-sigfox-wisol-wssfm10r1-module/ |
| Raffaello | 9:7b18b2817eba | 27 | |
| Raffaello | 6:799a482a7024 | 28 | typedef struct _sigfoxvoltage { |
| Raffaello | 6:799a482a7024 | 29 | double current; |
| Raffaello | 6:799a482a7024 | 30 | double last; |
| Raffaello | 6:799a482a7024 | 31 | } sigfoxvoltage_t; |
| Raffaello | 6:799a482a7024 | 32 | |
| Raffaello | 0:5e0ae613c18c | 33 | class Sigfox |
| Raffaello | 0:5e0ae613c18c | 34 | { |
| Raffaello | 0:5e0ae613c18c | 35 | private: |
| Raffaello | 0:5e0ae613c18c | 36 | ATParser *_at; |
| helmi_heyliot | 14:e858a765590a | 37 | public: |
| helmi_heyliot | 14:e858a765590a | 38 | char *ID; |
| helmi_heyliot | 14:e858a765590a | 39 | char *PAC; |
| Raffaello | 0:5e0ae613c18c | 40 | |
| Raffaello | 0:5e0ae613c18c | 41 | public: |
| helmi_heyliot | 14:e858a765590a | 42 | Sigfox(ATParser &at) : _at(&at) {ID= new char[9];PAC= new char[17];}; |
| Raffaello | 0:5e0ae613c18c | 43 | |
| Raffaello | 0:5e0ae613c18c | 44 | bool ready(); |
| helmi_heyliot | 14:e858a765590a | 45 | bool reset(); |
| Raffaello | 0:5e0ae613c18c | 46 | |
| dahmani_belkacem | 12:43a4b8ba4635 | 47 | bool send(const char *data); |
| Raffaello | 4:c77d5019b264 | 48 | /** |
| Raffaello | 4:c77d5019b264 | 49 | * true = public |
| Raffaello | 4:c77d5019b264 | 50 | * false = private |
| Raffaello | 4:c77d5019b264 | 51 | */ |
| Raffaello | 4:c77d5019b264 | 52 | bool setKey(bool type); |
| Raffaello | 1:93450d8b2540 | 53 | |
| Raffaello | 2:d07e3b39ff74 | 54 | bool setPower(uint8_t power=15); |
| Raffaello | 2:d07e3b39ff74 | 55 | |
| Raffaello | 1:93450d8b2540 | 56 | bool setPowerMode(uint8_t power); |
| Raffaello | 1:93450d8b2540 | 57 | |
| Raffaello | 2:d07e3b39ff74 | 58 | void wakeup(DigitalInOut sig_rst, float time=0.2); |
| Raffaello | 1:93450d8b2540 | 59 | |
| Raffaello | 5:66e05787ad5c | 60 | bool saveConfig(); |
| Raffaello | 5:66e05787ad5c | 61 | |
| Raffaello | 2:d07e3b39ff74 | 62 | char *getID(); |
| Raffaello | 2:d07e3b39ff74 | 63 | |
| Raffaello | 2:d07e3b39ff74 | 64 | char *getPAC(); |
| Raffaello | 6:799a482a7024 | 65 | |
| Raffaello | 6:799a482a7024 | 66 | sigfoxvoltage_t getVoltages(); |
| Raffaello | 8:b10abac6a42e | 67 | |
| Raffaello | 8:b10abac6a42e | 68 | float getTemperature(); |
| Raffaello | 6:799a482a7024 | 69 | }; |
| Raffaello | 6:799a482a7024 | 70 | |
| Raffaello | 6:799a482a7024 | 71 | #endif /* SIGFOX_H */ |
