-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathCommandTypes.h
121 lines (100 loc) · 2.7 KB
/
CommandTypes.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "CollectionInspectionAPITypes.h"
#include "ICommandDispatcher.h"
#include "SignalTypes.h"
#include "TimeTypes.h"
#include <boost/variant.hpp>
#include <string>
#include <unordered_map>
namespace Aws
{
namespace IoTFleetWise
{
struct ActuatorCommandRequest
{
/**
* @brief Unique Command ID generated on the cloud
*/
CommandID commandID;
/**
* @brief Decoder Manifest sync id associated with this command request
*/
SyncID decoderID;
/**
* @brief Signal ID associated with the Command
*/
SignalID signalID{ 0 };
/**
* @brief Contains signal value and type to be set with the Command
*/
SignalValueWrapper signalValueWrapper;
/**
* @brief Timestamp in ms since epoch of when the command was issued in the cloud
*/
Timestamp issuedTimestampMs{ 0 };
/**
* @brief Command execution timeout in ms since `issuedTimestampMs`
*/
Timestamp executionTimeoutMs{ 0 };
};
enum class LastKnownStateOperation
{
ACTIVATE = 0,
DEACTIVATE = 1,
FETCH_SNAPSHOT = 2,
};
struct LastKnownStateCommandRequest
{
/**
* @brief Unique Command ID generated on the cloud
*/
CommandID commandID;
/**
* @brief State template sync id associated with this command request
*/
SyncID stateTemplateID;
/**
* @brief The operation that should be applied to this state template
*/
LastKnownStateOperation operation;
/**
* @brief Make the collection to be stopped after this time.
*
* This is only used when the operation is ACTIVATE
*/
uint32_t deactivateAfterSeconds{ 0 };
/**
* @brief Time when this command was received
*/
TimePoint receivedTime{ 0, 0 };
};
/**
* Response related to a single command to be sent to the cloud
*/
struct CommandResponse : DataToSend
{
CommandID id;
CommandStatus status;
CommandReasonCode reasonCode;
CommandReasonDescription reasonDescription;
CommandResponse( CommandID commandID,
CommandStatus commandStatus,
CommandReasonCode commandReasonCode,
CommandReasonDescription commandReasonDescription )
: id( std::move( commandID ) )
, status( std::move( commandStatus ) )
, reasonCode( commandReasonCode )
, reasonDescription( std::move( commandReasonDescription ) )
{
}
~CommandResponse() override = default;
SenderDataType
getDataType() const override
{
return SenderDataType::COMMAND_RESPONSE;
}
};
} // namespace IoTFleetWise
} // namespace Aws