-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathAaosVhalSource.h
70 lines (61 loc) · 2.02 KB
/
AaosVhalSource.h
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
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "Clock.h"
#include "ClockHandler.h"
#include "CollectionInspectionAPITypes.h"
#include "IDecoderDictionary.h"
#include "SignalTypes.h"
#include "VehicleDataSourceTypes.h"
#include <array>
#include <cstdint>
#include <memory>
#include <mutex>
#include <unordered_map>
#include <vector>
namespace Aws
{
namespace IoTFleetWise
{
class AaosVhalSource
{
public:
/**
* @param interfaceId Interface identifier
* @param signalBufferDistributor Signal buffer distributor
*/
AaosVhalSource( InterfaceID interfaceId, SignalBufferDistributorPtr signalBufferDistributor );
~AaosVhalSource() = default;
AaosVhalSource( const AaosVhalSource & ) = delete;
AaosVhalSource &operator=( const AaosVhalSource & ) = delete;
AaosVhalSource( AaosVhalSource && ) = delete;
AaosVhalSource &operator=( AaosVhalSource && ) = delete;
void onChangeOfActiveDictionary( ConstDecoderDictionaryConstPtr &dictionary,
VehicleDataSourceProtocol networkProtocol );
/**
* Returns a vector of vehicle property info
*
* @return Vehicle property info, with each member containing an array with 4 values:
* - Vehicle property ID
* - Area index
* - Result index
* - Signal ID
*/
std::vector<std::array<uint32_t, 4>> getVehiclePropertyInfo();
/**
* Set Vehicle property value
*
* @param signalId Signal ID
* @param value Property value
*/
void setVehicleProperty( SignalID signalId, const DecodedSignalValue &value );
private:
InterfaceID mInterfaceId;
SignalBufferDistributorPtr mSignalBufferDistributor;
std::unordered_map<SignalID, SignalType> mSignalIdToSignalType;
std::shared_ptr<const Clock> mClock = ClockHandler::getClock();
std::mutex mDecoderDictionaryUpdateMutex;
std::vector<std::array<uint32_t, 4>> mVehiclePropertyInfo;
};
} // namespace IoTFleetWise
} // namespace Aws