blob: 219cb125a65697c325e31cbc4041c175c2cf0ae3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/**************************************************************************
* @licence app begin@
*
* SPDX-License-Identifier: MPL-2.0
*
* \ingroup EnhancedPositionService
* \author Marco Residori <marco.residori@xse.de>
*
* \copyright Copyright (C) 2014, XS Embedded GmbH
*
* \license
* This Source Code Form is subject to the terms of the
* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* @licence end@
**************************************************************************/
#include "ConfigurationStubImpl.h"
#include "log.h"
//Configuration-interface version
#define VER_MAJOR 3
#define VER_MINOR 0
#define VER_MICRO 0
#define VER_DATE "05-08-2014"
DLT_IMPORT_CONTEXT(gCtx);
using namespace org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes;
ConfigurationStubImpl::ConfigurationStubImpl() {
setUpdateIntervalAttribute(1000); //set default time interval
mSupportedSatSystems.push_back(SatelliteSystem::GALILEO);
mSupportedSatSystems.push_back(SatelliteSystem::GPS);
setSatSystemAttribute(SatelliteSystem::GALILEO); //set default GNSS system
}
ConfigurationStubImpl::~ConfigurationStubImpl() {
}
void ConfigurationStubImpl::GetVersion(EnhancedPositionServiceTypes::Version& version) {
LOG_INFO_MSG(gCtx,"GetVersion");
version.maj = VER_MAJOR;
version.min = VER_MINOR;
version.mic = VER_MICRO;
version.date = std::string(VER_DATE);
}
//check if the value belongs to the list of supported satellite systems
bool ConfigurationStubImpl::validateSatSystemAttributeRequestedValue(const EnhancedPositionServiceTypes::SatelliteSystem& value) {
return std::find(mSupportedSatSystems.begin(), mSupportedSatSystems.end(), value) != mSupportedSatSystems.end();
}
void ConfigurationStubImpl::GetSupportedSatelliteSystems(std::vector<EnhancedPositionServiceTypes::SatelliteSystem>& satelliteSystems) {
//add a list of supported satellite systems
satelliteSystems = mSupportedSatSystems;
}
void ConfigurationStubImpl::run()
{
LOG_INFO_MSG(gCtx,"Starting Configuration dispatcher...");
setUpdateIntervalAttribute(1000); //set default time interval
setSatSystemAttribute(SatelliteSystem::GALILEO); //set default GNSS system
}
void ConfigurationStubImpl::shutdown()
{
LOG_INFO_MSG(gCtx,"Shutting down Configuration dispatcher...");
}
|