Skip to content

Commit

Permalink
aws-device-advisor: Add applications helper library
Browse files Browse the repository at this point in the history
Add AWS IoT Core Device Advisor service helper library which can be
used for validating IoT devices during software development.
AWS IoT Core Device Advisor's pre-built tests help to validate the
software against best practices for usage of TLS, MQTT, Device Shadow,
and IoT Jobs.

Signed-off-by: Ahmed Ismail <[email protected]>
  • Loading branch information
AhmedIsmail02 authored and urutva committed Feb 28, 2024
1 parent 55daa30 commit 3d76393
Show file tree
Hide file tree
Showing 4 changed files with 451 additions and 1 deletion.
3 changes: 2 additions & 1 deletion applications/helpers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright 2023 Arm Limited and/or its affiliates
# Copyright 2023-2024 Arm Limited and/or its affiliates
# <[email protected]>
# SPDX-License-Identifier: MIT

add_subdirectory(device_advisor)
add_subdirectory(events)
add_subdirectory(logging)
add_subdirectory(provisioning)
18 changes: 18 additions & 0 deletions applications/helpers/device_advisor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Arm Limited and/or its affiliates
# <[email protected]>
# SPDX-License-Identifier: MIT

add_library(helpers-device-advisor
src/aws_device_advisor_task.c
)

target_include_directories(helpers-device-advisor
PUBLIC
inc
)

target_link_libraries(helpers-device-advisor
coremqtt
coremqtt-agent
helpers-events
)
41 changes: 41 additions & 0 deletions applications/helpers/device_advisor/inc/aws_device_advisor_task.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* Copyright 2024 Arm Limited and/or its affiliates
* <[email protected]>
* SPDX-License-Identifier: MIT
*/

#ifndef __AWS_DEVICE_ADVISOR_TASK__H__
#define __AWS_DEVICE_ADVISOR_TASK__H__

/* app_config.h is included before checking the value of appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE
* because appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE is defined with 0 or 1 in that header file. */
#include "app_config.h"

#if ( appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE == 1 )

#include <string.h>

/**
* @brief Create the device advisor validation task.
*/
void vStartDeviceAdvisorTask( void );

/**
* @brief The maximum amount of time in milliseconds to wait for the commands
* to be posted to the MQTT agent should the MQTT agent's command queue be full.
* Tasks wait in the Blocked state, so don't use any CPU time.
*/
#define deviceAdvisorMAX_COMMAND_SEND_BLOCK_TIME_MS ( 5000 )

#define deviceAdvisorTOPIC_FORMAT "device_advisor_test"
#define deviceAdvisorTOPIC_BUFFER_LENGTH ( strlen( deviceAdvisorTOPIC_FORMAT ) )
#define deviceAdvisorTASK_STACK_SIZE ( 2048 )
#define deviceAdvisorTASK_PRIORITY ( tskIDLE_PRIORITY + 1 )

/**
* @brief Size of statically allocated buffers for holding payloads.
*/
#define deviceAdvisorSTRING_BUFFER_LENGTH ( 20480 )

#endif /* if ( appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE == 1 ) */

#endif /* __AWS_DEVICE_ADVISOR_TASK__H__ */
Loading

0 comments on commit 3d76393

Please sign in to comment.