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
mbedConnectorInterface/source/Location.cpp@1:67f8b5cfde75, 2016-11-10 (annotated)
- Committer:
- Osamu Nakamura
- Date:
- Thu Nov 10 20:23:55 2016 +0900
- Revision:
- 1:67f8b5cfde75
- Parent:
- 0:7d720671e6dc
Revised the initial value of /888/0/7700
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Osamu Nakamura |
0:7d720671e6dc | 1 | /** |
Osamu Nakamura |
0:7d720671e6dc | 2 | * @file Location.cpp |
Osamu Nakamura |
0:7d720671e6dc | 3 | * @brief mbed CoAP Endpoint Location base class |
Osamu Nakamura |
0:7d720671e6dc | 4 | * @author Doug Anson/Chris Paola |
Osamu Nakamura |
0:7d720671e6dc | 5 | * @version 1.0 |
Osamu Nakamura |
0:7d720671e6dc | 6 | * @see |
Osamu Nakamura |
0:7d720671e6dc | 7 | * |
Osamu Nakamura |
0:7d720671e6dc | 8 | * Copyright (c) 2014 |
Osamu Nakamura |
0:7d720671e6dc | 9 | * |
Osamu Nakamura |
0:7d720671e6dc | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Osamu Nakamura |
0:7d720671e6dc | 11 | * you may not use this file except in compliance with the License. |
Osamu Nakamura |
0:7d720671e6dc | 12 | * You may obtain a copy of the License at |
Osamu Nakamura |
0:7d720671e6dc | 13 | * |
Osamu Nakamura |
0:7d720671e6dc | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
Osamu Nakamura |
0:7d720671e6dc | 15 | * |
Osamu Nakamura |
0:7d720671e6dc | 16 | * Unless required by applicable law or agreed to in writing, software |
Osamu Nakamura |
0:7d720671e6dc | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
Osamu Nakamura |
0:7d720671e6dc | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Osamu Nakamura |
0:7d720671e6dc | 19 | * See the License for the specific language governing permissions and |
Osamu Nakamura |
0:7d720671e6dc | 20 | * limitations under the License. |
Osamu Nakamura |
0:7d720671e6dc | 21 | */ |
Osamu Nakamura |
0:7d720671e6dc | 22 | |
Osamu Nakamura |
0:7d720671e6dc | 23 | // Class support |
Osamu Nakamura |
0:7d720671e6dc | 24 | #include "mbed-connector-interface/Location.h" |
Osamu Nakamura |
0:7d720671e6dc | 25 | |
Osamu Nakamura |
0:7d720671e6dc | 26 | namespace Connector { |
Osamu Nakamura |
0:7d720671e6dc | 27 | |
Osamu Nakamura |
0:7d720671e6dc | 28 | // Constructor |
Osamu Nakamura |
0:7d720671e6dc | 29 | Location::Location() { |
Osamu Nakamura |
0:7d720671e6dc | 30 | memset(this->m_latitude,0,LOCATION_COORDINATE_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 31 | memset(this->m_longitude,0,LOCATION_COORDINATE_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 32 | memset(this->m_msl_altitude_m,0,LOCATION_MSL_ALT_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 33 | memset(this->m_speed,0,LOCATION_SPEED_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 34 | } |
Osamu Nakamura |
0:7d720671e6dc | 35 | |
Osamu Nakamura |
0:7d720671e6dc | 36 | // Copy Constructor |
Osamu Nakamura |
0:7d720671e6dc | 37 | Location::Location(const Location &location) { |
Osamu Nakamura |
0:7d720671e6dc | 38 | memcpy(this->m_latitude,location.m_latitude,LOCATION_COORDINATE_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 39 | memcpy(this->m_longitude,location.m_longitude,LOCATION_COORDINATE_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 40 | memcpy(this->m_msl_altitude_m,location.m_msl_altitude_m,LOCATION_MSL_ALT_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 41 | memcpy(this->m_speed,location.m_speed,LOCATION_SPEED_LENGTH+1); |
Osamu Nakamura |
0:7d720671e6dc | 42 | } |
Osamu Nakamura |
0:7d720671e6dc | 43 | |
Osamu Nakamura |
0:7d720671e6dc | 44 | // Destructor |
Osamu Nakamura |
0:7d720671e6dc | 45 | Location::~Location() { |
Osamu Nakamura |
0:7d720671e6dc | 46 | } |
Osamu Nakamura |
0:7d720671e6dc | 47 | |
Osamu Nakamura |
0:7d720671e6dc | 48 | // get the latitude |
Osamu Nakamura |
0:7d720671e6dc | 49 | char *Location::getLatitude() { |
Osamu Nakamura |
0:7d720671e6dc | 50 | return this->m_latitude; |
Osamu Nakamura |
0:7d720671e6dc | 51 | } |
Osamu Nakamura |
0:7d720671e6dc | 52 | |
Osamu Nakamura |
0:7d720671e6dc | 53 | // get the longitude |
Osamu Nakamura |
0:7d720671e6dc | 54 | char *Location::getLongitude() { |
Osamu Nakamura |
0:7d720671e6dc | 55 | return this->m_longitude; |
Osamu Nakamura |
0:7d720671e6dc | 56 | } |
Osamu Nakamura |
0:7d720671e6dc | 57 | |
Osamu Nakamura |
0:7d720671e6dc | 58 | // get the MSL Altitude |
Osamu Nakamura |
0:7d720671e6dc | 59 | char *Location::getMSLAltitude() { |
Osamu Nakamura |
0:7d720671e6dc | 60 | return this->m_msl_altitude_m; |
Osamu Nakamura |
0:7d720671e6dc | 61 | } |
Osamu Nakamura |
0:7d720671e6dc | 62 | |
Osamu Nakamura |
0:7d720671e6dc | 63 | // get the Speed |
Osamu Nakamura |
0:7d720671e6dc | 64 | char *Location::getSpeed() { |
Osamu Nakamura |
0:7d720671e6dc | 65 | return this->m_speed; |
Osamu Nakamura |
0:7d720671e6dc | 66 | } |
Osamu Nakamura |
0:7d720671e6dc | 67 | |
Osamu Nakamura |
0:7d720671e6dc | 68 | }; |
Osamu Nakamura |
0:7d720671e6dc | 69 |