-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathCANDataConsumer.h
57 lines (48 loc) · 1.85 KB
/
CANDataConsumer.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
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "CollectionInspectionAPITypes.h"
#include "IDecoderDictionary.h"
#include "SignalTypes.h"
#include "TimeTypes.h"
#include <cstddef>
#include <cstdint>
#include <memory>
namespace Aws
{
namespace IoTFleetWise
{
/**
* @brief CAN Network Data Consumer impl, outputs data to an in-memory buffer.
* Operates in Polling mode.
*/
class CANDataConsumer
{
public:
CANDataConsumer( SignalBufferDistributorPtr signalBufferDistributor );
~CANDataConsumer() = default;
CANDataConsumer( const CANDataConsumer & ) = delete;
CANDataConsumer &operator=( const CANDataConsumer & ) = delete;
CANDataConsumer( CANDataConsumer && ) = delete;
CANDataConsumer &operator=( CANDataConsumer && ) = delete;
void processMessage( CANChannelNumericID channelId,
std::shared_ptr<const CANDecoderDictionary> &dictionary,
uint32_t messageId,
const uint8_t *data,
size_t dataLength,
Timestamp timestamp );
private:
/**
* @brief Finds whether there exists a decoder method for a message id or not
* If found, returns the method by reference
* messageId is an input-output parameter that has the correct value
* for the current message's id with either the MSB set or unset
*/
static bool findDecoderMethod( CANChannelNumericID channelId,
uint32_t &messageId,
const CANDecoderDictionary::CANMsgDecoderMethodType &decoderMethod,
CANMessageDecoderMethod ¤tMessageDecoderMethod );
SignalBufferDistributorPtr mSignalBufferDistributor;
};
} // namespace IoTFleetWise
} // namespace Aws