softemp

Dependencies:   mbed DHT22 ATParser SerialGPS

Committer:
svupper
Date:
Wed Nov 21 17:33:07 2018 +0000
Revision:
3:06b0680034a7
sofmbedtemp

Who changed what in which revision?

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