@@ -39,20 +39,18 @@ namespace Aws
39
39
OnTaskCancelledHandler &&onCancelled,
40
40
void *cancellationUserdata) noexcept
41
41
: OnTaskCancelled(std::move(onCancelled)), cancellationUserdata(cancellationUserdata),
42
- m_allocator (allocator), m_status(ReportTaskStatus::Ready),
43
- m_taskConfig{nullptr },
44
- m_owningTask{nullptr },
45
- m_lastError (0 ),
46
- m_mqttConnection{mqttConnection},
47
- m_eventLoopGroup{eventLoopGroup}
42
+ m_allocator (allocator), m_status(ReportTaskStatus::Ready), m_taskConfig{nullptr }, m_owningTask{nullptr },
43
+ m_lastError (0 ), m_mqttConnection{mqttConnection}, m_eventLoopGroup{eventLoopGroup}
48
44
{
49
45
struct aws_byte_cursor thingNameCursor = Crt::ByteCursorFromString (thingName);
50
- m_lastError = aws_iotdevice_defender_config_create (&m_taskConfig, allocator, &thingNameCursor, reportFormat);
46
+ m_lastError =
47
+ aws_iotdevice_defender_config_create (&m_taskConfig, allocator, &thingNameCursor, reportFormat);
51
48
if (AWS_OP_SUCCESS == m_lastError)
52
49
{
53
50
aws_iotdevice_defender_config_set_task_cancelation_fn (m_taskConfig, s_onDefenderV1TaskCancelled);
54
51
aws_iotdevice_defender_config_set_callback_userdata (m_taskConfig, this );
55
- aws_iotdevice_defender_config_set_task_period_ns (m_taskConfig,
52
+ aws_iotdevice_defender_config_set_task_period_ns (
53
+ m_taskConfig,
56
54
aws_timestamp_convert (taskPeriodSeconds, AWS_TIMESTAMP_SECS, AWS_TIMESTAMP_NANOS, NULL ));
57
55
}
58
56
else
@@ -104,11 +102,13 @@ namespace Aws
104
102
105
103
int ReportTask::StartTask () noexcept
106
104
{
107
- if (m_taskConfig != nullptr && !m_lastError && (this ->GetStatus () == ReportTaskStatus::Ready || this ->GetStatus () == ReportTaskStatus::Stopped))
105
+ if (m_taskConfig != nullptr && !m_lastError &&
106
+ (this ->GetStatus () == ReportTaskStatus::Ready || this ->GetStatus () == ReportTaskStatus::Stopped))
108
107
{
109
- if (AWS_OP_SUCCESS != aws_iotdevice_defender_task_create (&m_owningTask, this ->m_taskConfig ,
110
- m_mqttConnection->GetUnderlyingConnection (),
111
- aws_event_loop_group_get_next_loop (m_eventLoopGroup.GetUnderlyingHandle ())))
108
+ if (AWS_OP_SUCCESS != aws_iotdevice_defender_task_create (
109
+ &m_owningTask, this ->m_taskConfig ,
110
+ m_mqttConnection->GetUnderlyingConnection (),
111
+ aws_event_loop_group_get_next_loop (m_eventLoopGroup.GetUnderlyingHandle ())))
112
112
{
113
113
this ->m_lastError = aws_last_error ();
114
114
aws_raise_error (this ->m_lastError );
0 commit comments