An extension of original API for working with GPS devices.
Dependents: A_TeseoLocationNEW A_TeseoLocation TeseoLocation
GPS_Provider Library
A controller-neutral API for working with GPS devices.
Overview
This library is an extension of the original API published on os.mbed.com
Besides the basic geo-location functionality, this extended API includes the following features:
- Geofencing
- Odometer
- Datalogging
Getting started
This GPS API is meant to be used for building projects on os.mbed.com
A good starting point is this page:
Diff: source/GPSProvider.cpp
- Revision:
- 0:0a9c622571d7
diff -r 000000000000 -r 0a9c622571d7 source/GPSProvider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/source/GPSProvider.cpp Fri Nov 09 17:09:12 2018 +0000 @@ -0,0 +1,252 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2014 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mbed.h" +#include "GPSProviderImplBase.h" +#include "GPSProvider.h" + +bool +GPSProvider::setPowerMode(PowerMode_t power) +{ + return impl->setPowerMode(power); +} + +void +GPSProvider::reset(void) +{ + impl->reset(); +} + +void +GPSProvider::start(void) +{ + impl->start(); +} + +void +GPSProvider::stop(void) +{ + impl->stop(); +} + +void +GPSProvider::process(void) +{ + impl->process(); +} + +bool +GPSProvider::haveDeviceInfo(void) const +{ + return impl->haveDeviceInfo(); +} + +const char * +GPSProvider::getDeviceInfo(void) const +{ + return impl->getDeviceInfo(); +} + +uint32_t +GPSProvider::ioctl(uint32_t command, void *arg) +{ + return impl->ioctl(command, arg); +} + +bool +GPSProvider::locationAvailable(void) const +{ + return impl->locationAvailable(); +} + +const GPSProvider::LocationUpdateParams_t * +GPSProvider::getLastLocation(void) const +{ + return impl->getLastLocation(); +} + +void +GPSProvider::onLocationUpdate(LocationUpdateCallback_t callback) +{ + impl->onLocationUpdate(callback); +} + +void +GPSProvider::lpmGetImmediateLocation(void) +{ + impl->lpmGetImmediateLocation(); +} + +/** [ST-GNSS ] - Enable verbose NMEA stream */ +void +GPSProvider::setVerboseMode(int level) +{ + impl->setVerboseMode(level); +} + +/** [ST-GNSS] - Geofencing API */ +bool +GPSProvider::isGeofencingSupported(void) +{ + return impl->isGeofencingSupported(); +} + +/** [ST-GNSS] - Geofencing API */ +gps_provider_error_t +GPSProvider::enableGeofence(void) +{ + return impl->enableGeofence(); +} + +/** [ST-GNSS] - Geofencing API */ +gps_provider_error_t +GPSProvider::configGeofences(GPSGeofence *geofences[], unsigned geofenceCount) +{ + return impl->configGeofences(geofences, geofenceCount); +} + +/** [ST-GNSS] - Geofencing API */ +gps_provider_error_t +GPSProvider::geofenceReq(void) +{ + return impl->geofenceReq(); +} + +/** [ST-GNSS] - Geofencing API */ +void +GPSProvider::onGeofenceCfgMessage(GeofenceCfgMessageCallback_t callback) +{ + impl->onGeofenceCfgMessage(callback); +} + +/** [ST-GNSS] - Geofencing API */ +void +GPSProvider::onGeofenceStatusMessage(GeofenceStatusMessageCallback_t callback) +{ + impl->onGeofenceStatusMessage(callback); +} + +/** [ST-GNSS] - Datalogging API */ +bool +GPSProvider::isDataloggingSupported(void) +{ + return impl->isDataloggingSupported(); +} + +/** [ST-GNSS] - Datalogging API */ +gps_provider_error_t +GPSProvider::enableDatalog(void) +{ + return impl->enableDatalog(); +} + +/** [ST-GNSS] - Datalogging API */ +gps_provider_error_t +GPSProvider::configDatalog(GPSDatalog *datalog) +{ + return impl->configDatalog(datalog); +} + +/** [ST-GNSS] - Datalogging API */ +gps_provider_error_t +GPSProvider::startDatalog(void) +{ + return impl->startDatalog(); +} + +/** [ST-GNSS] - Datalogging API */ +gps_provider_error_t +GPSProvider::stopDatalog(void) +{ + return impl->stopDatalog(); +} + +/** [ST-GNSS] - Datalogging API */ +gps_provider_error_t +GPSProvider::eraseDatalog(void) +{ + return impl->eraseDatalog(); +} + +/** [ST-GNSS] - Datalogging API */ +gps_provider_error_t +GPSProvider::logReqStatus(void) +{ + return impl->logReqStatus(); +} + +/** [ST-GNSS] - Datalogging API */ +gps_provider_error_t +GPSProvider::logReqQuery(LogQueryParams_t &logReqQuery) +{ + return impl->logReqQuery(logReqQuery); +} + +/** [ST-GNSS] - Datalogging API */ +void +GPSProvider::onLogStatus(LogStatusCallback_t callback) +{ + impl->onLogStatus(callback); +} + +/** [ST-GNSS] - Datalogging API */ +void +GPSProvider::onLogQuery(LogQueryCallback_t callback) +{ + impl->onLogQuery(callback); +} + +/** [ST-GNSS] - Odometer API */ +bool +GPSProvider::isOdometerSupported(void) +{ + return impl->isOdometerSupported(); +} + +/** [ST-GNSS] - Odometer API */ +gps_provider_error_t +GPSProvider::enableOdo(void) +{ + return impl->enableOdo(); +} + +/** [ST-GNSS] - Odometer API */ +gps_provider_error_t +GPSProvider::startOdo(unsigned alarmDistance) +{ + return impl->startOdo(alarmDistance); +} + +/** [ST-GNSS] - Odometer API */ +gps_provider_error_t +GPSProvider::stopOdo(void) +{ + return impl->stopOdo(); +} + +/** [ST-GNSS] - Odometer API */ +gps_provider_error_t +GPSProvider::resetOdo(void) +{ + return impl->resetOdo(); +} + +/** [ST-GNSS] - Odometer API */ +void +GPSProvider::onOdo(OdoCallback_t callback) +{ + impl->onOdo(callback); +} \ No newline at end of file