This is an example application based on Mbed-OS LoRaWAN protocol APIs. The Mbed-OS LoRaWAN stack implementation is compliant with LoRaWAN v1.0.2 specification.

Dependencies:   Lorawan_Version_0_1

Dependents:   Lorawan_Version_0_1

Committer:
jacktractive
Date:
Sun Jan 19 15:53:57 2020 +0000
Revision:
69:316fee01f5d9
Parent:
66:a11c79073f1f
Child:
70:65b2f1cc2859
Objectorientiert

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jacktractive 61:2b30d8e75fe7 1 /* mbed GPS Module Library
jacktractive 61:2b30d8e75fe7 2 * Copyright (c) 2008-2010, sford
jacktractive 61:2b30d8e75fe7 3 * Copyright (c) 2013, B.Adryan
jacktractive 61:2b30d8e75fe7 4 *
jacktractive 61:2b30d8e75fe7 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
jacktractive 61:2b30d8e75fe7 6 * of this software and associated documentation files (the "Software"), to deal
jacktractive 61:2b30d8e75fe7 7 * in the Software without restriction, including without limitation the rights
jacktractive 61:2b30d8e75fe7 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
jacktractive 61:2b30d8e75fe7 9 * copies of the Software, and to permit persons to whom the Software is
jacktractive 61:2b30d8e75fe7 10 * furnished to do so, subject to the following conditions:
jacktractive 61:2b30d8e75fe7 11 *
jacktractive 61:2b30d8e75fe7 12 * The above copyright notice and this permission notice shall be included in
jacktractive 61:2b30d8e75fe7 13 * all copies or substantial portions of the Software.
jacktractive 61:2b30d8e75fe7 14 *
jacktractive 61:2b30d8e75fe7 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jacktractive 61:2b30d8e75fe7 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jacktractive 61:2b30d8e75fe7 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
jacktractive 61:2b30d8e75fe7 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
jacktractive 61:2b30d8e75fe7 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
jacktractive 61:2b30d8e75fe7 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
jacktractive 61:2b30d8e75fe7 21 * THE SOFTWARE.
jacktractive 61:2b30d8e75fe7 22 */
jacktractive 61:2b30d8e75fe7 23
jacktractive 61:2b30d8e75fe7 24 #include "mbed.h"
jacktractive 61:2b30d8e75fe7 25
jacktractive 61:2b30d8e75fe7 26 #ifndef MBED_GPS_H
jacktractive 61:2b30d8e75fe7 27 #define MBED_GPS_H
jacktractive 61:2b30d8e75fe7 28
jacktractive 61:2b30d8e75fe7 29 /** A GPS interface for reading from a serial GPS module */
jacktractive 61:2b30d8e75fe7 30 class GPS {
jacktractive 61:2b30d8e75fe7 31 public:
jacktractive 61:2b30d8e75fe7 32
jacktractive 61:2b30d8e75fe7 33 /** Create the GPS interface, connected to the specified serial port and speed.
jacktractive 61:2b30d8e75fe7 34 * for example, GlobalSat EM406-A (e.g. on SparkFun GPS Shield) is 4800 Baud,
jacktractive 61:2b30d8e75fe7 35 * Adafruit Ultimate GPSv3 (connected to serial) is 9600 Baud
jacktractive 61:2b30d8e75fe7 36 */
jacktractive 61:2b30d8e75fe7 37 GPS(PinName tx, PinName rx, int Baud);
jacktractive 61:2b30d8e75fe7 38
jacktractive 61:2b30d8e75fe7 39 /** Sample the incoming GPS data, returning whether there is a lock
jacktractive 61:2b30d8e75fe7 40 *
jacktractive 61:2b30d8e75fe7 41 * @return 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0
jacktractive 61:2b30d8e75fe7 42 */
jacktractive 61:2b30d8e75fe7 43 int sample();
jacktractive 61:2b30d8e75fe7 44
jacktractive 69:316fee01f5d9 45 void idle(bool idle);
jacktractive 69:316fee01f5d9 46 void GPS_aktiv();
jacktractive 61:2b30d8e75fe7 47
jacktractive 61:2b30d8e75fe7 48 /** Beijig time format(shi,fen,miao) **/
jacktractive 61:2b30d8e75fe7 49 int hour;
jacktractive 61:2b30d8e75fe7 50 int minute;
jacktractive 61:2b30d8e75fe7 51 int seconed;
jacktractive 61:2b30d8e75fe7 52
jacktractive 61:2b30d8e75fe7 53 /** The longitude (call sample() to set) */
jacktractive 61:2b30d8e75fe7 54 float longitude;
jacktractive 61:2b30d8e75fe7 55
jacktractive 61:2b30d8e75fe7 56 /** display north/south, east/west unit**/
jacktractive 61:2b30d8e75fe7 57 char ns, ew, unit;
jacktractive 61:2b30d8e75fe7 58
jacktractive 61:2b30d8e75fe7 59 /** The latitude (call sample() to set) */
jacktractive 61:2b30d8e75fe7 60 float latitude;
jacktractive 61:2b30d8e75fe7 61
jacktractive 61:2b30d8e75fe7 62 /** The time (call sample() to set) */
jacktractive 61:2b30d8e75fe7 63 float time;
jacktractive 61:2b30d8e75fe7 64
jacktractive 61:2b30d8e75fe7 65 /** Number of satellites received (call sample() to set) */
jacktractive 61:2b30d8e75fe7 66 int sats;
jacktractive 61:2b30d8e75fe7 67
jacktractive 61:2b30d8e75fe7 68 /** Horizontal dilusion of precision (call sample() to set) */
jacktractive 61:2b30d8e75fe7 69 float hdop;
jacktractive 61:2b30d8e75fe7 70
jacktractive 61:2b30d8e75fe7 71 /** The altitude (call sample() to set)
jacktractive 61:2b30d8e75fe7 72 Note that the accurate altitude is corrected by the geoid
jacktractive 61:2b30d8e75fe7 73 See http://homepages.slingshot.co.nz/~geoff36/datum.htm
jacktractive 61:2b30d8e75fe7 74 */
jacktractive 61:2b30d8e75fe7 75 float alt;
jacktractive 61:2b30d8e75fe7 76
jacktractive 61:2b30d8e75fe7 77 /** The geoid (call sample() to set) */
jacktractive 61:2b30d8e75fe7 78 float geoid;
jacktractive 61:2b30d8e75fe7 79
jacktractive 69:316fee01f5d9 80 bool is_idle;
jacktractive 69:316fee01f5d9 81 uint32_t idle_time;
jacktractive 69:316fee01f5d9 82
jacktractive 61:2b30d8e75fe7 83 /** The NMEA sentence */
jacktractive 61:2b30d8e75fe7 84 char msg[256];
jacktractive 61:2b30d8e75fe7 85
jacktractive 61:2b30d8e75fe7 86
jacktractive 61:2b30d8e75fe7 87 private:
jacktractive 61:2b30d8e75fe7 88 float trunc(float v);
jacktractive 61:2b30d8e75fe7 89 void getline();
jacktractive 61:2b30d8e75fe7 90
jacktractive 61:2b30d8e75fe7 91 //create a serial object
jacktractive 61:2b30d8e75fe7 92 Serial _gps;
jacktractive 61:2b30d8e75fe7 93 };
jacktractive 61:2b30d8e75fe7 94
jacktractive 61:2b30d8e75fe7 95 #endif