This is the sample program that can see the decode result of barcode data on Watson IoT.

Dependencies:   AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Location.h Source File

Location.h

Go to the documentation of this file.
00001 /**
00002  * @file    Location.h
00003  * @brief   mbed CoAP Endpoint location base class
00004  * @author  Doug Anson/Chris Paola
00005  * @version 1.0
00006  * @see
00007  *
00008  * Copyright (c) 2014
00009  *
00010  * Licensed under the Apache License, Version 2.0 (the "License");
00011  * you may not use this file except in compliance with the License.
00012  * You may obtain a copy of the License at
00013  *
00014  *     http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing, software
00017  * distributed under the License is distributed on an "AS IS" BASIS,
00018  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00019  * See the License for the specific language governing permissions and
00020  * limitations under the License.
00021  */
00022 
00023 #ifndef __LOCATION_H__
00024 #define __LOCATION_H__
00025 
00026 // mbedConnectorInterface configuration
00027 #include "mbed-connector-interface/mbedConnectorInterface.h"
00028 
00029 // mbed support
00030 #if defined(MCI_USE_YOTTA)
00031     // mbed support
00032     #include "mbed-drivers/mbed.h"
00033 #else
00034     // mbed support
00035     #include "mbed.h"
00036 #endif
00037 
00038 // Max length of a coordinate:  -XXX.YYYYYY
00039 #define LOCATION_COORDINATE_LENGTH 12
00040 
00041 // Max length of the MSL altitude (m): ZZZZZZ.Z
00042 #define LOCATION_MSL_ALT_LENGTH    9
00043 
00044 // Max length of the speed (km/h): ZZZZZZ.Z
00045 #define LOCATION_SPEED_LENGTH      9
00046 
00047 namespace Connector {
00048     
00049 /** Location class
00050  */
00051 class Location
00052 {
00053 protected:
00054     char      m_latitude[LOCATION_COORDINATE_LENGTH+1];
00055     char      m_longitude[LOCATION_COORDINATE_LENGTH+1];
00056     char      m_msl_altitude_m[LOCATION_MSL_ALT_LENGTH+1];
00057     char      m_speed[LOCATION_SPEED_LENGTH+1];
00058     
00059 public:
00060     /**
00061     Default constructor
00062     */
00063     Location();
00064 
00065     /**
00066     Copy constructor
00067     @param logger input Location instance to deep copy
00068     */
00069     Location(const Location &location);
00070 
00071     /**
00072     Destructor
00073     */
00074     virtual ~Location();
00075 
00076     /**
00077     Update the current location (pure virtual)
00078     */
00079     virtual void updateLocation() = 0;
00080     
00081     /**
00082     Get latest Latitude
00083     */
00084     virtual char *getLatitude();
00085     
00086     /**
00087     Get latest Longitude
00088     */
00089     virtual char *getLongitude();
00090     
00091     /**
00092     Get latest MSL Altitude (m)
00093     */
00094     char *getMSLAltitude();
00095     
00096     /**
00097     Get latest Speed (km/h) (pure virtual)
00098     */
00099     char *getSpeed();
00100 };
00101 
00102 };
00103 
00104 #endif // __LOCATION_H__
00105