A controller-neutral API for working with GPS devices.
Dependents: CsrLocationDemo CsrLocationDemo
GPSProviderImplBase.h
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2006-2014 ARM Limited 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef __GPS_PROVIDER_INSTANCE_BASE_H__ 00018 #define __GPS_PROVIDER_INSTANCE_BASE_H__ 00019 00020 #include "GPSProvider.h" 00021 00022 class GPSProviderImplBase { 00023 public: 00024 virtual bool setPowerMode(GPSProvider::PowerMode_t power) = 0; 00025 virtual void reset(void) = 0; 00026 virtual void start(void) = 0; 00027 virtual void stop(void) = 0; 00028 virtual void process(void) = 0; 00029 virtual void lpmGetImmediateLocation(void) = 0; 00030 virtual uint32_t ioctl(uint32_t command, void *arg) = 0; 00031 00032 virtual bool haveDeviceInfo(void) const { 00033 return (deviceInfo != NULL); 00034 } 00035 virtual const char *getDeviceInfo(void) const { 00036 return deviceInfo; 00037 } 00038 virtual bool locationAvailable(void) const { 00039 return lastLocation.valid; 00040 } 00041 virtual const GPSProvider::LocationUpdateParams_t *getLastLocation(void) const { 00042 return (lastLocation.valid) ? &lastLocation : NULL; 00043 } 00044 virtual void onLocationUpdate(GPSProvider::LocationUpdateCallback_t callback) { 00045 locationCallback = callback; 00046 } 00047 00048 protected: 00049 GPSProvider::LocationUpdateParams_t lastLocation; 00050 const char *deviceInfo; 00051 GPSProvider::LocationUpdateCallback_t locationCallback; 00052 }; 00053 00054 #endif /* __GPS_PROVIDER_INSTANCE_BASE_H__ */
Generated on Fri Jul 15 2022 07:53:07 by 1.7.2