Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mqtt5 Service Client samples #642

Merged
merged 15 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .builder/actions/build_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def run(self, env):
'samples/greengrass/basic_discovery',
'samples/greengrass/ipc',
'samples/fleet_provisioning/fleet_provisioning',
'samples/fleet_provisioning/mqtt5_fleet_provisioning',
'samples/jobs/describe_job_execution',
'samples/jobs/mqtt5_describe_job_execution',
'samples/mqtt/basic_connect',
'samples/mqtt/custom_authorizer_connect',
'samples/mqtt/pkcs11_connect',
Expand All @@ -33,6 +35,7 @@ def run(self, env):
'samples/secure_tunneling/secure_tunnel',
'samples/secure_tunneling/tunnel_notification',
'samples/shadow/shadow_sync',
'samples/shadow/mqtt5_shadow_sync',
]

defender_samples = []
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ jobs:
- name: run Shadow sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_shadow_cfg.json
- name: run Mqtt5 Shadow sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_shadow_mqtt5_cfg.json
- name: configure AWS credentials (Jobs)
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -517,6 +520,9 @@ jobs:
- name: run Jobs sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_jobs_cfg.json
- name: run Mqtt5 Jobs sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_jobs_mqtt5_cfg.json
- name: configure AWS credentials (Fleet provisioning)
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -528,6 +534,12 @@ jobs:
Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())")
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_fleet_provisioning_cfg.json --input_uuid ${Sample_UUID}
python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1"
- name: run Mqtt5 Fleet Provisioning sample
run: |
echo "Generating UUID for IoT thing"
Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())")
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_fleet_provisioning_mqtt5_cfg.json --input_uuid ${Sample_UUID}
python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1"
- name: configure AWS credentials (Secure tunneling)
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/ci_run_fleet_provisioning_mqtt5_cfg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"language": "CPP",
"sample_file": "./aws-iot-device-sdk-cpp-v2/build/samples/fleet_provisioning/mqtt5_fleet_provisioning/mqtt5-fleet-provisioning",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
{
"name": "--endpoint",
"secret": "ci/endpoint"
},
{
"name": "--cert",
"secret": "ci/FleetProvisioning/cert",
"filename": "tmp_certificate.pem"
},
{
"name": "--key",
"secret": "ci/FleetProvisioning/key",
"filename": "tmp_key.pem"
},
{
"name": "--template_name",
"data": "CI_FleetProvisioning_Template"
},
{
"name": "--template_parameters",
"data": "{\"SerialNumber\":\"$INPUT_UUID\"}"
}
]
}
30 changes: 30 additions & 0 deletions .github/workflows/ci_run_jobs_mqtt5_cfg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"language": "CPP",
"sample_file": "./aws-iot-device-sdk-cpp-v2/build/samples/jobs/mqtt5_describe_job_execution/mqtt5-describe-job-execution",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
{
"name": "--endpoint",
"secret": "ci/endpoint"
},
{
"name": "--cert",
"secret": "ci/Jobs/cert",
"filename": "tmp_certificate.pem"
},
{
"name": "--key",
"secret": "ci/Jobs/key",
"filename": "tmp_key.pem"
},
{
"name": "--thing_name",
"data": "CI_Jobs_Thing"
},
{
"name": "--job_id",
"data": "CI_Jobs_Thing_Job_1"
}
]
}
30 changes: 30 additions & 0 deletions .github/workflows/ci_run_shadow_mqtt5_cfg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"language": "CPP",
"sample_file": "./aws-iot-device-sdk-cpp-v2/build/samples/shadow/mqtt5_shadow_sync/mqtt5-shadow-sync",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
{
"name": "--endpoint",
"secret": "ci/endpoint"
},
{
"name": "--cert",
"secret": "ci/Shadow/cert",
"filename": "tmp_certificate.pem"
},
{
"name": "--key",
"secret": "ci/Shadow/key",
"filename": "tmp_key.pem"
},
{
"name": "--thing_name",
"data": "CI_Shadow_Thing"
},
{
"name": "--is_ci",
"data": "true"
}
]
}
3 changes: 3 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ add_subdirectory(device_defender/basic_report)
add_subdirectory(greengrass/ipc)
add_subdirectory(greengrass/basic_discovery)
add_subdirectory(fleet_provisioning/fleet_provisioning)
add_subdirectory(fleet_provisioning/mqtt5_fleet_provisioning)
add_subdirectory(jobs/describe_job_execution)
add_subdirectory(jobs/mqtt5_describe_job_execution)
add_subdirectory(mqtt/basic_connect)
add_subdirectory(mqtt/custom_authorizer_connect)
add_subdirectory(mqtt/pkcs11_connect)
Expand All @@ -22,3 +24,4 @@ add_subdirectory(pub_sub/cycle_pub_sub)
add_subdirectory(secure_tunneling/secure_tunnel)
add_subdirectory(secure_tunneling/tunnel_notification)
add_subdirectory(shadow/shadow_sync)
add_subdirectory(shadow/mqtt5_shadow_sync)
28 changes: 28 additions & 0 deletions samples/fleet_provisioning/mqtt5_fleet_provisioning/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.1)
# note: cxx-17 requires cmake 3.8, cxx-20 requires cmake 3.12
project(mqtt5-fleet-provisioning CXX)

file(GLOB SRC_FILES
"*.cpp"
"../../utils/CommandLineUtils.cpp"
"../../utils/CommandLineUtils.h"
)

add_executable(${PROJECT_NAME} ${SRC_FILES})

set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 14)

#set warnings
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
else ()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic -Werror)
endif ()

find_package(aws-crt-cpp REQUIRED)
find_package(IotIdentity-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::IotIdentity-cpp)
Loading
Loading