├── .gitattributes ├── .github └── pull_request_template.md ├── .mbedignore ├── CHANGELOG.md ├── CMakeLists.txt ├── CONTRIBUTING.md ├── DOXYGEN_FRONTPAGE.md ├── Doxyfile ├── LICENSE ├── Makefile ├── README.md ├── certificate-enrollment-client ├── CMakeLists.txt ├── certificate-enrollment-client │ ├── CertificateEnrollmentClient.h │ ├── ce_defs.h │ └── ce_status.h └── source │ ├── CertificateEnrollmentClient.cpp │ ├── CertificateEnrollmentClientCommon.cpp │ ├── CertificateRenewalData.cpp │ ├── ce_safe_renewal_internal.c │ ├── ce_tlv.c │ ├── certificate_enrollment.c │ └── include │ ├── CertificateEnrollmentClientCommon.h │ ├── CertificateRenewalData.h │ ├── ce_internal.h │ ├── ce_tlv.h │ └── certificate_enrollment.h ├── cmsis-pack └── ARM.Pelion_Device_Management_Client.pdsc ├── device-sentry-client ├── CMakeLists.txt ├── device-sentry-client │ ├── DeviceSentryClient.h │ ├── ds_custom_metrics.h │ └── ds_status.h └── source │ ├── .mbedignore │ ├── DeviceSentryClient.cpp │ ├── ds_metrics_report.cpp │ ├── include │ ├── ds_custom_metrics_internal.h │ ├── ds_internal.h │ ├── ds_metrics_report.h │ └── ds_plat_metrics_report.h │ ├── linux-os │ ├── ds_linux_metrics_report.cpp │ └── ds_plat_defs.h │ ├── mbed-os │ ├── ds_mbedos_metrics_report.cpp │ └── ds_plat_defs.h │ └── stub-os │ ├── ds_plat_defs.h │ └── ds_stub_metrics_report.cpp ├── doxygen └── mbedcloudclient_doxy ├── factory-configurator-client ├── .mbedignore ├── CMakeLists.txt ├── DOXYGEN_FRONTPAGE.md ├── Makefile ├── crypto-service │ ├── crypto-service │ │ ├── cs_der_certs.h │ │ ├── cs_der_keys_and_csrs.h │ │ ├── cs_hash.h │ │ ├── cs_pal_crypto.h │ │ ├── cs_pal_crypto_configuration.h │ │ └── cs_pal_plat_crypto.h │ └── source │ │ ├── cs_der_certs.c │ │ ├── cs_der_keys_and_csrs.c │ │ ├── cs_hash.c │ │ ├── cs_pal_crypto.c │ │ ├── cs_pal_plat_crypto.c │ │ ├── cs_pal_plat_drbg_w_entropy_sources_kv.c │ │ ├── cs_utils.c │ │ └── include │ │ └── cs_utils.h ├── factory-configurator-client │ ├── factory-configurator-client │ │ ├── factory_configurator_client.h │ │ ├── fcc_defs.h │ │ └── fcc_status.h │ └── source │ │ ├── factory_configurator_client.c │ │ ├── fcc_dev_flow.c │ │ ├── fcc_utils.c │ │ ├── fcc_verification.c │ │ └── include │ │ ├── fcc_bundle_fields.h │ │ ├── fcc_utils.h │ │ └── fcc_verification.h ├── fcc-bundle-handler │ ├── fcc-bundle-handler │ │ └── fcc_bundle_handler.h │ └── source │ │ ├── fcc_bundle_certificate_utils.c │ │ ├── fcc_bundle_common_utils.c │ │ ├── fcc_bundle_config_params_utils.c │ │ ├── fcc_bundle_csr_utils.c │ │ ├── fcc_bundle_handler.c │ │ ├── fcc_bundle_key_utils.c │ │ └── include │ │ └── fcc_bundle_utils.h ├── fcc-output-info-handler │ ├── fcc-output-info-handler │ │ ├── fcc_output_info_handler.h │ │ └── fcc_output_info_handler_defines.h │ └── source │ │ └── fcc_output_info_handler.c ├── ftcd-comm-base │ ├── ftcd-comm-base │ │ └── ftcd_comm_base.h │ └── source │ │ └── ftcd_comm_base.cpp ├── ftcd-comm-serial │ ├── ftcd-comm-serial │ │ └── ftcd_comm_serial.h │ └── source │ │ └── ftcd_comm_serial.cpp ├── ftcd-comm-socket │ ├── ftcd-comm-socket │ │ └── ftcd_comm_socket.h │ └── source │ │ └── ftcd_comm_socket.cpp ├── key-config-manager │ ├── key-config-manager │ │ ├── kcm_defs.h │ │ ├── kcm_status.h │ │ └── key_config_manager.h │ └── source │ │ └── key_config_manager.c ├── logger │ └── logger │ │ └── pv_log.h ├── mbed-client-esfs │ ├── .mbedignore │ ├── CMakeLists.txt │ └── source │ │ ├── esfs.c │ │ ├── esfs_file_name.c │ │ ├── esfs_performance.c │ │ ├── include │ │ ├── esfs.h │ │ ├── esfs_file_name.h │ │ ├── esfs_performance.h │ │ └── sotp.h │ │ └── sotp │ │ ├── sotp.c │ │ ├── sotp_int.h │ │ ├── sotp_log.c │ │ ├── sotp_log.h │ │ ├── sotp_no_sotp.c │ │ ├── sotp_shared_lock.c │ │ └── sotp_shared_lock.h ├── mbed-trace-helper │ ├── mbed-trace-helper │ │ └── mbed-trace-helper.h │ └── source │ │ └── mbed-trace-helper.c ├── psa-driver │ ├── psa-driver │ │ ├── psa_driver.h │ │ └── psa_driver_dispatcher.h │ └── source │ │ ├── psa_driver_common.c │ │ ├── psa_driver_crypto.c │ │ ├── psa_driver_dispatcher.c │ │ └── psa_driver_ps.c ├── storage │ ├── source │ │ ├── include │ │ │ ├── key_slot_allocator.h │ │ │ ├── key_slot_allocator_internal.h │ │ │ ├── pal_sst.h │ │ │ ├── se_slot_manager.h │ │ │ ├── se_slot_manager_defs.h │ │ │ ├── storage_internal.h │ │ │ └── storage_pelion_sst.h │ │ ├── key_slot_allocator.c │ │ ├── pal_plat_sst_impl.cpp │ │ ├── se_slot_manager.c │ │ ├── storage_common.c │ │ ├── storage_non_psa.c │ │ ├── storage_pal_sst.c │ │ ├── storage_pelion_sst.c │ │ └── storage_psa.cpp │ └── storage │ │ └── storage_kcm.h └── utils │ ├── source │ ├── common_utils.c │ ├── fcc_stats.c │ ├── fcc_time_profiling.c │ ├── general_utils.c │ └── pv_error_handling.c │ └── utils │ ├── common_utils.h │ ├── fcc_malloc.h │ ├── fcc_stats.h │ ├── fcc_time_profiling.h │ ├── general_utils.h │ ├── mbed_stats_helper.c │ ├── mbed_stats_helper.h │ ├── pv_endian.h │ ├── pv_error_handling.h │ └── pv_macros.h ├── fota ├── .mbedignore ├── bspatch │ ├── bspatch.c │ ├── bspatch.h │ ├── bspatch_common.h │ ├── bspatch_private.h │ ├── import_ref.txt │ ├── lz4.c │ ├── lz4.h │ ├── varint.c │ └── varint.h ├── bspatch_fota_mbed.c ├── fota.c ├── fota.h ├── fota_app_ifs.c ├── fota_app_ifs.h ├── fota_base.h ├── fota_block_device.h ├── fota_candidate.c ├── fota_candidate.h ├── fota_combined_package.c ├── fota_combined_package.h ├── fota_comp_callbacks.h ├── fota_component.c ├── fota_component.h ├── fota_component_defs.h ├── fota_component_internal.h ├── fota_config.h ├── fota_crypto.c ├── fota_crypto.h ├── fota_crypto_asn_extra.c ├── fota_crypto_asn_extra.h ├── fota_crypto_defs.h ├── fota_curr_fw.h ├── fota_delta.c ├── fota_delta.h ├── fota_device_key.cpp ├── fota_device_key.h ├── fota_event_handler.c ├── fota_event_handler.h ├── fota_ext_downloader.h ├── fota_fw_download.h ├── fota_fw_download_coap.c ├── fota_fw_download_curl.c ├── fota_header_info.h ├── fota_header_info_v2.c ├── fota_header_info_v3.c ├── fota_internal.h ├── fota_internal_ifs.c ├── fota_internal_ifs.h ├── fota_manifest.h ├── fota_manifest_v1.c ├── fota_manifest_v3.c ├── fota_multicast.h ├── fota_nvm.c ├── fota_nvm.h ├── fota_nvm_int.h ├── fota_platform_hooks.h ├── fota_platform_hooks_default.c ├── fota_shim_layer.cpp ├── fota_shim_layer.h ├── fota_source.h ├── fota_source_defs.h ├── fota_source_profile_full.cpp ├── fota_source_profile_lite.c ├── fota_status.h ├── fota_sub_component.c ├── fota_sub_component.h ├── fota_sub_component_internal.h ├── import_ref.txt ├── mbed_lib.json └── platform │ ├── linux │ ├── .mbedignore │ ├── fota_block_device_linux.c │ ├── fota_curr_fw_linux.c │ ├── fota_curr_fw_linux.h │ ├── fota_platform_linux.c │ └── fota_platform_linux.h │ ├── mbed-os │ ├── fota_block_device_mbed_os.cpp │ └── fota_curr_fw_mbed_os.c │ └── nxp │ ├── fota_block_device_nxp_lpc.cpp │ └── fota_curr_fw_nxp_lpc.c ├── kvstore ├── CMakeLists.txt ├── conf │ ├── kv_config.cpp │ └── kv_config.h ├── direct_access_devicekey │ ├── DirectAccessDevicekey.cpp │ └── DirectAccessDevicekey.h ├── filesystemstore │ ├── FileSystemStore.cpp │ └── FileSystemStore.h ├── global_api │ ├── kvstore_global_api.cpp │ └── kvstore_global_api.h ├── helpers │ ├── BlockDevice.h │ ├── BufferedBlockDevice.cpp │ ├── BufferedBlockDevice.h │ ├── DeviceKey.cpp │ ├── DeviceKey.h │ ├── ExternalBlockDevice.h │ ├── FlashIAP.h │ ├── FlashIAPBlockDevice.cpp │ ├── FlashIAPBlockDevice.h │ ├── FlashSimBlockDevice.cpp │ ├── FlashSimBlockDevice.h │ ├── NonCopyable.h │ ├── SPIFBlockDevice.h │ ├── SingletonPtr.h │ ├── SlicingBlockDevice.cpp │ ├── SlicingBlockDevice.h │ └── pal_plat_rot.cpp ├── include │ └── KVStore.h ├── kv_map │ ├── KVMap.cpp │ └── KVMap.h ├── securestore │ ├── SecureStore.cpp │ └── SecureStore.h └── tdbstore │ ├── TDBStore.cpp │ └── TDBStore.h ├── mbed-client-pal ├── .mbedignore ├── CMakeLists.txt ├── Configs │ ├── mbedTLS │ │ ├── mbedTLSConfig_ARIA_mbedOS.h │ │ ├── mbedTLSConfig_FreeRTOS.h │ │ ├── mbedTLSConfig_Linux.h │ │ ├── mbedTLSConfig_Linux_LWM2M_Compliant.h │ │ ├── mbedTLSConfig_NXP.h │ │ ├── mbedTLSConfig_Renesas_EK_RA6M3.h │ │ ├── mbedTLSConfig_Renesas_RX65N-CK_SW_TRNG.h │ │ ├── mbedTLSConfig_SXOS_SW_TRNG.h │ │ ├── mbedTLSConfig_mbedOS.h │ │ ├── mbedTLSConfig_mbedOS_SW_TRNG.h │ │ ├── mbedTLSConfig_mbedOS_SW_TRNG_PSA.h │ │ ├── mbedtls_config_RTX.h │ │ └── pelion_mbedtls_config.h │ ├── pal_config │ │ ├── .mbedignore │ │ ├── FreeRTOS │ │ │ └── FreeRTOS_default.h │ │ ├── Linux │ │ │ └── Linux_default.h │ │ ├── NXP │ │ │ └── NXP_default.h │ │ ├── RTX_MW │ │ │ └── RTX_MW_default.h │ │ ├── Renesas │ │ │ ├── Renesas_RX65N-CK_default.h │ │ │ └── Renesas_default.h │ │ ├── SXOS │ │ │ ├── sxos_default.h │ │ │ └── sxos_sotp.h │ │ └── mbedOS │ │ │ ├── mbedOS_SST.h │ │ │ └── mbedOS_default.h │ ├── pal_ext_configs.cmake │ └── pal_ext_configs_PSK.cmake ├── DOXYGEN_FRONTPAGE.md ├── LICENSE ├── Makefile ├── Source │ ├── PAL-Impl │ │ ├── Modules │ │ │ ├── DRBG │ │ │ │ └── pal_drbg.c │ │ │ ├── Entropy │ │ │ │ └── pal_entropy.c │ │ │ ├── Networking │ │ │ │ └── pal_network.c │ │ │ ├── ROT │ │ │ │ └── pal_rot.c │ │ │ ├── RTOS │ │ │ │ └── pal_rtos.c │ │ │ ├── Storage │ │ │ │ ├── FileSystem │ │ │ │ │ └── pal_fileSystem.c │ │ │ │ └── Flash │ │ │ │ │ └── pal_internalFlash.c │ │ │ ├── TLS │ │ │ │ └── pal_TLS.c │ │ │ ├── Time │ │ │ │ └── pal_time.c │ │ │ └── Update │ │ │ │ └── pal_update.c │ │ ├── Services-API │ │ │ ├── pal.h │ │ │ ├── pal_TLS.h │ │ │ ├── pal_configuration.h │ │ │ ├── pal_drbg.h │ │ │ ├── pal_entropy.h │ │ │ ├── pal_errors.h │ │ │ ├── pal_fileSystem.h │ │ │ ├── pal_internalFlash.h │ │ │ ├── pal_macros.h │ │ │ ├── pal_network.h │ │ │ ├── pal_rot.h │ │ │ ├── pal_rtos.h │ │ │ ├── pal_time.h │ │ │ ├── pal_types.h │ │ │ └── pal_update.h │ │ └── pal_init.c │ └── Port │ │ ├── Platform-API │ │ ├── pal_plat_TLS.h │ │ ├── pal_plat_drbg.h │ │ ├── pal_plat_drbg_noise.h │ │ ├── pal_plat_entropy.h │ │ ├── pal_plat_fileSystem.h │ │ ├── pal_plat_internalFlash.h │ │ ├── pal_plat_network.h │ │ ├── pal_plat_rot.h │ │ ├── pal_plat_rtos.h │ │ ├── pal_plat_time.h │ │ └── pal_plat_update.h │ │ └── Reference-Impl │ │ ├── Generic │ │ ├── DRBG │ │ │ ├── KVSTORE │ │ │ │ └── pal_plat_drbg_kvstore.cpp │ │ │ ├── PSA │ │ │ │ └── pal_plat_drbg_psa.c │ │ │ ├── SOTP │ │ │ │ └── pal_plat_drbg_sotp.c │ │ │ └── pal_plat_drbg_noise.c │ │ ├── Entropy │ │ │ ├── PSA │ │ │ │ └── pal_plat_entropy_psa.c │ │ │ └── SOTP │ │ │ │ └── pal_plat_entropy_sotp.c │ │ ├── ROT │ │ │ ├── External │ │ │ │ └── pal_plat_rot_hw.c │ │ │ ├── PSA │ │ │ │ └── pal_plat_rot_psa.c │ │ │ └── SOTP │ │ │ │ └── pal_plat_rot_sotp.c │ │ ├── Storage │ │ │ ├── FileSystem │ │ │ │ └── pal_plat_fileSystem_FsOverRam.c │ │ │ └── Flash │ │ │ │ └── pal_plat_internalFlash_FlashOverFilesystem.c │ │ └── Time │ │ │ └── pal_plat_time.c │ │ ├── Lib_Specific │ │ └── mbedTLS │ │ │ ├── DRBG │ │ │ └── pal_plat_drbg_w_entropy_sources.c │ │ │ └── TLS │ │ │ └── pal_plat_TLS.c │ │ └── OS_Specific │ │ ├── .mbedignore │ │ ├── FreeRTOS │ │ ├── Board_Specific │ │ │ └── TARGET_K64F │ │ │ │ └── pal_plat_K64F.c │ │ ├── Networking │ │ │ └── LWIP │ │ │ │ └── pal_plat_network.c │ │ ├── RTOS │ │ │ └── pal_plat_rtos.c │ │ └── Storage │ │ │ ├── FileSystem │ │ │ └── pal_plat_fileSystem.c │ │ │ └── Flash │ │ │ └── pal_plat_internalFlash.c │ │ ├── Linux │ │ ├── Board_Specific │ │ │ ├── TARGET_OpenWRT_Generic │ │ │ │ └── pal_plat_OpenWRT_Generic.c │ │ │ ├── TARGET_RaspberryPi │ │ │ │ └── pal_plat_RaspberryPi.c │ │ │ ├── TARGET_Yocto_Generic │ │ │ │ └── pal_plat_Yocto_Generic.c │ │ │ ├── TARGET_x86_x64 │ │ │ │ └── pal_plat_x86_x64.c │ │ │ └── pal_plat_linux_common.c │ │ ├── Networking │ │ │ └── pal_plat_network.c │ │ ├── RTOS │ │ │ └── pal_plat_rtos.c │ │ └── Storage │ │ │ └── FileSystem │ │ │ └── pal_plat_fileSystem.c │ │ ├── NXP │ │ ├── Board_Specific │ │ │ ├── TARGET_K64F │ │ │ │ └── pal_plat_K64F.c │ │ │ ├── TARGET_LPC54608 │ │ │ │ └── pal_plat_LPC54608.c │ │ │ ├── TARGET_LPC54628 │ │ │ │ └── pal_plat_LPC54628.c │ │ │ └── TARGET_MIMXRT1060 │ │ │ │ └── pal_plat_MIMXRT1060.c │ │ ├── Networking │ │ │ └── LWIP │ │ │ │ └── pal_plat_network.c │ │ └── RTOS │ │ │ └── pal_plat_rtos.c │ │ ├── RTX_MW │ │ ├── Networking │ │ │ ├── pal_plat_network_bsd_sock.c │ │ │ └── pal_plat_network_iot_sock.c │ │ ├── RTOS │ │ │ └── pal_plat_rtos.cpp │ │ └── Storage │ │ │ └── Flash │ │ │ └── flash_iap_rtx.cpp │ │ ├── Renesas_EK_RA6M3 │ │ ├── Board_Specific │ │ │ └── TARGET_EK-RA6M3 │ │ │ │ ├── FreeRTOSConfig.h │ │ │ │ ├── FreeRTOSIPConfig.h │ │ │ │ ├── board_cfg.h │ │ │ │ ├── bsp_cfg.h │ │ │ │ ├── bsp_mcu_device_cfg.h │ │ │ │ ├── bsp_mcu_device_pn_cfg.h │ │ │ │ ├── bsp_mcu_family_cfg.h │ │ │ │ ├── lwipopts.h │ │ │ │ ├── mbed_config.h │ │ │ │ └── pal_plat_EK-RA6M3.c │ │ ├── Networking │ │ │ └── LWIP │ │ │ │ └── pal_plat_network.c │ │ └── RTOS │ │ │ └── pal_plat_rtos.c │ │ ├── Renesas_RX65N-CK │ │ ├── Board_Specific │ │ │ └── TARGET_RX65N-CK │ │ │ │ └── pal_plat_RX65N-CK.c │ │ ├── Networking │ │ │ └── WIFI-SX-ULPGN │ │ │ │ └── pal_plat_network.c │ │ └── RTOS │ │ │ └── pal_plat_rtos.c │ │ ├── SXOS │ │ ├── Networking │ │ │ └── pal_plat_network.c │ │ ├── RTOS │ │ │ └── pal_plat_rtos.c │ │ └── Storage │ │ │ └── FileSystem │ │ │ └── pal_plat_fileSystem.c │ │ ├── ZephyrOS │ │ ├── Board_Specific │ │ │ └── TARGET_Generic │ │ │ │ └── pal_plat_Generic.c │ │ ├── Networking │ │ │ ├── fd_work_poll.c │ │ │ ├── fd_work_poll.h │ │ │ ├── fd_work_poll_polling.c │ │ │ └── pal_plat_network.c │ │ ├── Platform │ │ │ ├── FlashIAP.cpp │ │ │ ├── FlashIAP.h │ │ │ ├── FlashMap.cpp │ │ │ └── FlashMap.h │ │ └── RTOS │ │ │ └── pal_plat_rtos.c │ │ ├── mbedOS │ │ ├── Networking │ │ │ └── pal_plat_network.cpp │ │ ├── ROT │ │ │ └── pal_plat_rot.cpp │ │ ├── RTOS │ │ │ └── pal_plat_rtos.cpp │ │ └── Storage │ │ │ ├── FileSystem │ │ │ └── pal_plat_fileSystem.cpp │ │ │ └── Flash │ │ │ └── pal_plat_internalFlash.cpp │ │ └── nanosimulator │ │ ├── Networking │ │ └── pal_plat_network.c │ │ └── RTOS │ │ └── pal_plat_rtos.c ├── Test │ ├── .mbedignore │ ├── CMakeLists.txt │ ├── Makefile │ ├── PAL_Modules │ │ ├── DRBG │ │ │ ├── pal_drbg_test.c │ │ │ └── pal_drbg_test_runner.c │ │ ├── Entropy │ │ │ ├── pal_entropy_test.c │ │ │ └── pal_entropy_test_runner.c │ │ ├── FileSystem │ │ │ ├── pal_fileSystem_test.c │ │ │ └── pal_fileSystem_test_runner.c │ │ ├── Networking │ │ │ ├── pal_socket_test.c │ │ │ ├── pal_socket_test_address.h │ │ │ └── pal_socket_test_runner.c │ │ ├── ROT │ │ │ ├── pal_rot_test.c │ │ │ └── pal_rot_test_runner.c │ │ ├── RTOS │ │ │ ├── pal_rtos_test.c │ │ │ ├── pal_rtos_test_runner.c │ │ │ ├── pal_rtos_test_utils.c │ │ │ └── pal_rtos_test_utils.h │ │ ├── SOTP │ │ │ ├── pal_SOTP_test.c │ │ │ └── pal_SOTP_test_runner.c │ │ ├── Sanity │ │ │ ├── pal_sanity_test.c │ │ │ └── pal_sanity_test_runner.c │ │ ├── Storage │ │ │ ├── pal_internalFlash_test.c │ │ │ └── pal_internalFlash_test_runner.c │ │ ├── TLS │ │ │ ├── pal_tls_test.c │ │ │ ├── pal_tls_test_runner.c │ │ │ └── pal_tls_utils.h │ │ ├── Time │ │ │ ├── pal_time_test.c │ │ │ └── pal_time_test_runner.c │ │ ├── Update │ │ │ ├── pal_update_test.c │ │ │ └── pal_update_test_runner.c │ │ ├── pal_tests_nonstandard_entrypoint.c │ │ ├── test_main.c │ │ └── test_runners.h │ ├── TESTS │ │ ├── Sotp │ │ │ └── security │ │ │ │ └── pal_security_test_main.c │ │ ├── Unitest │ │ │ ├── DRBG │ │ │ │ └── pal_drbg_test_main.c │ │ │ ├── Entropy │ │ │ │ └── pal_entropy_test_main.c │ │ │ ├── FileSystem │ │ │ │ └── pal_FileSystem_test_main.c │ │ │ ├── Full_pal │ │ │ │ └── pal_all_test_main.c │ │ │ ├── Networking │ │ │ │ └── pal_Networking_test_main.c │ │ │ ├── ROT │ │ │ │ └── pal_rot_test_main.c │ │ │ ├── RTOS │ │ │ │ └── pal_rtos_test_main.c │ │ │ ├── Sanity │ │ │ │ └── pal_sanity_test_main.c │ │ │ ├── Storage │ │ │ │ └── pal_Storage_test_main.c │ │ │ ├── TLS │ │ │ │ └── pal_TLS_test_main.c │ │ │ ├── Time │ │ │ │ └── pal_time_test_main.c │ │ │ ├── Update │ │ │ │ └── pal_Update_test_main.c │ │ │ └── a_pal_reformat │ │ │ │ └── pal_a_pal_reformat_test_main.c │ │ └── pal_make.py │ └── Unity │ │ ├── .mbedignore │ │ ├── Makefile │ │ ├── extras │ │ ├── eclipse │ │ │ └── error_parsers.txt │ │ └── fixture │ │ │ ├── rakefile.rb │ │ │ ├── rakefile_helper.rb │ │ │ ├── readme.txt │ │ │ ├── src │ │ │ ├── unity_fixture.c │ │ │ ├── unity_fixture.h │ │ │ ├── unity_fixture_internals.h │ │ │ └── unity_fixture_malloc_overrides.h │ │ │ └── test │ │ │ ├── main │ │ │ └── AllTests.c │ │ │ ├── template_fixture_tests.c │ │ │ ├── unity_fixture_Test.c │ │ │ ├── unity_fixture_TestRunner.c │ │ │ ├── unity_output_Spy.c │ │ │ └── unity_output_Spy.h │ │ ├── release │ │ ├── build.info │ │ └── version.info │ │ └── src │ │ ├── unity.c │ │ ├── unity.h │ │ └── unity_internals.h ├── Utils │ ├── Scripts │ │ └── junit_cmd_wrapper.py │ ├── memoryProfiler │ │ ├── .mbedignore │ │ ├── Other │ │ │ └── pal_memory.c │ │ └── mbed-os │ │ │ └── pal_memory.c │ └── stackUsage │ │ ├── .mbedignore │ │ └── TestSuite │ │ ├── TargetFunctions.txt │ │ ├── Template │ │ └── template.c │ │ └── TestsGenarator.py └── mbed_lib.json ├── mbed-client-randlib ├── .mbedignore ├── LICENSE ├── apache-2.0.txt ├── mbed-client-randlib │ ├── platform │ │ └── arm_hal_random.h │ └── randLIB.h ├── mbed_lib.json └── source │ └── randLIB.c ├── mbed-client ├── .mbedignore ├── DOXYGEN_FRONTPAGE.md ├── LICENSE ├── doxygen │ └── mbedclient_doxy ├── mbed-client-c │ ├── .mbedignore │ ├── LICENSE │ ├── README.txt │ ├── apache-2.0.txt │ ├── doxygen │ │ └── client-c_doxy │ ├── nsdl-c │ │ ├── sn_client_config.h │ │ ├── sn_nsdl.h │ │ └── sn_nsdl_lib.h │ └── source │ │ ├── include │ │ └── sn_grs.h │ │ ├── sn_grs.c │ │ └── sn_nsdl.c ├── mbed-client-classic │ ├── .mbedignore │ ├── LICENSE │ ├── mbed-client-classic │ │ ├── m2mconnectionhandlerpimpl.h │ │ └── m2mtimerpimpl.h │ └── source │ │ ├── m2mconnectionhandler.cpp │ │ ├── m2mconnectionhandlerpimpl.cpp │ │ ├── m2mtimer.cpp │ │ └── m2mtimerpimpl.cpp ├── mbed-client-mbed-tls │ ├── .mbedignore │ ├── LICENSE │ ├── apache-2.0.txt │ ├── mbed-client-mbedtls │ │ └── m2mconnectionsecuritypimpl.h │ └── source │ │ ├── m2mconnectionsecurity.cpp │ │ └── m2mconnectionsecuritypimpl.cpp ├── mbed-client │ ├── coap_response.h │ ├── functionpointer.h │ ├── m2mbase.h │ ├── m2mblockmessage.h │ ├── m2mconfig.h │ ├── m2mconnectionhandler.h │ ├── m2mconnectionobserver.h │ ├── m2mconnectionsecurity.h │ ├── m2mconstants.h │ ├── m2mdevice.h │ ├── m2mendpoint.h │ ├── m2minterface.h │ ├── m2minterfacefactory.h │ ├── m2minterfaceobserver.h │ ├── m2mobject.h │ ├── m2mobjectinstance.h │ ├── m2mobservationhandler.h │ ├── m2mreportobserver.h │ ├── m2mresource.h │ ├── m2mresourcebase.h │ ├── m2mresourceinstance.h │ ├── m2msecurity.h │ ├── m2mserver.h │ ├── m2mstring.h │ ├── m2mstringbuffer.h │ ├── m2mstringbufferbase.h │ ├── m2mtimer.h │ ├── m2mtimerobserver.h │ ├── m2mvector.h │ ├── m2mversion.h │ └── uriqueryparser.h ├── mbed_lib.json └── source │ ├── include │ ├── eventdata.h │ ├── m2mcallbackstorage.h │ ├── m2mdiscover.h │ ├── m2mdynlog.h │ ├── m2minterfaceimpl.h │ ├── m2mnotificationhandler.h │ ├── m2mnsdlinterface.h │ ├── m2mnsdlobserver.h │ ├── m2mreporthandler.h │ ├── m2mtlvdeserializer.h │ ├── m2mtlvserializer.h │ ├── nsdlaccesshelper.h │ ├── nsdllinker.h │ └── smartpointer.h │ ├── m2mbase.cpp │ ├── m2mblockmessage.cpp │ ├── m2mcallbackstorage.cpp │ ├── m2mdevice.cpp │ ├── m2mdiscover.cpp │ ├── m2mdynlog.cpp │ ├── m2mendpoint.cpp │ ├── m2minterfacefactory.cpp │ ├── m2minterfaceimpl.cpp │ ├── m2mnotificationhandler.cpp │ ├── m2mnsdlinterface.cpp │ ├── m2mobject.cpp │ ├── m2mobjectinstance.cpp │ ├── m2mreporthandler.cpp │ ├── m2mresource.cpp │ ├── m2mresourcebase.cpp │ ├── m2mresourceinstance.cpp │ ├── m2msecurity.cpp │ ├── m2mserver.cpp │ ├── m2mstring.cpp │ ├── m2mstringbufferbase.cpp │ ├── m2mtlvdeserializer.cpp │ ├── m2mtlvserializer.cpp │ ├── nsdlaccesshelper.cpp │ └── uriqueryparser.c ├── mbed-cloud-client ├── MbedCloudClient.h ├── MbedCloudClientConfig.h ├── MbedCloudClientConfigCheck.h └── est_defs.h ├── mbed-coap ├── .mbedignore ├── LICENSE ├── README.txt ├── apache-2.0.txt ├── doxygen │ └── libcoap_doxy ├── mbed-coap │ ├── sn_coap_header.h │ ├── sn_coap_protocol.h │ └── sn_config.h └── source │ ├── include │ ├── sn_coap_header_internal.h │ └── sn_coap_protocol_internal.h │ ├── sn_coap_builder.c │ ├── sn_coap_header_check.c │ ├── sn_coap_parser.c │ └── sn_coap_protocol.c ├── mbed-trace ├── .astyleignore ├── .astylerc ├── .mbedignore ├── CMakeLists.txt ├── LICENSE ├── example │ ├── linux │ │ ├── Makefile │ │ ├── main.c │ │ └── memtest.sh │ └── mbed-os-5 │ │ ├── main.cpp │ │ └── mbed_app.json ├── mbed-trace │ └── mbed_trace.h ├── mbed_lib.json └── source │ ├── CMakeLists.txt │ └── mbed_trace.c ├── mbed_lib.json ├── multicast ├── libota.c ├── libota.h ├── multicast.cpp ├── multicast.h ├── multicast_config.h ├── multicast_sim.cpp ├── otaLIB.h └── otaLIB_resources.h ├── nanostack-libservice ├── .mbedignore ├── LICENSE ├── apache-2.0.txt ├── mbed-client-libservice │ ├── common_functions.h │ ├── ip4string.h │ ├── ip6string.h │ ├── ip_fsc.h │ ├── ns_list.h │ ├── ns_nvm_helper.h │ ├── ns_trace.h │ ├── ns_types.h │ ├── nsdynmemLIB.h │ ├── nsdynmem_tracker.h │ ├── nsdynmem_tracker_lib.h │ └── platform │ │ ├── arm_hal_interrupt.h │ │ └── arm_hal_nvm.h ├── mbed_lib.json └── source │ ├── IPv6_fcf_lib │ └── ip_fsc.c │ ├── libBits │ └── common_functions.c │ ├── libList │ └── ns_list.c │ ├── libip4string │ ├── ip4tos.c │ └── stoip4.c │ ├── libip6string │ ├── ip6tos.c │ └── stoip6.c │ ├── nsdynmemLIB │ └── nsdynmemLIB.c │ ├── nsdynmemtracker │ └── nsdynmem_tracker_lib.c │ └── nvmHelper │ └── ns_nvm_helper.c ├── network-manager ├── LICENSE ├── images │ └── block_diagram.png ├── network-manager │ └── NetworkManager.h └── source │ ├── NetworkManager.cpp │ ├── include │ ├── NetworkManager_internal.h │ ├── nm_cbor_helper.h │ ├── nm_dynmem_helper.h │ ├── nm_interface_manager.h │ ├── nm_kcm_factory.h │ ├── nm_kvstore_helper.h │ └── nm_resource_manager.h │ ├── nm_cbor_helper.c │ ├── nm_dynmem_helper.c │ ├── nm_interface_manager.cpp │ ├── nm_kcm_factory.cpp │ ├── nm_kvstore_helper.cpp │ └── nm_resource_manager.cpp ├── ns-hal-pal ├── arm_hal_interrupt.c ├── arm_hal_interrupt_private.h ├── arm_hal_random.c ├── arm_hal_timer.cpp ├── mbed_lib.json ├── ns_event_loop.c ├── ns_event_loop.h ├── ns_hal_init.c └── ns_hal_init.h ├── sal-stack-nanostack-eventloop ├── LICENSE ├── apache-2.0.txt ├── mbed_lib.json ├── nanostack-event-loop │ ├── eventOS_callback_timer.h │ ├── eventOS_event.h │ ├── eventOS_event_timer.h │ ├── eventOS_scheduler.h │ └── platform │ │ ├── arm_hal_timer.h │ │ └── eventloop_config.h └── source │ ├── event.c │ ├── event.h │ ├── ns_timeout.c │ ├── ns_timer.c │ ├── ns_timer.h │ ├── system_timer.c │ └── timer_sys.h ├── secure-device-access-client ├── CMakeLists.txt ├── DOXYGEN_FRONTPAGE.md ├── cose-c │ ├── .mbedignore │ ├── CMakeLists.txt │ ├── LICENSE │ ├── cose-c │ │ ├── configure.h │ │ ├── cose.h │ │ ├── cose_int.h │ │ └── crypto_cose.h │ └── source │ │ ├── Cose.c │ │ ├── Encrypt.c │ │ ├── Encrypt0.c │ │ ├── MacMessage.c │ │ ├── MacMessage0.c │ │ ├── Recipient.c │ │ ├── Sign.c │ │ ├── Sign0.c │ │ ├── SignerInfo.c │ │ ├── bcrypt.c │ │ ├── cbor.c │ │ ├── mbedtls.c │ │ ├── mbedtls_tiny_cbor.c │ │ └── openssl.c ├── helpers │ ├── helpers │ │ ├── sda_data_token.h │ │ ├── sda_endian.h │ │ └── sda_macros.h │ └── source │ │ └── sda_data_token.c ├── logger │ ├── logger │ │ ├── sda_error_handling.h │ │ └── sda_log.h │ └── sources │ │ └── sda_error_handling.c ├── mem │ ├── mem │ │ └── sda_malloc.h │ └── source │ │ └── sda_malloc.c ├── sda-bundle-parser │ ├── sda-bundle-parser │ │ └── sda_bundle_parser.h │ └── source │ │ └── sda_bundle_parser.c ├── sda-cose │ ├── sda-cose │ │ └── sda_cose.h │ └── source │ │ └── sda_cose.c └── secure-device-access │ ├── secure-device-access │ ├── sda_status.h │ └── secure_device_access.h │ └── source │ ├── include │ ├── sda_error_translation.h │ ├── sda_internal_defs.h │ ├── sda_nonce_mgr.h │ ├── sda_status_internal.h │ ├── sda_trust_anchor.h │ └── sda_verification.h │ ├── sda_error_translation.c │ ├── sda_nonce_mgr.c │ ├── sda_trust_anchor.c │ ├── sda_verification.c │ └── secure_device_access.c ├── source ├── CertificateParser.c ├── CertificatePkcs7Parser.c ├── CloudClientStorage.c ├── ConnectorClient.cpp ├── EstClient.cpp ├── MbedCloudClient.cpp ├── ServiceClient.cpp ├── UpdateClient.cpp └── include │ ├── CertificateParser.h │ ├── CertificatePkcs7Parser.h │ ├── CloudClientStorage.h │ ├── ConnectorClient.h │ ├── EstClient.h │ ├── ServiceClient.h │ ├── UpdateClient.h │ └── UpdateClientResources.h ├── tinycbor ├── .mbedignore ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── makefile_mbed └── src │ ├── .mbedignore │ ├── cbor.dox │ ├── cborencoder.c │ ├── cborencoder_close_container_checked.c │ ├── cborerrorstrings.c │ ├── cborinternal_p.h │ ├── cborjson.h │ ├── cborparser.c │ ├── cborparser_dup_string.c │ ├── cborpretty.c │ ├── cborvalidation.c │ ├── compilersupport_p.h │ ├── parsetags.pl │ ├── src.pri │ ├── tags.txt │ ├── tinycbor-version.h │ ├── tinycbor.h │ ├── tinycbor.pro │ └── utf8_p.h ├── update-client-hub ├── .mbedignore ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── delta-tool-internal │ ├── include │ │ ├── bspatch.h │ │ ├── bspatch_private.h │ │ ├── lz4.h │ │ └── varint.h │ ├── mbed_lib.json │ └── source │ │ ├── bspatch.c │ │ ├── lz4.c │ │ └── varint.c ├── mbed_lib.json ├── modules │ ├── atomic-queue │ │ ├── LICENSE │ │ ├── atomic-queue │ │ │ └── atomic-queue.h │ │ └── source │ │ │ ├── aq_critical.h │ │ │ ├── atomic-cm3.c │ │ │ ├── atomic-queue.c │ │ │ ├── atomic.c │ │ │ ├── atomic.h │ │ │ ├── critical-nordic.c │ │ │ ├── critical-pal.c │ │ │ ├── critical-posix.c │ │ │ ├── critical.c │ │ │ └── posix.cmake │ ├── common │ │ ├── LICENSE │ │ ├── source │ │ │ ├── arm_uc_crypto_mbedtls.c │ │ │ ├── arm_uc_crypto_pal.c │ │ │ ├── arm_uc_error.c │ │ │ ├── arm_uc_hw_plat.c │ │ │ ├── arm_uc_scheduler.c │ │ │ ├── arm_uc_test_rot.c │ │ │ └── arm_uc_utilities.c │ │ └── update-client-common │ │ │ ├── arm_uc_common.h │ │ │ ├── arm_uc_config.h │ │ │ ├── arm_uc_crypto.h │ │ │ ├── arm_uc_error.h │ │ │ ├── arm_uc_hw_plat.h │ │ │ ├── arm_uc_public.h │ │ │ ├── arm_uc_scheduler.h │ │ │ ├── arm_uc_trace.h │ │ │ ├── arm_uc_types.h │ │ │ ├── arm_uc_types_internal.h │ │ │ └── arm_uc_utilities.h │ ├── control-center │ │ ├── LICENSE │ │ ├── source │ │ │ ├── arm_uc_certificate.c │ │ │ ├── arm_uc_certificate_kcm_api.c │ │ │ ├── arm_uc_certificate_raw_api.c │ │ │ ├── arm_uc_control_center.c │ │ │ └── arm_uc_pre_shared_key.c │ │ └── update-client-control-center │ │ │ ├── arm_uc_certificate.h │ │ │ ├── arm_uc_control_center.h │ │ │ └── arm_uc_pre_shared_key.h │ ├── delta-paal │ │ ├── source │ │ │ ├── arm_uc_pal_delta_paal.c │ │ │ ├── arm_uc_pal_delta_paal_implementation.c │ │ │ ├── arm_uc_pal_delta_paal_original_reader.c │ │ │ └── bspatch_uc_mbed.c │ │ └── update-client-delta-paal │ │ │ ├── arm_uc_pal_delta_paal.h │ │ │ ├── arm_uc_pal_delta_paal_implementation.h │ │ │ └── arm_uc_pal_delta_paal_original_reader.h │ ├── device-identity │ │ ├── .mbedignore │ │ ├── LICENSE │ │ ├── pal4life-device-identity │ │ │ └── pal_device_identity.h │ │ └── source │ │ │ ├── arm_uc_device_identity.c │ │ │ ├── arm_uc_device_identity_kcm.c │ │ │ ├── arm_uc_device_identity_nvstore.c │ │ │ └── arm_uc_device_identity_raw.c │ ├── firmware-manager │ │ ├── .mbedignore │ │ ├── LICENSE │ │ ├── source │ │ │ └── arm_uc_firmware_manager.c │ │ └── update-client-firmware-manager │ │ │ └── arm_uc_firmware_manager.h │ ├── lwm2m-mbed │ │ ├── LICENSE │ │ ├── source │ │ │ ├── DeviceMetadataResource.cpp │ │ │ ├── FirmwareUpdateResource.cpp │ │ │ ├── device_metadata.c │ │ │ ├── firmware_update.c │ │ │ ├── lwm2m-control.cpp │ │ │ ├── lwm2m-monitor.cpp │ │ │ ├── lwm2m-source.cpp │ │ │ ├── update-lwm2m-mbed-apis.c │ │ │ ├── update-lwm2m-mbed-apis.h │ │ │ └── update_lwm2m_monitor.c │ │ └── update-client-lwm2m │ │ │ ├── DeviceMetadataResource.h │ │ │ ├── FirmwareUpdateResource.h │ │ │ ├── device_metadata.h │ │ │ ├── firmware_update.h │ │ │ ├── lwm2m-control.h │ │ │ ├── lwm2m-monitor.h │ │ │ ├── lwm2m-source.h │ │ │ └── update_lwm2m_monitor.h │ ├── manifest-manager │ │ ├── .mbedignore │ │ ├── LICENSE │ │ ├── source │ │ │ ├── arm_uc_mmCommon.c │ │ │ ├── arm_uc_mmCommon.h │ │ │ ├── arm_uc_mmConfig.h │ │ │ ├── arm_uc_mmCryptoUtils.c │ │ │ ├── arm_uc_mmCryptoUtils.h │ │ │ ├── arm_uc_mmDerManifestAccessors.c │ │ │ ├── arm_uc_mmDerManifestAccessors.h │ │ │ ├── arm_uc_mmDerManifestParser.c │ │ │ ├── arm_uc_mmDerManifestParser.h │ │ │ ├── arm_uc_mmFSMHelper.h │ │ │ ├── arm_uc_mmFetchFirmwareInfo.c │ │ │ ├── arm_uc_mmFetchFirmwareInfo.h │ │ │ ├── arm_uc_mmGetLatestTimestamp.c │ │ │ ├── arm_uc_mmGetLatestTimestamp.h │ │ │ ├── arm_uc_mmInit.c │ │ │ ├── arm_uc_mmInit.h │ │ │ ├── arm_uc_mmInsertManifest.c │ │ │ ├── arm_uc_mmInsertManifest.h │ │ │ ├── arm_uc_mmStateSelector.c │ │ │ ├── arm_uc_mmStateSelector.h │ │ │ └── manifest-manager-api.c │ │ └── update-client-manifest-manager │ │ │ ├── arm-pal-kv.h │ │ │ ├── update-client-manifest-manager-context.h │ │ │ ├── update-client-manifest-manager.h │ │ │ └── update-client-manifest-types.h │ ├── metadata-header │ │ ├── source │ │ │ ├── arm_uc_buffer_utilities.c │ │ │ ├── arm_uc_crypto_hmac_mbedtls.c │ │ │ └── arm_uc_metadata_header_v2.c │ │ └── update-client-metadata-header │ │ │ ├── arm_uc_buffer_utilities.h │ │ │ └── arm_uc_metadata_header_v2.h │ ├── monitor │ │ ├── LICENSE │ │ └── update-client-monitor │ │ │ └── arm_uc_monitor.h │ ├── paal │ │ ├── LICENSE │ │ ├── source │ │ │ └── arm_uc_paal_update.c │ │ └── update-client-paal │ │ │ ├── arm_uc_paal_update.h │ │ │ └── arm_uc_paal_update_api.h │ ├── pal-blockdevice │ │ ├── .mbedignore │ │ ├── source │ │ │ ├── arm_uc_pal_blockdevice.c │ │ │ ├── arm_uc_pal_blockdevice_implementation.c │ │ │ └── arm_uc_pal_blockdevice_mbed.cpp │ │ └── update-client-pal-blockdevice │ │ │ ├── arm_uc_pal_blockdevice.h │ │ │ ├── arm_uc_pal_blockdevice_implementation.h │ │ │ └── arm_uc_pal_blockdevice_platform.h │ ├── pal-filesystem │ │ ├── LICENSE │ │ ├── source │ │ │ ├── arm_uc_paal_classic_pal.c │ │ │ ├── arm_uc_pal_filesystem_utils.c │ │ │ ├── arm_uc_pal_filesystem_utils.h │ │ │ ├── arm_uc_pal_linux_extensions.c │ │ │ ├── arm_uc_pal_mbed_extensions.c │ │ │ └── arm_uc_pal_sxos_extensions.c │ │ └── update-client-pal-filesystem │ │ │ ├── arm_uc_pal_extensions.h │ │ │ └── arm_uc_pal_filesystem.h │ ├── pal-flashiap-mcuboot │ │ ├── LICENSE │ │ ├── source │ │ │ ├── arm_uc_pal_flashiap_flash.cpp │ │ │ ├── arm_uc_pal_flashiap_mcuboot.c │ │ │ ├── arm_uc_pal_flashiap_mcuboot_helper.c │ │ │ └── arm_uc_pal_flashiap_mcuboot_implementation.c │ │ └── update-client-pal-flashiap-mcuboot │ │ │ ├── arm_uc_pal_flashiap_mcuboot.h │ │ │ ├── arm_uc_pal_flashiap_mcuboot_helper.h │ │ │ ├── arm_uc_pal_flashiap_mcuboot_implementation.h │ │ │ └── arm_uc_pal_flashiap_mcuboot_platform.h │ ├── pal-flashiap │ │ ├── LICENSE │ │ ├── source │ │ │ ├── arm_uc_pal_flashiap.c │ │ │ ├── arm_uc_pal_flashiap_cy_details.c │ │ │ ├── arm_uc_pal_flashiap_implementation.c │ │ │ └── arm_uc_pal_flashiap_mbed.cpp │ │ └── update-client-pal-flashiap │ │ │ ├── arm_uc_pal_flashiap.h │ │ │ ├── arm_uc_pal_flashiap_implementation.h │ │ │ └── arm_uc_pal_flashiap_platform.h │ ├── pal-linux │ │ ├── LICENSE │ │ ├── scripts │ │ │ ├── arm_update_cmdline.sh │ │ │ ├── generic │ │ │ │ ├── arm_update_activate.sh │ │ │ │ ├── arm_update_active_details.sh │ │ │ │ ├── arm_update_details.sh │ │ │ │ ├── arm_update_finalize.sh │ │ │ │ ├── arm_update_initialize.sh │ │ │ │ ├── arm_update_installer.sh │ │ │ │ ├── arm_update_prepare.sh │ │ │ │ ├── arm_update_read.sh │ │ │ │ └── arm_update_write.sh │ │ │ ├── openwrt │ │ │ │ ├── arm_update_activate.sh │ │ │ │ ├── arm_update_active_details.sh │ │ │ │ └── arm_update_kernel.sh │ │ │ ├── yocto_generic │ │ │ │ ├── arm_update_activate.sh │ │ │ │ ├── arm_update_active_details.sh │ │ │ │ └── arm_update_common.sh │ │ │ ├── yocto_rpi │ │ │ │ ├── arm_update_activate.sh │ │ │ │ ├── arm_update_active_details.sh │ │ │ │ └── arm_update_prepare.sh │ │ │ └── yotta_install.sh │ │ ├── source │ │ │ ├── arm_uc_pal_linux_generic.c │ │ │ ├── arm_uc_pal_linux_implementation.c │ │ │ ├── arm_uc_pal_linux_implementation_internal.c │ │ │ ├── arm_uc_pal_linux_openwrt.c │ │ │ ├── arm_uc_pal_linux_yocto_generic.c │ │ │ └── arm_uc_pal_linux_yocto_rpi.c │ │ └── update-client-pal-linux │ │ │ ├── arm_uc_pal_linux_ext.h │ │ │ ├── arm_uc_pal_linux_generic.h │ │ │ ├── arm_uc_pal_linux_implementation.h │ │ │ ├── arm_uc_pal_linux_implementation_internal.h │ │ │ └── arm_uc_pal_linux_openwrt.h │ ├── pal-target-specific │ │ ├── LICENSE │ │ ├── source │ │ │ └── arm_uc_pal_realtek_rtl8195am.c │ │ └── update-client-pal-target-specific │ │ │ └── arm_uc_pal_realtek_rtl8195am.h │ ├── resume-engine │ │ ├── .mbedignore │ │ ├── source │ │ │ └── arm_uc_resume.c │ │ └── update-client-resume-engine │ │ │ └── arm_uc_resume.h │ ├── source-http-socket │ │ ├── LICENSE │ │ ├── source │ │ │ ├── arm_uc_http_socket.c │ │ │ ├── arm_uc_http_socket_private.c │ │ │ ├── arm_uc_http_socket_private.h │ │ │ ├── arm_uc_socket_help.c │ │ │ └── arm_uc_socket_help.h │ │ └── update-client-source-http-socket │ │ │ └── arm_uc_http_socket.h │ ├── source-http │ │ ├── LICENSE │ │ ├── source │ │ │ └── arm_uc_source_http.c │ │ └── update-client-source-http │ │ │ ├── arm_uc_source_http.h │ │ │ └── arm_uc_source_http_extra.h │ ├── source-manager │ │ ├── .mbedignore │ │ ├── LICENSE │ │ ├── source │ │ │ └── arm_uc_source_manager.c │ │ └── update-client-source-manager │ │ │ └── arm_uc_source_manager.h │ └── source │ │ ├── LICENSE │ │ └── update-client-source │ │ └── arm_uc_source.h ├── source │ ├── update_client_hub.c │ ├── update_client_hub_error_handler.c │ ├── update_client_hub_error_handler.h │ ├── update_client_hub_event_handlers.c │ ├── update_client_hub_event_handlers.h │ ├── update_client_hub_state_machine.c │ └── update_client_hub_state_machine.h └── update-client-hub │ ├── update_client_certificate.h │ ├── update_client_hub.h │ └── update_client_public.h └── zephyr ├── Kconfig ├── Kconfig.client ├── Kconfig.mbedtls ├── Kconfig.pal ├── cmake ├── CMakeLists.txt └── macros.cmake ├── config ├── zephyr_default.h └── zephyr_update.h └── module.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.c text 7 | *.h text 8 | *.cpp text 9 | *.sh text 10 | *.py text 11 | *.md text 12 | *.java text 13 | *.yml text 14 | *.cmake text 15 | *.lib text 16 | *.ref text 17 | 18 | # Declare files that will always have CRLF line endings on checkout. 19 | *.sln text eol=crlf 20 | *.bat text eol=crlf 21 | 22 | # Denote all files that are truly binary and should not be modified. 23 | *.png binary 24 | *.jpg binary 25 | *.pdf binary 26 | *.mpp binary 27 | *.doc binary 28 | *.docx binary 29 | *.xls binary 30 | *.xlsx binary 31 | *.ppt binary 32 | *.pptx binary 33 | *.tar binary 34 | *.gzip binary 35 | *.zip binary 36 | *.7z binary 37 | 38 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | [] I confirm this contribution is my own and I agree to license it with Apache 2.0. 8 | [] I confirm the moderators may change the PR before merging it in. 9 | [] I understand the release model prohibits detailed Git history and my contribution will be recorded to the list at the bottom of [CONTRIBUTING.md](CONTRIBUTING.md). 10 | 11 | 12 | ### Summary of changes 13 | 14 | 26 | 27 | -------------------------------------------------------------------------------- /.mbedignore: -------------------------------------------------------------------------------- 1 | mbed-client-randlib/* 2 | mbed-coap/* 3 | mbed-trace/* 4 | nanostack-libservice/* 5 | ns-hal-pal/* 6 | sal-stack-nanostack-eventloop/* 7 | kvstore/* 8 | unittests/* 9 | test_modules/* 10 | tools/* 11 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributions to Izuma Device Management Client 2 | 3 | Izuma Device Management Client is Apache 2.0 licensed open source software. We accept contributions from 3rd parties, if they agree to submit their changes with Apache 2.0 licensing. Izuma Networks will review all contributions and possibly make some modifications before merging them. 4 | 5 | Due to the release process, all new releases are squashed code drops. Therefore, we cannot provide the full Git commit history in the releases. 6 | 7 | # Approved contributions 8 | 9 | | Author | Pull Request | Change title/summary | 10 | |----------------|---------------|----------------------------------------------------------| 11 | | Garrett LoVerde (@40Grit) | [#46](https://github.com/PelionIoT/mbed-cloud-client/pull/46) | Remove redundant switch in `get_resource` | 12 | | Pawel Dunaj ([@pdunaj](https://github.com/pdunaj)) | N/A | Port Izuma Client to Zephyr OS | 13 | | Emil Obalski ([@emob-nordic](https://github.com/emob-nordic)) | N/A | Port Izuma Client to Zephyr OS | 14 | | Emil Obalski ([@emob-nordic](https://github.com/emob-nordic)) | [#86](https://github.com/PelionIoT/mbed-cloud-client/pull/86) | Update pal Timers | 15 | | ccli8 ([@ccli8](https://github.com/ccli8)) | [#88](https://github.com/PelionIoT/mbed-cloud-client/pull/88) | Fix missing header file | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Device Management Client 2 | This repository contains Izuma Device Management Client: a library that connects devices to Izuma Device Management service and to Mbed-enabled cloud services from our partners. 3 | 4 | The documentation is hosted [here](https://developer.izumanetworks.com/docs/device-management/current/welcome/index.html). 5 | 6 | You can report concerns about the documentation or this SW as issues to [this GitHub repository](https://github.com/PelionIoT/mbed-cloud-client/issues). 7 | 8 | 9 | -------------------------------------------------------------------------------- /certificate-enrollment-client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project("certificate-enrollment-client") 3 | 4 | # includes 5 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source/include) 6 | 7 | FILE( 8 | GLOB_RECURSE 9 | certificate_enrollment_client 10 | 11 | "${CMAKE_CURRENT_SOURCE_DIR}/certificate-enrollment-client/*.h" 12 | "${CMAKE_CURRENT_SOURCE_DIR}/source/*.c" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp" 14 | ) 15 | 16 | message ("*********************************************************************") 17 | message ("certificate_enrollment_client = [[${certificate_enrollment_client}]]") 18 | message ("*********************************************************************") 19 | 20 | CREATE_LIBRARY(certificate-enrollment-client "${certificate_enrollment_client}" "") 21 | 22 | ADDSUBDIRS() 23 | -------------------------------------------------------------------------------- /device-sentry-client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project("device-sentry-client") 3 | 4 | # includes 5 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/device-sentry-client) 6 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source/include) 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source/linux-os) 8 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/test-api) 9 | 10 | if (${OS_BRAND} MATCHES "Linux") 11 | FILE( 12 | GLOB_RECURSE 13 | device_sentry_client 14 | 15 | "${CMAKE_CURRENT_SOURCE_DIR}/source/ds_metrics_report.cpp" 16 | "${CMAKE_CURRENT_SOURCE_DIR}/source/DeviceSentryClient.cpp" 17 | "${CMAKE_CURRENT_SOURCE_DIR}/source/linux-os/*.cpp" 18 | "${CMAKE_CURRENT_SOURCE_DIR}/source/linux-os/*.c" 19 | "${CMAKE_CURRENT_SOURCE_DIR}/test-api/*.c" 20 | "${CMAKE_CURRENT_SOURCE_DIR}/test-api/*.cpp" 21 | ) 22 | else() 23 | FILE( 24 | GLOB_RECURSE 25 | device_sentry_client 26 | 27 | "${CMAKE_CURRENT_SOURCE_DIR}/source/ds_metrics_report.cpp" 28 | "${CMAKE_CURRENT_SOURCE_DIR}/source/DeviceSentryClient.cpp" 29 | "${CMAKE_CURRENT_SOURCE_DIR}/source/stub-os/*.cpp" 30 | "${CMAKE_CURRENT_SOURCE_DIR}/source/stub-os/*.c" 31 | "${CMAKE_CURRENT_SOURCE_DIR}/test-api/*.c" 32 | "${CMAKE_CURRENT_SOURCE_DIR}/test-api/*.cpp" 33 | ) 34 | endif() 35 | 36 | message ("*********************************************************************") 37 | message ("device_sentry_client = [[${device_sentry_client}]]") 38 | message ("*********************************************************************") 39 | 40 | CREATE_LIBRARY(device-sentry-client "${device_sentry_client}" "") 41 | 42 | ADDSUBDIRS() 43 | -------------------------------------------------------------------------------- /device-sentry-client/device-sentry-client/DeviceSentryClient.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2020 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifndef DEVICE_SENTRY_CLIENT_H 18 | #define DEVICE_SENTRY_CLIENT_H 19 | 20 | #include "mbed-client/m2minterface.h" 21 | #include "ds_status.h" 22 | 23 | /** Class used for tracking device metrics and platform health 24 | * 25 | * @note Synchronization level: Not protected against multithreading 26 | */ 27 | namespace DeviceSentryClient 28 | { 29 | 30 | /** 31 | * @brief Initialize Mbed Cloud Client Device Sentry resources and infrastructure. 32 | * 33 | * @param registration_list Mbed Cloud Client resource objects list 34 | * @return DS_STATUS_SUCCESS on success, or some error if failed 35 | */ 36 | ds_status_e init(M2MBaseList& registration_list); 37 | 38 | /** 39 | * @brief Finalizes Device Sentry resources. 40 | * 41 | */ 42 | void finalize(); 43 | 44 | }; 45 | 46 | #endif // DEVICE_SENTRY_CLIENT_H 47 | -------------------------------------------------------------------------------- /device-sentry-client/source/.mbedignore: -------------------------------------------------------------------------------- 1 | linux-os/* 2 | stub-os/* -------------------------------------------------------------------------------- /device-sentry-client/source/include/ds_custom_metrics_internal.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2020 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | #ifndef DS_CUSTOM_METRICS_INTERNAL_API_H 17 | #define DS_CUSTOM_METRICS_INTERNAL_API_H 18 | 19 | #include 20 | #include 21 | #include "ds_status.h" 22 | #include "ds_custom_metrics.h" 23 | 24 | // Maximal number of custom metrics in the configuration message 25 | #define DS_MAX_NUMBER_OF_CUSTOM_METRICS 10 26 | 27 | // structure describing custom metrics meta-data 28 | typedef struct ds_custom_metric_t { 29 | ds_custom_metric_id_t metric_id; 30 | uint32_t report_interval; // reporting interval in seconds 31 | } ds_custom_metric_t; 32 | 33 | 34 | #endif // DS_CUSTOM_METRICS_INTERNAL_API_H 35 | -------------------------------------------------------------------------------- /device-sentry-client/source/linux-os/ds_plat_defs.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2020 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifndef DS_PLAT_DEFS_H 18 | #define DS_PLAT_DEFS_H 19 | 20 | // linux platform requires large buffer for nework metrics 21 | #define DS_PLAT_METRICS_REPORT_BUFFER 10*1024 22 | 23 | #endif // DS_PLAT_DEFS_H -------------------------------------------------------------------------------- /device-sentry-client/source/mbed-os/ds_plat_defs.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2020 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifndef DS_PLAT_DEFS_H 18 | #define DS_PLAT_DEFS_H 19 | 20 | // MbedOS is not expected to require large buffer for nework metrics 21 | #define DS_PLAT_METRICS_REPORT_BUFFER 1024 22 | 23 | #endif // DS_PLAT_DEFS_H -------------------------------------------------------------------------------- /device-sentry-client/source/stub-os/ds_plat_defs.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2020 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifndef DS_PLAT_DEFS_H 18 | #define DS_PLAT_DEFS_H 19 | 20 | // stub platform definition 21 | #define DS_PLAT_METRICS_REPORT_BUFFER 1024 22 | 23 | #endif // DS_PLAT_DEFS_H -------------------------------------------------------------------------------- /factory-configurator-client/.mbedignore: -------------------------------------------------------------------------------- 1 | mbed-cryptoauthlib/* 2 | -------------------------------------------------------------------------------- /factory-configurator-client/crypto-service/crypto-service/cs_hash.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PelionIoT/mbed-cloud-client/5c654f9e54ad360c55d392154c1a4efd96424e63/factory-configurator-client/crypto-service/crypto-service/cs_hash.h -------------------------------------------------------------------------------- /factory-configurator-client/crypto-service/source/cs_hash.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #include "pv_error_handling.h" 18 | #include "cs_hash.h" 19 | #include "cs_pal_crypto.h" 20 | #include "cs_utils.h" 21 | #include "pv_macros.h" 22 | 23 | 24 | kcm_status_e cs_hash(cs_hash_mode_e mode, const uint8_t *data, size_t data_size, uint8_t *digest, size_t digest_size) 25 | { 26 | SA_PV_ERR_RECOVERABLE_RETURN_IF((data == NULL), KCM_STATUS_INVALID_PARAMETER, "Invalid data pointer"); 27 | SA_PV_ERR_RECOVERABLE_RETURN_IF((digest == NULL), KCM_STATUS_INVALID_PARAMETER, "Invalid digest pointer"); 28 | SA_PV_ERR_RECOVERABLE_RETURN_IF((mode != CS_SHA256), KCM_CRYPTO_STATUS_UNSUPPORTED_HASH_MODE, "Hash mode not supported"); 29 | 30 | PV_UNUSED_PARAM(digest_size); 31 | 32 | palStatus_t pal_status = pal_sha256(data, data_size, digest); 33 | return cs_error_handler(pal_status); 34 | } 35 | -------------------------------------------------------------------------------- /factory-configurator-client/factory-configurator-client/source/include/fcc_utils.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifndef __FCC_UTILS_H__ 18 | #define __FCC_UTILS_H__ 19 | 20 | #include 21 | #include 22 | #include 23 | #include "key_config_manager.h" 24 | #include "factory_configurator_client.h" 25 | #include "fcc_defs.h" 26 | #ifndef FCC_NANOCLIENT_ENABLED 27 | #include "pal.h" 28 | #endif 29 | #include "cs_pal_crypto.h" 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | fcc_status_e fcc_convert_kcm_to_fcc_status(kcm_status_e kcm_result); 36 | 37 | fcc_status_e fcc_convert_pal_to_fcc_status(palStatus_t pal_result); 38 | 39 | bool fcc_is_initialized(void); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif //__FCC_UTILS_H__ 46 | -------------------------------------------------------------------------------- /factory-configurator-client/mbed-client-esfs/.mbedignore: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /factory-configurator-client/mbed-client-esfs/source/include/esfs_file_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef __ESFS_FILE_NAME_H 17 | #define __ESFS_FILE_NAME_H 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | esfs_result_e esfs_get_name_from_blob(const uint8_t *blob, uint32_t blob_length,char *file_name, uint32_t size_of_file_name); 24 | 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | 31 | #endif 32 | 33 | 34 | -------------------------------------------------------------------------------- /factory-configurator-client/storage/source/include/se_slot_manager_defs.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifdef MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT 18 | #ifdef MBED_CONF_MBED_CLOUD_CLIENT_SECURE_ELEMENT_SUPPORT 19 | #ifndef __SE_SLOT_MANAGER_DEFS_H__ 20 | #define __SE_SLOT_MANAGER_DEFS_H__ 21 | 22 | #include "kcm_defs.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Structure that represents SE pre provisioned data*/ 29 | typedef struct sem_preprovisioned_item_data_ { 30 | kcm_item_type_e kcm_item_type; 31 | const char *kcm_item_name; 32 | uint16_t se_slot_num; 33 | } sem_preprovisioned_item_data_s; 34 | 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif //__SE_SLOT_MANAGER_DEFS_H__ 41 | #endif //MBED_CONF_MBED_CLOUD_CLIENT_SECURE_ELEMENT_SUPPORT 42 | #endif //MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT 43 | -------------------------------------------------------------------------------- /factory-configurator-client/utils/source/general_utils.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #include 18 | #include 19 | 20 | bool is_memory_equal(const void *buf1, size_t size_of_buf1, const void *buf2, size_t size_of_buf2) 21 | { 22 | return ((size_of_buf1 == size_of_buf2) && !memcmp(buf1, buf2, size_of_buf1)); 23 | } 24 | -------------------------------------------------------------------------------- /factory-configurator-client/utils/source/pv_error_handling.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | 18 | #include "stdbool.h" 19 | #include "pv_error_handling.h" 20 | 21 | static bool g_pv_is_error_occured = false; 22 | 23 | void pv_error_occured(void) 24 | { 25 | g_pv_is_error_occured = true; 26 | } 27 | 28 | bool pv_error_is_error_occured(void) 29 | { 30 | return g_pv_is_error_occured; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /factory-configurator-client/utils/utils/fcc_stats.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifndef __FCC_STATS_H__ 18 | #define __FCC_STATS_H__ 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /** 27 | * Prints heap statistics results. 28 | * - Usually user will call this function at program end. 29 | */ 30 | void fcc_stats_print_summary(void); 31 | 32 | #ifndef FCC_MEM_STATS_ENABLED 33 | #define fcc_stats_print_summary() 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /factory-configurator-client/utils/utils/general_utils.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | bool is_memory_equal(const void *buf1, size_t size_of_buf1, const void *buf2, size_t size_of_buf2); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /factory-configurator-client/utils/utils/mbed_stats_helper.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2017-2018 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef MBED_STATS_HELPER_H 20 | #define MBED_STATS_HELPER_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void print_mbed_stats(void); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* MBED_STATS_HELPER_H */ 33 | -------------------------------------------------------------------------------- /fota/.mbedignore: -------------------------------------------------------------------------------- 1 | bspatch/* 2 | -------------------------------------------------------------------------------- /fota/bspatch/bspatch_common.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2019-2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef DELTA_TOOL_INTERNAL_INCLUDE_COMMON_H_ 20 | #define DELTA_TOOL_INTERNAL_INCLUDE_COMMON_H_ 21 | 22 | #define FILE_MAGIC "PELION/BSDIFF001" // BSDIFF version 23 | #define FILE_MAGIC_LEN (sizeof(FILE_MAGIC) - 1) // without the null termination 24 | 25 | #define MAX_FRAME_SIZE_DEFAULT 512 26 | 27 | #endif /* DELTA_TOOL_INTERNAL_INCLUDE_COMMON_H_ */ 28 | -------------------------------------------------------------------------------- /fota/bspatch/import_ref.txt: -------------------------------------------------------------------------------- 1 | Imported from delta-tool at hash: c2f98daa8b75cfc53f6175b418f50bdb7d4c7c03 2 | -------------------------------------------------------------------------------- /fota/bspatch_fota_mbed.c: -------------------------------------------------------------------------------- 1 | // Include bspatch source files, which are ignored with .mbedignore 2 | // in order to avoid collision with the ones used in UC-Hub 3 | // (due to the nature of mbed-os source file globbing) 4 | 5 | #if !defined(FOTA_UNIT_TEST) 6 | #include "MbedCloudClientConfig.h" 7 | #endif 8 | 9 | #if (defined(__MBED__) || defined(__NANOSIMULATOR__)) && defined(MBED_CLOUD_CLIENT_FOTA_ENABLE) 10 | #include "bspatch/bspatch.c" 11 | #include "bspatch/lz4.c" 12 | #include "bspatch/varint.c" 13 | #endif 14 | -------------------------------------------------------------------------------- /fota/fota_component_defs.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2019-2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef __FOTA_COMPONENT_DEFS_H_ 20 | #define __FOTA_COMPONENT_DEFS_H_ 21 | 22 | #include "fota/fota_base.h" 23 | 24 | #if defined(TARGET_LIKE_LINUX) 25 | #if !defined(FOTA_NUM_COMPONENTS) 26 | #define FOTA_NUM_COMPONENTS 5 27 | #endif 28 | #endif 29 | 30 | #define FOTA_COMPONENT_SEMVER_BIT ((uint64_t)1 << 55) 31 | #define FOTA_COMPONENT_MAX_NAME_SIZE 9 32 | #define FOTA_COMPONENT_MAX_SEMVER_STR_SIZE 12 33 | 34 | #define FOTA_COMPONENT_MAIN_COMP_NUM 0 35 | #define FOTA_COMPONENT_MAIN_COMPONENT_NAME "MAIN" 36 | 37 | typedef uint64_t fota_component_version_t; 38 | 39 | #endif // __FOTA_COMPONENT_DEFS_H_ 40 | -------------------------------------------------------------------------------- /fota/fota_crypto_asn_extra.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2019-2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef __FOTA_CRYPTO_ASN_EXTRA_H_ 20 | #define __FOTA_CRYPTO_ASN_EXTRA_H_ 21 | 22 | #include 23 | 24 | #define MBEDTLS_ASN1_ENUMERATED 0x0A 25 | 26 | int mbedtls_asn1_get_enumerated_value(unsigned char **p, 27 | const unsigned char *end, 28 | int *val); 29 | int mbedtls_asn1_get_int64(unsigned char **p, 30 | const unsigned char *end, 31 | int64_t *val); 32 | 33 | #endif // __FOTA_CRYPTO_ASN_EXTRA_H_ 34 | -------------------------------------------------------------------------------- /fota/fota_crypto_defs.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2019-2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef __FOTA_CRYPTO_DEFS_H_ 20 | #define __FOTA_CRYPTO_DEFS_H_ 21 | 22 | #include "fota/fota_base.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | #define FOTA_ENCRYPT_KEY_SIZE 16 /*< AES-128 key size in bytes */ 30 | 31 | #define FOTA_ENCRYPT_TAG_SIZE 8 /*< AES-CCM tag size in bytes */ 32 | 33 | #define FOTA_CRYPTO_HASH_SIZE 32 /*< SHA256 digest size in bytes*/ 34 | 35 | #define FOTA_UPDATE_RAW_PUBLIC_KEY_SIZE 65 // compression byte | r | s 36 | #define FOTA_IMAGE_RAW_SIGNATURE_SIZE 64 // raw signature 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif // __FOTA_CRYPTO_DEFS_H_ 43 | -------------------------------------------------------------------------------- /fota/fota_device_key.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef FOTA_DEVICE_KEY 20 | #define FOTA_DEVICE_KEY 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #if ((MBED_CLOUD_CLIENT_FOTA_FW_HEADER_VERSION == 2) && (MBED_CLOUD_CLIENT_FOTA_FW_HEADER_EXTERNAL == 1)) || \ 27 | (MBED_CLOUD_CLIENT_FOTA_ENCRYPTION_SUPPORT == 1) 28 | int8_t fota_get_device_key_128bit(uint8_t *key, uint32_t keyLenBytes); 29 | 30 | #endif 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif // FOTA_DEVICE_KEY 37 | -------------------------------------------------------------------------------- /fota/fota_internal_ifs.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #include "fota_internal_ifs.h" 20 | 21 | #ifdef MBED_CLOUD_CLIENT_FOTA_ENABLE 22 | 23 | #include "fota/fota_event_handler.h" 24 | 25 | void fota_internal_resume() 26 | { 27 | fota_event_handler_defer_with_result_ignore_busy(fota_on_resume, /*fota resume by internal flow */ 1); 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /fota/fota_internal_ifs.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef __FOTA_INTERNAL_IFS_H_ 20 | #define __FOTA_INTERNAL_IFS_H_ 21 | 22 | #include "fota/fota_config.h" 23 | 24 | #if defined(MBED_CLOUD_CLIENT_FOTA_ENABLE) 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /** 31 | * Resume Pelion FOTA update - internal 32 | * 33 | * If the update process is interrupted, the interal flow can call this function to resume the process. 34 | */ 35 | void fota_internal_resume(void); 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif // (MBED_CLOUD_CLIENT_FOTA_ENABLE) 43 | 44 | #endif // __FOTA_INTERNAL_IFS_H_ 45 | -------------------------------------------------------------------------------- /fota/fota_platform_hooks_default.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2021 Pelion Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | #include "fota_platform_hooks.h" 19 | 20 | #if defined(MBED_CLOUD_CLIENT_FOTA_ENABLE) 21 | 22 | #if !defined(FOTA_CUSTOM_PLATFORM) || (!FOTA_CUSTOM_PLATFORM) 23 | 24 | // Default platform hooks 25 | int fota_platform_init_hook(bool after_upgrade) 26 | { 27 | return FOTA_STATUS_SUCCESS; 28 | } 29 | 30 | int fota_platform_start_update_hook(const char *comp_name) 31 | { 32 | return FOTA_STATUS_SUCCESS; 33 | } 34 | 35 | int fota_platform_finish_update_hook(const char *comp_name) 36 | { 37 | return FOTA_STATUS_SUCCESS; 38 | } 39 | 40 | int fota_platform_abort_update_hook(const char *comp_name) 41 | { 42 | return FOTA_STATUS_SUCCESS; 43 | } 44 | 45 | #endif // !defined(FOTA_CUSTOM_PLATFORM) || (!FOTA_CUSTOM_PLATFORM) 46 | 47 | #endif // defined(MBED_CLOUD_CLIENT_FOTA_ENABLE) 48 | 49 | -------------------------------------------------------------------------------- /fota/import_ref.txt: -------------------------------------------------------------------------------- 1 | Imported from nanoclient at hash: 030df6546e99d8b1ccbf97361e48a7b4220156b7 2 | -------------------------------------------------------------------------------- /fota/platform/linux/.mbedignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /kvstore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (${OS_BRAND} MATCHES "Linux")) 2 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/include) 3 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/helpers) 4 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/conf) 5 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/kv_map) 6 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/global_api) 7 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/tdbstore) 8 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/securestore) 9 | 10 | SET(KVSTORE_SRCS 11 | ${CMAKE_CURRENT_SOURCE_DIR}/helpers/FlashIAPBlockDevice.cpp 12 | ${CMAKE_CURRENT_SOURCE_DIR}/tdbstore/TDBStore.cpp 13 | ${CMAKE_CURRENT_SOURCE_DIR}/helpers/BufferedBlockDevice.cpp 14 | ${CMAKE_CURRENT_SOURCE_DIR}/global_api/kvstore_global_api.cpp 15 | ${CMAKE_CURRENT_SOURCE_DIR}/kv_map/KVMap.cpp 16 | ${CMAKE_CURRENT_SOURCE_DIR}/conf/kv_config.cpp 17 | ${CMAKE_CURRENT_SOURCE_DIR}/helpers/pal_plat_rot.cpp 18 | ${CMAKE_CURRENT_SOURCE_DIR}/helpers/DeviceKey.cpp 19 | ${CMAKE_CURRENT_SOURCE_DIR}/helpers/FlashSimBlockDevice.cpp 20 | ${CMAKE_CURRENT_SOURCE_DIR}/helpers/SlicingBlockDevice.cpp 21 | ${CMAKE_CURRENT_SOURCE_DIR}/securestore/SecureStore.cpp 22 | ) 23 | add_library(kvstore STATIC "${KVSTORE_SRCS}") 24 | if (${OS_BRAND} MATCHES "Zephyr") 25 | target_link_libraries(kvstore PUBLIC ${TLS_LIBRARY}) 26 | endif() 27 | 28 | endif() 29 | 30 | -------------------------------------------------------------------------------- /kvstore/helpers/ExternalBlockDevice.h: -------------------------------------------------------------------------------- 1 | /* mbed Microcontroller Library 2 | * Copyright (c) 2020 ARM Limited 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef EXTERNAL_BLOCK_DEVICE_H 18 | #define EXTERNAL_BLOCK_DEVICE_H 19 | 20 | #include "BlockDevice.h" 21 | 22 | namespace mbed { 23 | 24 | class ExternalBlockDevice : public BlockDevice { 25 | public: 26 | ExternalBlockDevice(); 27 | virtual ~ExternalBlockDevice(); 28 | virtual int init(); 29 | virtual int deinit(); 30 | virtual int read(void *buffer, bd_addr_t addr, bd_size_t size); 31 | virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size); 32 | virtual int erase(bd_addr_t addr, bd_size_t size); 33 | virtual bd_size_t get_read_size() const; 34 | virtual bd_size_t get_program_size() const; 35 | virtual bd_size_t get_erase_size() const; 36 | virtual bd_size_t size() const; 37 | virtual const char *get_type() const; 38 | virtual int get_erase_value() const; 39 | }; 40 | 41 | } // namespace mbed 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /mbed-client-pal/.mbedignore: -------------------------------------------------------------------------------- 1 | Docs/* 2 | out/* 3 | -------------------------------------------------------------------------------- /mbed-client-pal/Configs/pal_config/.mbedignore: -------------------------------------------------------------------------------- 1 | Linux/* 2 | FreeRTOS/* 3 | -------------------------------------------------------------------------------- /mbed-client-pal/Configs/pal_config/mbedOS/mbedOS_SST.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2018-2019 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef PAL_MBEDOS_SST_CONFIGURATION_H_ 20 | #define PAL_MBEDOS_SST_CONFIGURATION_H_ 21 | 22 | /*! 23 | * \brief This file is only for legacy reasons. 24 | */ 25 | 26 | #include "mbedOS_default.h" 27 | 28 | #endif /* PAL_MBEDOS_SST_CONFIGURATION_H_ */ 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Configs/pal_ext_configs.cmake: -------------------------------------------------------------------------------- 1 | SET(PAL_BSP_DIR ${NEW_CMAKE_SOURCE_DIR}/mbed-client-pal/Configs/) 2 | SET(PAL_TLS_BSP_DIR ${PAL_BSP_DIR}/${TLS_LIBRARY}) 3 | SET(PAL_PLATFORM_BSP_DIR ${PAL_BSP_DIR}/pal_config) 4 | 5 | #choose the samll test suit of esfs - becasue the latge one does not fit with networking to image size 6 | add_definitions(-DESFS_INTERACTIVE_TEST) 7 | add_definitions(-DSOTP_LOG=0) 8 | 9 | # these are used & required by the unit tests 10 | add_definitions(-DPAL_NET_DNS_SUPPORT) 11 | add_definitions(-DPAL_DNS_API_VERSION=1) 12 | 13 | if (${TLS_LIBRARY} MATCHES mbedTLS) 14 | # PAL specific configurations for mbedTLS 15 | if (NOT (${OS_BRAND} MATCHES "FreeRTOS")) 16 | add_definitions(-DMBEDTLS_CONFIG_FILE="\\"${PAL_TLS_BSP_DIR}/mbedTLSConfig_${OS_BRAND}.h"\\") 17 | else() 18 | add_definitions(-DMBEDTLS_CONFIG_FILE=\"${PAL_TLS_BSP_DIR}/mbedTLSConfig_${OS_BRAND}.h\") 19 | endif() 20 | message("PAL_TLS_BSP_DIR ${PAL_TLS_BSP_DIR}/pal_${OS_BRAND}.h") 21 | endif() 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mbed-client-pal/Configs/pal_ext_configs_PSK.cmake: -------------------------------------------------------------------------------- 1 | SET(PAL_BSP_DIR ${NEW_CMAKE_SOURCE_DIR}/mbed-client-pal/Configs/) 2 | SET(PAL_TLS_BSP_DIR ${PAL_BSP_DIR}/${TLS_LIBRARY}) 3 | SET(PAL_PLATFORM_BSP_DIR ${PAL_BSP_DIR}/pal_config) 4 | 5 | #choose the samll test suit of esfs - becasue the latge one does not fit with networking to image size 6 | add_definitions(-DESFS_INTERACTIVE_TEST) 7 | add_definitions(-DSOTP_LOG=0) 8 | 9 | if (${TLS_LIBRARY} MATCHES mbedTLS) 10 | # PAL specific configurations for mbedTLS 11 | if (NOT (${OS_BRAND} MATCHES "FreeRTOS")) 12 | add_definitions(-DMBEDTLS_CONFIG_FILE="\\"${PAL_TLS_BSP_DIR}/mbedTLSConfig_${OS_BRAND}_PSK.h"\\") 13 | else() 14 | add_definitions(-DMBEDTLS_CONFIG_FILE=\"${PAL_TLS_BSP_DIR}/mbedTLSConfig_${OS_BRAND}_PSK.h\") 15 | endif() 16 | message("PAL_TLS_BSP_DIR ${PAL_TLS_BSP_DIR}/pal_${OS_BRAND}.h") 17 | endif() 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /mbed-client-pal/DOXYGEN_FRONTPAGE.md: -------------------------------------------------------------------------------- 1 | Device Management Platform Abstraction Layer (PAL) 2 | ================= 3 | 4 | The Device Management Platform Abstraction Layer (PAL) connects client with the underlying platform. 5 | 6 | The main purpose of PAL is to enable easy and fast client services portability, allowing them to operate over wide range of ARM Cortex-based platforms running different operating systems with various libraries (networking, for example). 7 | 8 | PAL has two layers: 9 | 10 | - **Service API layer**: provides the PAL APIs for client code. The APIs are identical for all platforms and operating systems, and you should not modify them. 11 | - **Platform API layer**: provides a standard set of baseline requirements for the platform. To allow client to run on the target platform, you need to implement all requirements when you port. The implementation may be different for each target operating system or library; PAL provides reference implementations for several operating systems, including Mbed OS. 12 | 13 | See the [Files](files.html) section to review documentation for specific APIs. 14 | 15 | See the [full documentation and porting guide for PAL](https://cloud.mbed.com/docs/current/porting/index.html). 16 | 17 | -------------------------------------------------------------------------------- /mbed-client-pal/LICENSE: -------------------------------------------------------------------------------- 1 | Unless specifically indicated otherwise in a file, files are licensed 2 | under the Apache 2.0 license, as can be found in: apache-2.0.txt -------------------------------------------------------------------------------- /mbed-client-pal/Source/PAL-Impl/Modules/DRBG/pal_drbg.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2020 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | #if !defined(MBED_CONF_MBED_CLOUD_CLIENT_EXTERNAL_SST_SUPPORT) || defined(MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT) 17 | #include "pal.h" 18 | #include "pal_plat_drbg.h" 19 | 20 | 21 | palStatus_t pal_osRandomBuffer(uint8_t *randomBuf, size_t bufSizeBytes) 22 | { 23 | return pal_plat_osRandomBuffer_blocking(randomBuf, bufSizeBytes); 24 | } 25 | 26 | // a simple wrapper, no need to keep it on platform layer. This uses also direct 27 | // call to pal_plat_osRandomBuffer() in order to let linker to remove as many unused 28 | // as possible. 29 | palStatus_t pal_osRandom32bit(uint32_t *randomInt) 30 | { 31 | return pal_plat_osRandomBuffer_blocking((uint8_t*)randomInt, sizeof(uint32_t)); 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/PAL-Impl/Modules/Entropy/pal_entropy.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "pal.h" 18 | #include "pal_plat_entropy.h" 19 | #include "mbed_trace.h" 20 | 21 | #define TRACE_GROUP "PAL" 22 | 23 | palStatus_t pal_osEntropyInject(const uint8_t *entropyBuf, size_t bufSizeBytes) 24 | { 25 | PAL_VALIDATE_ARGUMENTS(NULL == entropyBuf); 26 | if (PAL_PLAT_MAX_ENTROPY_SIZE < bufSizeBytes) 27 | { 28 | return PAL_ERR_ENTROPY_TOO_LARGE; 29 | } 30 | return pal_plat_osEntropyInject(entropyBuf, bufSizeBytes); 31 | } 32 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Platform-API/pal_plat_drbg_noise.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #ifndef _PAL_PLAT_NOISE_H 18 | #define _PAL_PLAT_NOISE_H 19 | #include "pal.h" 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | // This file is internal and should not be ported by the user! 27 | 28 | palStatus_t pal_plat_noiseInit(void); 29 | palStatus_t pal_plat_noiseDestroy(void); 30 | palStatus_t pal_plat_noiseWriteBuffer(int32_t* buffer, uint16_t lenBits, uint16_t* bitsWritten); 31 | palStatus_t pal_plat_noiseCreateThread(void); 32 | palStatus_t pal_plat_generateDrbgWithNoiseAttempt(palCtrDrbgCtxHandle_t drbgContext, uint8_t* outBuffer, bool partial, size_t numBytesToGenerate); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif // _PAL_PLAT_NOISE_H 39 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/Generic/ROT/External/pal_plat_rot_hw.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2018 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | 18 | #include "pal.h" 19 | #include "pal_plat_rot.h" 20 | 21 | #if (PAL_USE_HW_ROT) 22 | // Application provides its own implementation via pal_plat_osGetRoTFromHW() function. 23 | palStatus_t pal_plat_osGetRoT(uint8_t * key, size_t keyLenBytes) 24 | { 25 | return pal_plat_osGetRoTFromHW(key, keyLenBytes); 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/Generic/ROT/PSA/pal_plat_rot_psa.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2019 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | /* for PSA Linux ROT is not yet supported */ 20 | 21 | #if defined MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT && !defined MBED_CONF_MBED_CLOUD_CLIENT_EXTERNAL_SST_SUPPORT 22 | #include "pal.h" 23 | 24 | #if (PAL_USE_HW_ROT == 0) 25 | 26 | palStatus_t pal_plat_osGetRoT(uint8_t * key, size_t keyLenBytes) 27 | { 28 | return PAL_ERR_ITEM_NOT_EXIST; 29 | } 30 | 31 | palStatus_t pal_plat_osSetRoT(uint8_t * key, size_t keyLenBytes) 32 | { 33 | return PAL_ERR_ITEM_NOT_EXIST; 34 | } 35 | 36 | #endif // (PAL_USE_HW_ROT == 0) 37 | #endif // defined MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT && !defined MBED_CONF_MBED_CLOUD_CLIENT_EXTERNAL_SST_SUPPORT -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/.mbedignore: -------------------------------------------------------------------------------- 1 | Linux/* 2 | FreeRTOS/* 3 | SXOS/* 4 | NXP/* 5 | RTX_MW/* 6 | Renesas_EK_RA6M3/* 7 | nanosimulator/* 8 | Renesas_RX65N-CK/* 9 | ZephyrOS/* 10 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_OpenWRT_Generic/pal_plat_OpenWRT_Generic.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2019 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | #include "pal_plat_entropy.h" 17 | 18 | #define TRACE_GROUP "PAL" 19 | 20 | palStatus_t pal_plat_getRandomBufferFromHW(uint8_t *randomBuf, size_t bufSizeBytes, size_t* actualRandomSizeBytes) 21 | { 22 | return pal_plat_osEntropyRead("/dev/hwrng", randomBuf, bufSizeBytes, actualRandomSizeBytes); 23 | } 24 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_RaspberryPi/pal_plat_RaspberryPi.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2020 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | #include "pal_plat_entropy.h" 17 | 18 | #define TRACE_GROUP "PAL" 19 | 20 | palStatus_t pal_plat_getRandomBufferFromHW(uint8_t *randomBuf, size_t bufSizeBytes, size_t* actualRandomSizeBytes) 21 | { 22 | return pal_plat_osEntropyRead("/dev/hwrng", randomBuf, bufSizeBytes, actualRandomSizeBytes); 23 | } 24 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_Yocto_Generic/pal_plat_Yocto_Generic.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2019 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | #include "pal_plat_entropy.h" 17 | 18 | #define TRACE_GROUP "PAL" 19 | 20 | palStatus_t pal_plat_getRandomBufferFromHW(uint8_t *randomBuf, size_t bufSizeBytes, size_t* actualRandomSizeBytes) 21 | { 22 | return pal_plat_osEntropyRead("/dev/hwrng", randomBuf, bufSizeBytes, actualRandomSizeBytes); 23 | } 24 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_x86_x64/pal_plat_x86_x64.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2019 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | #include "pal_plat_entropy.h" 17 | 18 | #define TRACE_GROUP "PAL" 19 | 20 | palStatus_t pal_plat_getRandomBufferFromHW(uint8_t *randomBuf, size_t bufSizeBytes, size_t* actualRandomSizeBytes) 21 | { 22 | return pal_plat_osEntropyRead("/dev/random", randomBuf, bufSizeBytes, actualRandomSizeBytes); 23 | } 24 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/NXP/Board_Specific/TARGET_LPC54608/pal_plat_LPC54608.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2020 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "LPC54608.h" 18 | 19 | int32_t pal_plat_osAtomicIncrement(int32_t* valuePtr, int32_t increment) 20 | { 21 | int32_t res; 22 | res = __LDREXW(valuePtr) + increment; 23 | do { 24 | } while (__STREXW(res, valuePtr)); 25 | return (res); 26 | } 27 | 28 | void pal_plat_osReboot() 29 | { 30 | __NVIC_SystemReset(); 31 | } 32 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/NXP/Board_Specific/TARGET_LPC54628/pal_plat_LPC54628.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2020 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "LPC54628.h" 18 | 19 | int32_t pal_plat_osAtomicIncrement(int32_t* valuePtr, int32_t increment) 20 | { 21 | int32_t res; 22 | res = __LDREXW(valuePtr) + increment; 23 | do { 24 | } while (__STREXW(res, valuePtr)); 25 | return (res); 26 | } 27 | 28 | void pal_plat_osReboot() 29 | { 30 | __NVIC_SystemReset(); 31 | } 32 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/NXP/Board_Specific/TARGET_MIMXRT1060/pal_plat_MIMXRT1060.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2020 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "MIMXRT1062.h" 18 | 19 | int32_t pal_plat_osAtomicIncrement(int32_t* valuePtr, int32_t increment) 20 | { 21 | int32_t res; 22 | res = __LDREXW(valuePtr) + increment; 23 | do { 24 | } while (__STREXW(res, valuePtr)); 25 | return (res); 26 | } 27 | 28 | void pal_plat_osReboot() 29 | { 30 | __NVIC_SystemReset(); 31 | } 32 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Renesas_EK_RA6M3/Board_Specific/TARGET_EK-RA6M3/board_cfg.h: -------------------------------------------------------------------------------- 1 | /* generated configuration header file - do not edit */ 2 | #ifndef BOARD_CFG_H_ 3 | #define BOARD_CFG_H_ 4 | #include "../../../ra/board/ra6m3_ek/board.h" 5 | #endif /* BOARD_CFG_H_ */ 6 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Renesas_EK_RA6M3/Board_Specific/TARGET_EK-RA6M3/bsp_mcu_device_cfg.h: -------------------------------------------------------------------------------- 1 | /* generated configuration header file - do not edit */ 2 | #ifndef BSP_MCU_DEVICE_CFG_H_ 3 | #define BSP_MCU_DEVICE_CFG_H_ 4 | #define BSP_CFG_MCU_PART_SERIES (6) 5 | #endif /* BSP_MCU_DEVICE_CFG_H_ */ 6 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Renesas_EK_RA6M3/Board_Specific/TARGET_EK-RA6M3/bsp_mcu_device_pn_cfg.h: -------------------------------------------------------------------------------- 1 | /* generated configuration header file - do not edit */ 2 | #ifndef BSP_MCU_DEVICE_PN_CFG_H_ 3 | #define BSP_MCU_DEVICE_PN_CFG_H_ 4 | #define BSP_MCU_R7FA6M3AH3CFC 5 | #define BSP_ROM_SIZE_BYTES (2097152) 6 | #define BSP_RAM_SIZE_BYTES (655360) 7 | #define BSP_DATA_FLASH_SIZE_BYTES (65536) 8 | #define BSP_PACKAGE_LQFP 9 | #define BSP_PACKAGE_PINS (176) 10 | #endif /* BSP_MCU_DEVICE_PN_CFG_H_ */ 11 | -------------------------------------------------------------------------------- /mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/ZephyrOS/Board_Specific/TARGET_Generic/pal_plat_Generic.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PelionIoT/mbed-cloud-client/5c654f9e54ad360c55d392154c1a4efd96424e63/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/ZephyrOS/Board_Specific/TARGET_Generic/pal_plat_Generic.c -------------------------------------------------------------------------------- /mbed-client-pal/Test/.mbedignore: -------------------------------------------------------------------------------- 1 | Unity/examples/* 2 | Unity/test/* 3 | Unity/extras/fixture/test/* 4 | Unity/ 5 | PAL_Modules/* 6 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/DRBG/pal_drbg_test_runner.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "unity.h" 18 | #include "unity_fixture.h" 19 | #include "pal.h" 20 | 21 | TEST_GROUP_RUNNER(pal_drbg) 22 | { 23 | #ifndef PAL_SKIP_TEST_MODULE_DRBG 24 | RUN_TEST_CASE(pal_drbg, RandomUnityTest); 25 | RUN_TEST_CASE(pal_drbg, loopRandomBigNumber); 26 | RUN_TEST_CASE(pal_drbg, pal_noise); 27 | #endif 28 | } 29 | 30 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/Entropy/pal_entropy_test_runner.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2019 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #include "unity.h" 20 | #include "unity_fixture.h" 21 | #include "pal.h" 22 | 23 | TEST_GROUP_RUNNER(pal_entropy) 24 | { 25 | #ifndef PAL_SKIP_TEST_MODULE_ENTROPY 26 | RUN_TEST_CASE(pal_entropy, inject); 27 | #endif 28 | } 29 | 30 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/Networking/pal_socket_test_address.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | #ifndef __PAL_SOCKET_TEST_ADDRESS_H__ 17 | #define __PAL_SOCKET_TEST_ADDRESS_H__ 18 | 19 | // test server contact details, typically overridden on CI and/or local development setup 20 | 21 | // address of a server which is running the KeepAliveServer/KeepAliveServer.py 22 | #ifndef PAL_TEST_KEEPALIVE_SERVER_ADDRESS 23 | #define PAL_TEST_KEEPALIVE_SERVER_ADDRESS "127.0.0.1" 24 | #endif 25 | 26 | // listening port of the server 27 | #ifndef PAL_TEST_SERVER_KEEPALIVE_PORT 28 | #define PAL_TEST_SERVER_KEEPALIVE_PORT 5533 29 | #endif 30 | 31 | // magic number of keepalive messages (or TCP ACKs..) which serves as pivot on deciding if 32 | // the keepalive did work or not. 33 | #ifndef PAL_TEST_KEEPALIVE_NUM_OF_ACK 34 | #define PAL_TEST_KEEPALIVE_NUM_OF_ACK 4 35 | #endif 36 | 37 | #endif // !__PAL_SOCKET_TEST_ADDRESS_H__ 38 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/ROT/pal_rot_test_runner.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2018 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "unity.h" 18 | #include "unity_fixture.h" 19 | #include "pal.h" 20 | 21 | TEST_GROUP_RUNNER(pal_rot) 22 | { 23 | #ifndef PAL_SKIP_TEST_MODULE_ROT 24 | RUN_TEST_CASE(pal_rot, GetDeviceKeyTest_CMAC); 25 | RUN_TEST_CASE(pal_rot, GetDeviceKeyTest_HMAC_SHA256); 26 | RUN_TEST_CASE(pal_rot, GetRoTKeyTest); 27 | RUN_TEST_CASE(pal_rot, SeTRoTKeyTest); 28 | #endif 29 | } 30 | 31 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/SOTP/pal_SOTP_test_runner.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "unity.h" 18 | #include "unity_fixture.h" 19 | #include "test_runners.h" 20 | 21 | #define TRACE_GROUP "PAL" 22 | 23 | extern palTestsStatusData_t palTestStatus; 24 | 25 | TEST_GROUP_RUNNER(pal_SOTP) 26 | { 27 | #ifndef PAL_SKIP_TEST_MODULE_SOTP 28 | switch (palTestStatus.test) 29 | { 30 | case -1: 31 | case PAL_TEST_SOTP_TEST_SW_HW_ROT: 32 | RUN_TEST_CASE(pal_SOTP, SW_HW_RoT); 33 | case PAL_TEST_SOTP_TEST_TIME_INIT: 34 | RUN_TEST_CASE(pal_SOTP, timeInit); 35 | case PAL_TEST_SOTP_TEST_RANDOM: 36 | RUN_TEST_CASE(pal_SOTP, random); 37 | break; 38 | default: 39 | PAL_PRINTF("This should not happen\r\n"); 40 | } 41 | #endif 42 | } 43 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/Sanity/pal_sanity_test.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | 18 | #include "unity.h" 19 | #include "unity_fixture.h" 20 | #include "pal.h" 21 | 22 | #define TRACE_GROUP "PAL" 23 | 24 | TEST_GROUP(pal_sanity); 25 | 26 | TEST_SETUP(pal_sanity) 27 | { 28 | 29 | } 30 | 31 | TEST_TEAR_DOWN(pal_sanity) 32 | { 33 | 34 | } 35 | 36 | 37 | TEST(pal_sanity, bringupPassed) 38 | { 39 | PAL_LOG_INFO("device bringup passed\r\n"); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/Sanity/pal_sanity_test_runner.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "unity.h" 18 | #include "unity_fixture.h" 19 | #include "pal.h" 20 | 21 | 22 | TEST_GROUP_RUNNER(pal_sanity) 23 | { 24 | RUN_TEST_CASE(pal_sanity, bringupPassed); 25 | } 26 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/Storage/pal_internalFlash_test_runner.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "unity.h" 18 | #include "unity_fixture.h" 19 | #include "test_runners.h" 20 | 21 | 22 | TEST_GROUP_RUNNER(pal_internalFlash) 23 | { 24 | #ifndef PAL_SKIP_TEST_MODULE_INTERNALFLASH 25 | RUN_TEST_CASE(pal_internalFlash, BasicTest); 26 | RUN_TEST_CASE(pal_internalFlash, NegativeTest); 27 | #endif 28 | } 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/Time/pal_time_test_runner.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2018 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "unity.h" 18 | #include "unity_fixture.h" 19 | #include "pal.h" 20 | 21 | TEST_GROUP_RUNNER(pal_time) 22 | { 23 | #ifndef PAL_SKIP_TEST_MODULE_TIME 24 | RUN_TEST_CASE(pal_time, RealTimeClockTest1); 25 | RUN_TEST_CASE(pal_time, OsWeakSetTime_Forward); 26 | RUN_TEST_CASE(pal_time, OsWeakSetTime_Backward); 27 | RUN_TEST_CASE(pal_time, OsWeakSetTime_minimalStoredLag); 28 | RUN_TEST_CASE(pal_time, OsStrongSetTime); 29 | #endif 30 | } 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/PAL_Modules/Update/pal_update_test_runner.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "unity.h" 18 | #include "unity_fixture.h" 19 | #include "pal.h" 20 | 21 | 22 | // PAL Update API tests 23 | TEST_GROUP_RUNNER(pal_update) 24 | { 25 | #ifndef PAL_SKIP_TEST_MODULE_UPDATE 26 | RUN_TEST_CASE(pal_update, pal_update_writeSmallChunk_5b); 27 | RUN_TEST_CASE(pal_update, pal_update_writeUnaligned_1001b); 28 | RUN_TEST_CASE(pal_update, pal_update_1k); 29 | RUN_TEST_CASE(pal_update, pal_update_2k); 30 | RUN_TEST_CASE(pal_update, pal_update_4k); 31 | RUN_TEST_CASE(pal_update, pal_update_8k); 32 | RUN_TEST_CASE(pal_update, pal_update_16k); 33 | RUN_TEST_CASE(pal_update, pal_update_Read); 34 | RUN_TEST_CASE(pal_update, pal_update_stressTest); 35 | RUN_TEST_CASE(pal_update, pal_update_4k_write_1k_4_times); 36 | #endif 37 | } 38 | 39 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Sotp/security/pal_security_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | #include "test_runners.h" 17 | 18 | int main(int argc, char * argv[]) 19 | { 20 | (void)argc; 21 | (void)argv; 22 | 23 | return palSOTPTestMain(); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/DRBG/pal_drbg_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palDRBGTestMain(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/Entropy/pal_entropy_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016-2019 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | // the tests may actually assert on failure, so they may not return anything useful status 25 | // and a nonzero return value is typically a sign of platform initialization failure 26 | return palEntropyTestMain(); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/FileSystem/pal_FileSystem_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palFileSystemTestMain(); 25 | } 26 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/Full_pal/pal_all_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palAllTestMain(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/Networking/pal_Networking_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palNetworkTestMain(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/ROT/pal_rot_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | // the tests may actually assert on failure, so they may not return anything useful status 25 | // and a nonzero return value is typically a sign of platform initialization failure 26 | return palROTTestMain(); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/RTOS/pal_rtos_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | // the tests may actually assert on failure, so they may not return anything useful status 25 | // and a nonzero return value is typically a sign of platform initialization failure 26 | return palRTOSTestMain(); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/Sanity/pal_sanity_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | //create a public wapper to this & reduce this to one line 20 | int main(int argc, char * argv[]) 21 | { 22 | (void)argc; 23 | (void)argv; 24 | 25 | // actually the tests themselves (which are a NOP) do no need any platform, 26 | // but the tracing and other do. 27 | return palSanityTestMain(); 28 | } 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/Storage/pal_Storage_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palStorageTestMain(); 25 | } 26 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/TLS/pal_TLS_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palTLSTestMain(); 25 | } 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/Time/pal_time_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2018 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | // the tests may actually assert on failure, so they may not return anything useful status 25 | // and a nonzero return value is typically a sign of platform initialization failure 26 | return palTimeTestMain(); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/Update/pal_Update_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palUpdateTestMain(); 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/Unitest/a_pal_reformat/pal_a_pal_reformat_test_main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016, 2017 ARM Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #include "test_runners.h" 18 | 19 | int main(int argc, char * argv[]) 20 | { 21 | (void)argc; 22 | (void)argv; 23 | 24 | return palReformatTestMain(); 25 | } 26 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/TESTS/pal_make.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import subprocess 3 | import re 4 | 5 | pal_warn = re.compile("Warning.*pal") 6 | pal_dont_treat_as_warn = re.compile("Warning.*PAL_INSECURE") 7 | 8 | proc = subprocess.Popen(sys.argv[1].split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 9 | 10 | for line in proc.stdout: 11 | print line 12 | if len(pal_warn.findall(line)) > 0: 13 | if not len(pal_dont_treat_as_warn.findall(line)) > 0: 14 | raise Exception("No Warnings Allowed in Pal") 15 | proc.wait() 16 | print "mbed compile returned {}".format(proc.returncode) 17 | if not proc.returncode == 0: 18 | raise Exception("mbed compile failed") 19 | 20 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/.mbedignore: -------------------------------------------------------------------------------- 1 | examples/* 2 | test/* 3 | extras/fixture/test/* 4 | 5 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/eclipse/error_parsers.txt: -------------------------------------------------------------------------------- 1 | Eclipse error parsers 2 | ===================== 3 | 4 | These are a godsend for extracting & quickly navigating to 5 | warnings & error messages from console output. Unforunately 6 | I don't know how to write an Eclipse plugin so you'll have 7 | to add them manually. 8 | 9 | To add a console parser to Eclipse, go to Window --> Preferences 10 | --> C/C++ --> Build --> Settings. Click on the 'Error Parsers' 11 | tab and then click the 'Add...' button. See the table below for 12 | the parser fields to add. 13 | 14 | Eclipse will only parse the console output during a build, so 15 | running your unit tests must be part of your build process. 16 | Either add this to your make/rakefile, or add it as a post- 17 | build step in your Eclipse project settings. 18 | 19 | 20 | Unity unit test error parsers 21 | ----------------------------- 22 | Severity Pattern File Line Description 23 | ------------------------------------------------------------------------------- 24 | Error (\.+)(.*?):(\d+):(.*?):FAIL: (.*) $2 $3 $5 25 | Warning (\.+)(.*?):(\d+):(.*?):IGNORE: (.*) $2 $3 $5 26 | Warning (\.+)(.*?):(\d+):(.*?):IGNORE\s*$ $2 $3 Ignored test 27 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/fixture/rakefile.rb: -------------------------------------------------------------------------------- 1 | # ========================================== 2 | # Unity Project - A Test Framework for C 3 | # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 4 | # [Released under MIT License. Please refer to license.txt for details] 5 | # ========================================== 6 | 7 | HERE = File.expand_path(File.dirname(__FILE__)) + '/' 8 | 9 | require 'rake' 10 | require 'rake/clean' 11 | require 'rake/testtask' 12 | require HERE + 'rakefile_helper' 13 | 14 | TEMP_DIRS = [ 15 | File.join(HERE, 'build') 16 | ] 17 | 18 | TEMP_DIRS.each do |dir| 19 | directory(dir) 20 | CLOBBER.include(dir) 21 | end 22 | 23 | task :prepare_for_tests => TEMP_DIRS 24 | 25 | include RakefileHelpers 26 | 27 | # Load default configuration, for now 28 | DEFAULT_CONFIG_FILE = 'gcc_auto_stdint.yml' 29 | configure_toolchain(DEFAULT_CONFIG_FILE) 30 | 31 | task :unit => [:prepare_for_tests] do 32 | run_tests 33 | end 34 | 35 | desc "Build and test Unity Framework" 36 | task :all => [:clean, :unit] 37 | task :default => [:clobber, :all] 38 | task :ci => [:no_color, :default] 39 | task :cruise => [:no_color, :default] 40 | 41 | desc "Load configuration" 42 | task :config, :config_file do |t, args| 43 | configure_toolchain(args[:config_file]) 44 | end 45 | 46 | task :no_color do 47 | $colour_output = false 48 | end 49 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/fixture/readme.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | 7 | This Framework is an optional add-on to Unity. By including unity_framework.h in place of unity.h, 8 | you may now work with Unity in a manner similar to CppUTest. This framework adds the concepts of 9 | test groups and gives finer control of your tests over the command line. -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/fixture/src/unity_fixture_internals.h: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | #ifndef UNITY_FIXTURE_INTERNALS_H_ 9 | #define UNITY_FIXTURE_INTERNALS_H_ 10 | 11 | struct _UnityFixture 12 | { 13 | int Verbose; 14 | unsigned int RepeatCount; 15 | const char* NameFilter; 16 | const char* GroupFilter; 17 | }; 18 | extern struct _UnityFixture UnityFixture; 19 | 20 | typedef void unityfunction(void); 21 | void UnityTestRunner(unityfunction* setup, 22 | unityfunction* body, 23 | unityfunction* teardown, 24 | const char* printableName, 25 | const char* group, 26 | const char* name, 27 | const char* file, unsigned int line); 28 | 29 | void UnityIgnoreTest(const char* printableName, const char* group, const char* name); 30 | void UnityMalloc_StartTest(void); 31 | void UnityMalloc_EndTest(void); 32 | int UnityGetCommandLineOptions(int argc, const char* argv[]); 33 | void UnityConcludeFixtureTest(void); 34 | 35 | void UnityPointer_Set(void** ptr, void* newValue, UNITY_LINE_TYPE line); 36 | void UnityPointer_UndoAllSets(void); 37 | void UnityPointer_Init(void); 38 | 39 | #endif /* UNITY_FIXTURE_INTERNALS_H_ */ 40 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/fixture/test/main/AllTests.c: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | #include "unity_fixture.h" 9 | 10 | static void runAllTests(void) 11 | { 12 | RUN_TEST_GROUP(UnityFixture); 13 | RUN_TEST_GROUP(UnityCommandOptions); 14 | RUN_TEST_GROUP(LeakDetection); 15 | RUN_TEST_GROUP(InternalMalloc); 16 | } 17 | 18 | int main(int argc, const char* argv[]) 19 | { 20 | return UnityMain(argc, argv, runAllTests); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/fixture/test/template_fixture_tests.c: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | #include "unity_fixture.h" 9 | 10 | static int data = -1; 11 | 12 | TEST_GROUP(mygroup); 13 | 14 | TEST_SETUP(mygroup) 15 | { 16 | data = 0; 17 | } 18 | 19 | TEST_TEAR_DOWN(mygroup) 20 | { 21 | data = -1; 22 | } 23 | 24 | TEST(mygroup, test1) 25 | { 26 | TEST_ASSERT_EQUAL_INT(0, data); 27 | } 28 | 29 | TEST(mygroup, test2) 30 | { 31 | TEST_ASSERT_EQUAL_INT(0, data); 32 | data = 5; 33 | } 34 | 35 | TEST(mygroup, test3) 36 | { 37 | data = 7; 38 | TEST_ASSERT_EQUAL_INT(7, data); 39 | } 40 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/fixture/test/unity_output_Spy.c: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | 9 | #include "unity_output_Spy.h" 10 | #include "unity_fixture.h" 11 | 12 | #include 13 | #include 14 | 15 | static int size; 16 | static int count; 17 | static char* buffer; 18 | static int spy_enable; 19 | 20 | void UnityOutputCharSpy_Create(int s) 21 | { 22 | size = (s > 0) ? s : 0; 23 | count = 0; 24 | spy_enable = 0; 25 | buffer = malloc((size_t)size); 26 | TEST_ASSERT_NOT_NULL_MESSAGE(buffer, "Internal malloc failed in Spy Create():" __FILE__); 27 | memset(buffer, 0, (size_t)size); 28 | } 29 | 30 | void UnityOutputCharSpy_Destroy(void) 31 | { 32 | size = 0; 33 | free(buffer); 34 | } 35 | 36 | void UnityOutputCharSpy_OutputChar(int c) 37 | { 38 | if (spy_enable) 39 | { 40 | if (count < (size-1)) 41 | buffer[count++] = (char)c; 42 | } 43 | else 44 | { 45 | putchar(c); 46 | } 47 | } 48 | 49 | const char * UnityOutputCharSpy_Get(void) 50 | { 51 | return buffer; 52 | } 53 | 54 | void UnityOutputCharSpy_Enable(int enable) 55 | { 56 | spy_enable = enable; 57 | } 58 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/extras/fixture/test/unity_output_Spy.h: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | #ifndef D_unity_output_Spy_H 9 | #define D_unity_output_Spy_H 10 | 11 | void UnityOutputCharSpy_Create(int s); 12 | void UnityOutputCharSpy_Destroy(void); 13 | void UnityOutputCharSpy_OutputChar(int c); 14 | const char * UnityOutputCharSpy_Get(void); 15 | void UnityOutputCharSpy_Enable(int enable); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/release/build.info: -------------------------------------------------------------------------------- 1 | 119 2 | 3 | -------------------------------------------------------------------------------- /mbed-client-pal/Test/Unity/release/version.info: -------------------------------------------------------------------------------- 1 | 2.3.2 2 | 3 | -------------------------------------------------------------------------------- /mbed-client-pal/Utils/memoryProfiler/.mbedignore: -------------------------------------------------------------------------------- 1 | Other/* -------------------------------------------------------------------------------- /mbed-client-pal/Utils/stackUsage/.mbedignore: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /mbed-client-pal/Utils/stackUsage/TestSuite/TargetFunctions.txt: -------------------------------------------------------------------------------- 1 | # TargetFunctions.txt contains the list of the functions' calls 2 | # User want to test their Stack Usage. 3 | # 4 | # User MUST supply include files, variables declarations, test function name and the target function call 5 | # for example: 6 | # foo.h $ StackUsage_foo $ int a = 5; int b = 6; int c = 0 $ c = foo(a, a+b); 7 | # between each inputs (includes and variables for example) the syntax requires $ separation. 8 | # "stdio.h" and "stdlib.h" are already included in the generated files. 9 | 10 | #foo.h $ StackUsage_foo $ int a = 5; int b = 6; int c = 0; $ c = foo(a, a+b); 11 | $ StackUsage_memcmp $ char *mem1 = "blablabla"; int res = 0; $ res = memcmp(mem1, mem1, 8); 12 | #moo.h $ StackUsage_moo $ int a = 2; char b[2] = {'a','b'}; $ moo(a, b); 13 | #sum.h $ StackUsage_sum $ int res = 0; $ res = sum(88, 90); 14 | $ StackUsage_printf $ $ printf("I'm a test call\n"); 15 | $ StackUsage_memcpy $ char* a = "PALTest"; char b[20] = {0}; $ memcpy(b, a, 8); 16 | 17 | 18 | List Finished! 19 | -------------------------------------------------------------------------------- /mbed-client-pal/Utils/stackUsage/TestSuite/Template/template.c: -------------------------------------------------------------------------------- 1 | int stackUsage_Template() 2 | { 3 | char* stackArr = NULL; 4 | int i = 0; 5 | int stackUsageCounter = 0; 6 | bool detectChange = false; 7 | char borderArr[BORDER_ARRAY_SIZE]; //Used to mark the border of a stack frame. 8 | for(i=0; i < BORDER_ARRAY_SIZE; ++i) 9 | { 10 | borderArr[i] = INIT_VALUE; 11 | } 12 | stackArr = paintStack(); 13 | Template_Func(); 14 | // The size of the second array is: 3*STACK_UNIT_SIZE. 15 | // so we need to run over the array to detect the first changed byte. 16 | // once we detect this byte, we can calculate the maximum stack usage. 17 | for (i = 0 ; i < STACK_UNIT_NUM*STACK_UNIT_SIZE && !detectChange; ++i) 18 | { 19 | if(stackArr[i] != ((memPattern[i%PATTERN_SIZE]) ^ (i%MAX_CHAR_VALUE))) 20 | { 21 | detectChange = true; 22 | } 23 | } 24 | stackUsageCounter = STACK_UNIT_NUM*STACK_UNIT_SIZE - i; 25 | stackArr = stackArr + STACK_UNIT_NUM * STACK_UNIT_SIZE; 26 | for (; stackArr != borderArr; ++stackArr) 27 | { 28 | ++stackUsageCounter; 29 | } 30 | return stackUsageCounter; 31 | } 32 | -------------------------------------------------------------------------------- /mbed-client-randlib/.mbedignore: -------------------------------------------------------------------------------- 1 | linux/* 2 | test/* 3 | -------------------------------------------------------------------------------- /mbed-client-randlib/LICENSE: -------------------------------------------------------------------------------- 1 | Unless specifically indicated otherwise in a file, files are licensed 2 | under the Apache 2.0 license, as can be found in: apache-2.0.txt -------------------------------------------------------------------------------- /mbed-client-randlib/mbed-client-randlib/platform/arm_hal_random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2015 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ARM_HAL_RANDOM_H_ 18 | #define ARM_HAL_RANDOM_H_ 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | /** 23 | * \brief This function performs Random number driver init. 24 | */ 25 | extern void arm_random_module_init(void); 26 | /** 27 | * \brief Get random library seed value. 28 | * 29 | * This function should return as random a value as possible, using 30 | * hardware sources. Repeated calls should return different values if 31 | * at all possible. 32 | */ 33 | extern uint32_t arm_random_seed_get(void); 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | #endif /* ARM_HAL_RANDOM_H_ */ 38 | -------------------------------------------------------------------------------- /mbed-client-randlib/mbed_lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mbed-client-randlib" 3 | } 4 | -------------------------------------------------------------------------------- /mbed-client/.mbedignore: -------------------------------------------------------------------------------- 1 | config/* 2 | docs/* 3 | doxygen/* 4 | test/* 5 | yotta_modules/* 6 | yotta_targets/* 7 | build/* 8 | test_modules/* 9 | 10 | -------------------------------------------------------------------------------- /mbed-client/DOXYGEN_FRONTPAGE.md: -------------------------------------------------------------------------------- 1 | ## Mbed Client API 2 | 3 | This is the Doxygen generated API documentation of Mbed Client. See the [Files](files.html) section to find the documentation about specific API. 4 | 5 | The Mbed Client high-level APIs allow Mbed OS developers to create applications with LwM2M features as described in the [Lightweight Machine to Machine Technical Specification](http://www.openmobilealliance.org/release/LightweightM2M/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf): 6 | 7 | These APIs make it possible to: 8 | 9 | - Manage devices. 10 | - Securely communicate with internet services over the industry standard TLS/DTLS. 11 | - Fully control the endpoint and application logic. 12 | 13 | The API is written in C++ to allow quick application development. 14 | -------------------------------------------------------------------------------- /mbed-client/mbed-client-c/.mbedignore: -------------------------------------------------------------------------------- 1 | test/* 2 | unittest/* 3 | -------------------------------------------------------------------------------- /mbed-client/mbed-client-c/LICENSE: -------------------------------------------------------------------------------- 1 | Unless specifically indicated otherwise in a file, files are licensed 2 | under the Apache 2.0 license, as can be found in: apache-2.0.txt -------------------------------------------------------------------------------- /mbed-client/mbed-client-c/README.txt: -------------------------------------------------------------------------------- 1 | The mbed Device C Client Library provides a simple and efficient way to create mbed Device Client in 2 | C. 3 | 4 | Applications not using mbed-coap via mbedOS should add mbed-coap library either via mbed-coap.lib or via other 5 | applicable means. 6 | -------------------------------------------------------------------------------- /mbed-client/mbed-client-c/nsdl-c/sn_nsdl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2015 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * \file sn_nsdl.h 19 | * 20 | * \brief libNsdl generic header file 21 | * 22 | */ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #ifndef SN_NSDL_H_ 29 | #define SN_NSDL_H_ 30 | 31 | #define SN_NSDL_SUCCESS 0 32 | #define SN_NSDL_FAILURE -1 33 | #define SN_NSDL_MEMORY_ALLOCATION_FAILED -2 34 | #define SN_NSDL_RESEND_QUEUE_FULL -4 // Mapped into CoAP level error code 35 | 36 | #include "sn_coap_header.h" 37 | 38 | #endif /* SN_NSDL_H_ */ 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /mbed-client/mbed-client-classic/.mbedignore: -------------------------------------------------------------------------------- 1 | test/* 2 | -------------------------------------------------------------------------------- /mbed-client/mbed-client-mbed-tls/.mbedignore: -------------------------------------------------------------------------------- 1 | test/* 2 | -------------------------------------------------------------------------------- /mbed-client/mbed-client-mbed-tls/LICENSE: -------------------------------------------------------------------------------- 1 | Unless specifically indicated otherwise in a file, files are licensed 2 | under the Apache 2.0 license, as can be found in: apache-2.0.txt -------------------------------------------------------------------------------- /mbed-client/mbed-client/m2mversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Pelion. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef M2MVERSION_H 18 | #define M2MVERSION_H 19 | 20 | /** PDMC_MAJOR_VERSION 21 | * Pelion Device Management Client major version 22 | */ 23 | #define PDMC_MAJOR_VERSION 4 24 | 25 | /** PDMC_MINOR_VERSION 26 | * Pelion Device Management Client minor version 27 | */ 28 | #define PDMC_MINOR_VERSION 13 29 | 30 | /** PDMC_PATCH_VERSION 31 | * Pelion Device Management Client patch version 32 | */ 33 | #define PDMC_PATCH_VERSION 2 34 | 35 | #endif // M2MVERSION_H 36 | -------------------------------------------------------------------------------- /mbed-client/mbed_lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mbed-client", 3 | "config": { 4 | "event-loop-size": 1024, 5 | "reconnection-count": 3, 6 | "reconnection-interval": null, 7 | "max-reconnect-timeout": null, 8 | "tcp-keepalive-interval": 100, 9 | "disable-bootstrap-feature": null, 10 | "coap-disable-obs-feature":null, 11 | "dtls_peer_max_timeout": null, 12 | "tls-max-retry": null, 13 | "sn-coap-max-blockwise-payload-size" : null, 14 | "sn-coap-duplication-max-msgs-count": 5, 15 | "sn-coap-max-incoming-message-size": null, 16 | "sn-coap-resending-queue-size-msgs": 5, 17 | "sn-coap-resending-queue-size-bytes": null, 18 | "sn-coap-blockwise-max-time-data-stored": null, 19 | "disable-interface-description": null, 20 | "disable-resource-type": null, 21 | "disable-delayed-response": null, 22 | "disable-block-message": null, 23 | "memory-optimized-api": null, 24 | "max-certificate-size": { 25 | "help": "Maximum size for buffer passing around certificate chain.", 26 | "default": 1024, 27 | "value": 1024 28 | }, 29 | "enable-observation-parameters" : 1, 30 | "bootstrap-piggybacked-response" : null, 31 | "enable-discovery" : 1, 32 | "dynamic-observable" : null, 33 | "dynamic-logging-buffer-size" : 0 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mbed-client/source/include/m2mnotificationhandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef M2MNOTIFICATIONHANDLER_H 18 | #define M2MNOTIFICATIONHANDLER_H 19 | 20 | #include "ns_types.h" 21 | #include "eventOS_event.h" 22 | 23 | class M2MNsdlInterface; 24 | class M2MNotificationHandler { 25 | 26 | public: 27 | M2MNotificationHandler(); 28 | 29 | ~M2MNotificationHandler(); 30 | 31 | void send_notification(M2MNsdlInterface *interface); 32 | 33 | private: 34 | void initialize_event(); 35 | 36 | private: 37 | static int8_t _tasklet_id; 38 | arm_event_storage_t _event; 39 | }; 40 | 41 | #endif // M2MNOTIFICATIONHANDLER_H 42 | -------------------------------------------------------------------------------- /mbed-client/source/include/nsdllinker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef NSDL_LINKER_H 17 | #define NSDL_LINKER_H 18 | 19 | #include 20 | #include "nsdl-c/sn_nsdl.h" 21 | #include "sn_coap_header.h" 22 | #include "sn_coap_protocol.h" 23 | #include "nsdl-c/sn_nsdl_lib.h" 24 | #include "ns_list.h" 25 | 26 | #endif // NSDL_LINKER_H 27 | -------------------------------------------------------------------------------- /mbed-coap/.mbedignore: -------------------------------------------------------------------------------- 1 | test/* 2 | test_modules/* 3 | unittest/* 4 | -------------------------------------------------------------------------------- /mbed-coap/README.txt: -------------------------------------------------------------------------------- 1 | CoAP C library - Builder and Parser for CoAP messages. 2 | -------------------------------------------------------------------------------- /mbed-trace/.astyleignore: -------------------------------------------------------------------------------- 1 | BUILD 2 | -------------------------------------------------------------------------------- /mbed-trace/.astylerc: -------------------------------------------------------------------------------- 1 | # Mbed OS code style definition file for astyle 2 | 3 | # Don't create backup files, let git handle it 4 | suffix=none 5 | 6 | # K&R style 7 | style=kr 8 | 9 | # 1 TBS addition to k&r, add braces to one liners 10 | # Use -j as it was changed in astyle from brackets to braces, this way it is compatible with older astyle versions 11 | -j 12 | 13 | # 4 spaces, convert tabs to spaces 14 | indent=spaces=4 15 | convert-tabs 16 | 17 | # Indent switches and cases 18 | indent-switches 19 | 20 | # Remove spaces in and around parentheses 21 | unpad-paren 22 | 23 | # Insert a space after if, while, for, and around operators 24 | pad-header 25 | pad-oper 26 | 27 | # Pointer/reference operators go next to the name (on the right) 28 | align-pointer=name 29 | align-reference=name 30 | 31 | # Attach { for classes and namespaces 32 | attach-namespaces 33 | attach-classes 34 | 35 | # Extend longer lines, define maximum 120 value. This results in aligned code, 36 | # otherwise the lines are broken and not consistent 37 | max-continuation-indent=120 38 | -------------------------------------------------------------------------------- /mbed-trace/.mbedignore: -------------------------------------------------------------------------------- 1 | build/* 2 | yotta_modules/* 3 | yotta_targets/* 4 | test/* 5 | example/* 6 | -------------------------------------------------------------------------------- /mbed-trace/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(CMakeForceCompiler) 2 | 3 | cmake_minimum_required (VERSION 2.8) 4 | SET(CMAKE_SYSTEM_NAME Generic) 5 | 6 | project(mbedTrace) 7 | 8 | 9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mbed-trace/) 10 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/) 11 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nanostack-libservice/mbed-client-libservice/) 12 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nanostack-libservice/) 13 | 14 | set (MBED_TRACE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/source/mbed_trace.c) 15 | 16 | 17 | CREATE_LIBRARY(mbedTrace "${MBED_TRACE_SRC}" "") 18 | 19 | -------------------------------------------------------------------------------- /mbed-trace/example/linux/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc main.c -g -I ../.. ../../source/mbed_trace.c -DYOTTA_CFG -DMBED_CONF_MBED_TRACE_FEA_IPV6=0 -o app 3 | -------------------------------------------------------------------------------- /mbed-trace/example/linux/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | 19 | #include "mbed-trace/mbed_trace.h" 20 | #define TRACE_GROUP "main" 21 | 22 | 23 | int main(void) 24 | { 25 | mbed_trace_init(); 26 | tr_debug("debug print"); 27 | tr_info("info print"); 28 | tr_warn("warning print"); 29 | tr_error("error print"); 30 | mbed_trace_free(); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /mbed-trace/example/linux/memtest.sh: -------------------------------------------------------------------------------- 1 | valgrind --leak-check=yes --error-exitcode=1 ./app 2 | -------------------------------------------------------------------------------- /mbed-trace/example/mbed-os-5/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | #include "mbed.h" 19 | #include "mbed_trace.h" 20 | 21 | #define TRACE_GROUP "main" 22 | 23 | int main(void) 24 | { 25 | // Initialize trace library 26 | mbed_trace_init(); 27 | // trace Something 28 | tr_info("Hello tracers"); 29 | while(1) { 30 | tr_debug("Infinite loop.."); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mbed-trace/example/mbed-os-5/mbed_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "macros": [ 3 | "MEM_ALLOC=malloc", 4 | "MEM_FREE=free" 5 | ], 6 | "target_overrides": { 7 | "*": { 8 | "platform.stdio-baud-rate": 115200, 9 | "platform.stdio-convert-newlines": true, 10 | "platform.stdio-buffered-serial": true, 11 | "target.features_add": ["COMMON_PAL"], 12 | "mbed-trace.enable": 1 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /mbed-trace/mbed_lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mbed-trace", 3 | "config": { 4 | "enable": { 5 | "help": "Used to globally enable traces.", 6 | "value": null 7 | }, 8 | "max-level": { 9 | "help": "This flag is used to optimize the code size. For example, setting trace optimization level to TRACE_LEVEL_INFO will define all tr_debug() macros empty, which reduces the binary size. The possible optimization levels are TRACE_LEVEL_DEBUG, TRACE_LEVEL_INFO, TRACE_LEVEL_WARN, TRACE_LEVEL_ERROR and TRACE_LEVEL_CMD. To set the output tracing level, please use mbed_trace_config_set(TRACE_ACTIVE_LEVEL_INFO). The possible tracing levels for mbed_trace_config_set() are TRACE_ACTIVE_LEVEL_ALL, TRACE_ACTIVE_LEVEL_DEBUG (same as ALL), TRACE_ACTIVE_LEVEL_INFO, TRACE_ACTIVE_LEVEL_WARN, TRACE_ACTIVE_LEVEL_ERROR, TRACE_ACTIVE_LEVEL_CMD and TRACE_LEVEL_NONE.", 10 | "value": null, 11 | "macro_name": "MBED_TRACE_MAX_LEVEL" 12 | 13 | }, 14 | "fea-ipv6": { 15 | "help": "Used to globally disable ipv6 tracing features.", 16 | "value": null 17 | } 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /mbed-trace/source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(DEFINED TARGET_LIKE_X86_LINUX_NATIVE) 2 | add_library( mbed-trace 3 | mbed_trace.c 4 | ) 5 | add_definitions("-g -O0 -fprofile-arcs -ftest-coverage") 6 | target_link_libraries(mbed-trace gcov nanostack-libservice) 7 | elseif(DEFINED TARGET_LIKE_X86_OSX_NATIVE) 8 | add_library( mbed-trace 9 | mbed_trace.c 10 | ) 11 | add_definitions("-g -O0") 12 | target_link_libraries(mbed-trace nanostack-libservice) 13 | else() 14 | add_library( mbed-trace 15 | mbed_trace.c 16 | ) 17 | target_link_libraries(mbed-trace nanostack-libservice) 18 | endif() 19 | -------------------------------------------------------------------------------- /nanostack-libservice/.mbedignore: -------------------------------------------------------------------------------- 1 | test/* 2 | -------------------------------------------------------------------------------- /nanostack-libservice/LICENSE: -------------------------------------------------------------------------------- 1 | Unless specifically indicated otherwise in a file, files are licensed 2 | under the Apache 2.0 license, as can be found in: apache-2.0.txt -------------------------------------------------------------------------------- /nanostack-libservice/mbed-client-libservice/ip4string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2018 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef IP4STRING_H 17 | #define IP4STRING_H 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #include "ns_types.h" 23 | 24 | /** 25 | * Print binary IPv4 address to a string. 26 | * 27 | * String must contain enough room for full address, 16 bytes exact. 28 | * 29 | * \param ip4addr IPv4 address. 30 | * \param p buffer to write string to. 31 | * \return length of generated string excluding the terminating null character 32 | */ 33 | uint_fast8_t ip4tos(const void *ip4addr, char *p); 34 | 35 | /** 36 | * Convert numeric IPv4 address string to a binary. 37 | * 38 | * \param ip4addr IPv4 address in string format. 39 | * \param len Length of IPv4 string, maximum of 16.. 40 | * \param dest buffer for address. MUST be 4 bytes. 41 | * \return boolean set to true if conversion succeed, false if it didn't 42 | */ 43 | bool stoip4(const char *ip4addr, size_t len, void *dest); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif 49 | -------------------------------------------------------------------------------- /nanostack-libservice/mbed-client-libservice/ip_fsc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2015 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _NS_FSC_H 17 | #define _NS_FSC_H 18 | 19 | #include "ns_types.h" 20 | 21 | #define NEXT_HEADER_TCP 0x06 22 | #define NEXT_HEADER_UDP 0x11 23 | #define NEXT_HEADER_ICMP6 0x3A 24 | 25 | extern uint16_t ip_fcf_v(uint_fast8_t count, const ns_iovec_t vec[static count]); 26 | extern uint16_t ipv6_fcf(const uint8_t src_address[static 16], const uint8_t dest_address[static 16], 27 | uint16_t data_length, const uint8_t data_ptr[static data_length], uint8_t next_protocol); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /nanostack-libservice/mbed-client-libservice/ns_trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2017 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * \file ns_trace.h 19 | * Trace interface abstraction for NanoStack library as well as application. 20 | * 21 | * Actual used trace library is mbed-trace. For usage details check mbed_trace.h. 22 | * 23 | */ 24 | #ifndef NS_TRACE_H_ 25 | #define NS_TRACE_H_ 26 | 27 | #if defined(HAVE_DEBUG) && !defined(FEA_TRACE_SUPPORT) 28 | #define FEA_TRACE_SUPPORT 29 | #endif 30 | 31 | #include "ns_types.h" 32 | #include "mbed-trace/mbed_trace.h" 33 | 34 | #endif /* NS_TRACE_H_ */ 35 | -------------------------------------------------------------------------------- /nanostack-libservice/mbed_lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nanostack-libservice", 3 | "macros": ["NSDYNMEM_TRACKER_ENABLED=MBED_CONF_NANOSTACK_LIBSERVICE_NSDYNMEM_TRACKER_ENABLED"], 4 | "config": { 5 | "present": 1, 6 | "nsdynmem-tracker-enabled": { 7 | "help": "Use to enable dynamic memory tracker", 8 | "value": 0 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /nanostack-libservice/source/libList/ns_list.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2015 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * All functions can be inlined, and definitions are in ns_list.h. 19 | * Define NS_LIST_FN before including it to generate external definitions. 20 | */ 21 | #define NS_LIST_FN extern 22 | 23 | #include "ns_list.h" 24 | -------------------------------------------------------------------------------- /network-manager/images/block_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PelionIoT/mbed-cloud-client/5c654f9e54ad360c55d392154c1a4efd96424e63/network-manager/images/block_diagram.png -------------------------------------------------------------------------------- /network-manager/source/include/nm_dynmem_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef NM_DYNMEM_HELPER_H_ 18 | #define NM_DYNMEM_HELPER_H_ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #include 25 | 26 | typedef size_t nm_mem_block_size_t; 27 | 28 | void *nm_dyn_mem_alloc(nm_mem_block_size_t alloc_size); 29 | void nm_dyn_mem_free(void *block); 30 | 31 | #ifdef __cplusplus 32 | } // closing brace for extern "C" 33 | #endif 34 | 35 | #endif /* NM_DYNMEM_HELPER_H_ */ 36 | -------------------------------------------------------------------------------- /network-manager/source/include/nm_kvstore_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef NM_KVSTORE_HELPER_H_ 18 | #define NM_KVSTORE_HELPER_H_ 19 | 20 | /* Max value of KV_KEY_LENGTH */ 21 | #define KV_KEY_LENGTH 32 22 | 23 | extern char kv_key_ws[KV_KEY_LENGTH]; 24 | extern char kv_key_br[KV_KEY_LENGTH]; 25 | extern char kv_key_tm[KV_KEY_LENGTH]; 26 | 27 | nm_status_t get_lenght_from_KVstore(char *key, size_t *len); 28 | nm_status_t get_data_from_kvstore(char *key, uint8_t *value, size_t len); 29 | nm_status_t set_data_to_kvstore(char *key, void *value, int len); 30 | 31 | #endif /* NM_KVSTORE_HELPER_H_ */ 32 | -------------------------------------------------------------------------------- /network-manager/source/include/nm_resource_manager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef NM_RESOURCE_MANAGER_H_ 18 | #define NM_RESOURCE_MANAGER_H_ 19 | 20 | nm_status_t nm_res_manager_create(void *cloud_client_info); 21 | nm_status_t nm_res_manager_get(void *resource_object); 22 | nm_status_t nm_res_manager_set(void *resource_data); 23 | void nm_manager_res_refresh(void); 24 | 25 | #endif /* NM_RESOURCE_MANAGER_H_ */ 26 | -------------------------------------------------------------------------------- /network-manager/source/nm_dynmem_helper.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #if defined MBED_CONF_MBED_CLOUD_CLIENT_NETWORK_MANAGER && (MBED_CONF_MBED_CLOUD_CLIENT_NETWORK_MANAGER == 1) 18 | 19 | #include 20 | #include 21 | #include "platform/arm_hal_interrupt.h" 22 | #include "nm_dynmem_helper.h" 23 | 24 | void *nm_dyn_mem_alloc(nm_mem_block_size_t alloc_size) 25 | { 26 | void *retval = NULL; 27 | if (alloc_size) { 28 | platform_enter_critical(); 29 | retval = malloc(alloc_size); 30 | platform_exit_critical(); 31 | } 32 | return retval; 33 | } 34 | 35 | void nm_dyn_mem_free(void *block) 36 | { 37 | platform_enter_critical(); 38 | free(block); 39 | platform_exit_critical(); 40 | } 41 | 42 | #endif //MBED_CONF_MBED_CLOUD_CLIENT_NETWORK_MANAGER && (MBED_CONF_MBED_CLOUD_CLIENT_NETWORK_MANAGER == 1) 43 | -------------------------------------------------------------------------------- /ns-hal-pal/arm_hal_interrupt_private.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_HAL_INTERRUPT_PRIVATE_H_ 20 | #define ARM_HAL_INTERRUPT_PRIVATE_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void platform_critical_init(void); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ns-hal-pal/arm_hal_random.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2015-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #include 20 | #include "ns_types.h" 21 | #include "platform/arm_hal_random.h" 22 | #include "pal.h" 23 | 24 | void arm_random_module_init(void) 25 | { 26 | palStatus_t status = pal_init(); 27 | assert(status == PAL_SUCCESS); 28 | (void) status; 29 | } 30 | 31 | uint32_t arm_random_seed_get(void) 32 | { 33 | uint32_t result = 0; 34 | palStatus_t status = pal_osRandom32bit(&result); 35 | assert(status == PAL_SUCCESS); 36 | (void) status; 37 | return result; 38 | } 39 | -------------------------------------------------------------------------------- /ns-hal-pal/mbed_lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ns-hal-pal", 3 | "config": { 4 | "nvm_cfstore": { 5 | "help": "Use cfstore as a NVM storage. Else RAM simulation will be used", 6 | "value": false 7 | }, 8 | "event_loop_thread_stack_size": { 9 | "help": "Define event-loop thread stack size.", 10 | "value": 6144 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ns-hal-pal/ns_event_loop.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef NS_EVENT_LOOP_H_ 20 | #define NS_EVENT_LOOP_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void ns_event_loop_thread_create(void); 27 | void ns_event_loop_thread_start(void); 28 | 29 | // A extension to original event loop API, which is useful on Linux only 30 | void ns_event_loop_thread_stop(void); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* NS_EVENT_LOOP_H_ */ 37 | -------------------------------------------------------------------------------- /sal-stack-nanostack-eventloop/LICENSE: -------------------------------------------------------------------------------- 1 | Unless specifically indicated otherwise in a file, files are licensed 2 | under the Apache 2.0 license, as can be found in: apache-2.0.txt -------------------------------------------------------------------------------- /sal-stack-nanostack-eventloop/mbed_lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nanostack-eventloop", 3 | "requires": ["nanostack-hal"], 4 | "config": { 5 | "use_platform_tick_timer": { 6 | "help": "Use platform provided low resolution tick timer for eventloop", 7 | "value": null 8 | }, 9 | "exclude_highres_timer": { 10 | "help": "Exclude high resolution timer from build", 11 | "value": null 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sal-stack-nanostack-eventloop/nanostack-event-loop/eventOS_callback_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2015 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef EVENTOS_CALLBACK_TIMER_H_ 17 | #define EVENTOS_CALLBACK_TIMER_H_ 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | #include "ns_types.h" 22 | 23 | extern int8_t eventOS_callback_timer_register(void (*timer_interrupt_handler)(int8_t, uint16_t)); 24 | extern int8_t eventOS_callback_timer_unregister(int8_t ns_timer_id); 25 | 26 | extern int8_t eventOS_callback_timer_stop(int8_t ns_timer_id); 27 | extern int8_t eventOS_callback_timer_start(int8_t ns_timer_id, uint16_t slots); 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* EVENTOS_CALLBACK_TIMER_H_ */ 33 | -------------------------------------------------------------------------------- /sal-stack-nanostack-eventloop/source/event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef NS_EVENT_H_ 17 | #define NS_EVENT_H_ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | 24 | bool event_tasklet_handler_id_valid(uint8_t tasklet_id); 25 | void eventOS_event_send_timer_allocated(arm_event_storage_t *event); 26 | 27 | // This requires lock to be held 28 | arm_event_storage_t *eventOS_event_find_by_id_critical(uint8_t tasklet_id, uint8_t event_id); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /*NS_EVENT_H_*/ 35 | -------------------------------------------------------------------------------- /sal-stack-nanostack-eventloop/source/ns_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2015 ARM Limited. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Licensed under the Apache License, Version 2.0 (the License); you may 5 | * not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef NS_TIMER_H_ 17 | #define NS_TIMER_H_ 18 | 19 | #include "platform/eventloop_config.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | #ifndef NS_EXCLUDE_HIGHRES_TIMER 26 | extern int8_t ns_timer_sleep(void); 27 | #else 28 | #define ns_timer_sleep() ((int8_t) 0) 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /*NS_TIMER_H_*/ 36 | -------------------------------------------------------------------------------- /secure-device-access-client/cose-c/.mbedignore: -------------------------------------------------------------------------------- 1 | source/openssl.c 2 | -------------------------------------------------------------------------------- /secure-device-access-client/cose-c/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- 2 | # The confidential and proprietary information contained in this file may 3 | # only be used by a person authorized under and to the extent permitted 4 | # by a subsisting licensing agreement from ARM Limited or its affiliates. 5 | # 6 | # (C)COPYRIGHT 2017 - 2018 ARM Limited or its affiliates. 7 | # ALL RIGHTS RESERVED 8 | # 9 | # This entire notice must be reproduced on all copies of this file 10 | # and copies of this file may only be made by a person if such person is 11 | # permitted to do so under the terms of a subsisting license agreement 12 | # from ARM Limited or its affiliates. 13 | # ---------------------------------------------------------------------------- 14 | # 15 | cmake_minimum_required(VERSION 2.6) 16 | 17 | # includes 18 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/cose-c) 19 | 20 | FILE( 21 | GLOB_RECURSE 22 | cose 23 | 24 | "${CMAKE_CURRENT_SOURCE_DIR}/source/*.c" 25 | ) 26 | 27 | message ("*********************************************************************") 28 | message ("cose = [[${cose}]]") 29 | message ("*********************************************************************") 30 | 31 | CREATE_LIBRARY(cose "${cose}" "") 32 | if (${OS_BRAND} MATCHES "Zephyr") 33 | target_link_libraries(cose PUBLIC ${TLS_LIBRARY}) 34 | endif() 35 | ADDSUBDIRS() 36 | -------------------------------------------------------------------------------- /secure-device-access-client/cose-c/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, cose-wg 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of COSE-C nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /secure-device-access-client/logger/sources/sda_error_handling.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2017-2019 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | 18 | #include "stdbool.h" 19 | #include "sda_error_handling.h" 20 | 21 | static bool g_pv_is_error_occured = false; 22 | 23 | void sda_error_occured(void) 24 | { 25 | g_pv_is_error_occured = true; 26 | } 27 | 28 | bool sda_error_is_error_occured(void) 29 | { 30 | return g_pv_is_error_occured; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /secure-device-access-client/secure-device-access/source/include/sda_error_translation.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2017-2019 ARM Ltd. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // ---------------------------------------------------------------------------- 16 | 17 | #ifndef __SDA_ERROR_TRANSLATION_H__ 18 | #define __SDA_ERROR_TRANSLATION_H__ 19 | 20 | #include "cs_der_keys_and_csrs.h" 21 | #include "sda_data_token.h" 22 | /** 23 | * @file sda_defs.h 24 | * \brief device based authorization defines. 25 | * 26 | */ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | 33 | 34 | /** The function converts internal status to appropriate sda error. 35 | * 36 | * @param internal_status The value of internal status. 37 | * 38 | * @return 39 | * SDA_STATUS_SUCCESS in case of success or one of the `::sda_status_e` errors otherwise. 40 | */ 41 | sda_status_e sda_return_status_translate(sda_status_internal_e internal_status); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif //__SDA_ERROR_TRANSLATION_H__ 48 | -------------------------------------------------------------------------------- /source/include/CertificateParser.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef CERTIFICATE_PARSER_H 20 | #define CERTIFICATE_PARSER_H 21 | 22 | /** \internal \file CertificateParser.h */ 23 | 24 | #include "ns_types.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /** 31 | * \brief A utility function to extract Locality field from the mDS certificate and store it to KCM. 32 | * \param certificate, The certificate from which the field has to be extracted. 33 | * \param field, The field to be extracted. 34 | * \param value [OUT], buffer containing field value. Maximum value can be 64 bytes. 35 | * \return True if success, False if failure. 36 | */ 37 | bool extract_field_from_certificate(const uint8_t* cer, size_t cer_len, const char *field, char* value); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | #endif // CERTIFICATE_PARSER_H 43 | -------------------------------------------------------------------------------- /tinycbor/.mbedignore: -------------------------------------------------------------------------------- 1 | */*.o 2 | -------------------------------------------------------------------------------- /tinycbor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required (VERSION 3.5) 3 | 4 | # includes 5 | ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/src) 6 | 7 | FILE( 8 | GLOB_RECURSE 9 | tinycbor 10 | 11 | "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c" 12 | ) 13 | 14 | message ("*********************************************************************") 15 | message ("tinycbor = [[${tinycbor}]]") 16 | message ("*********************************************************************") 17 | 18 | CREATE_LIBRARY(tinycbor "${tinycbor}" "") 19 | 20 | ADDSUBDIRS() -------------------------------------------------------------------------------- /tinycbor/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Intel Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /tinycbor/makefile_mbed: -------------------------------------------------------------------------------- 1 | PLATFORM=K64F 2 | DFLAGS = 3 | CFLAGS = 4 | TEST_LIST=tests-runner-tiny_cbor_main 5 | 6 | all: tiny_cbor_tests 7 | 8 | clean: clean_tiny_cbor_tests 9 | 10 | deep_clean: clean_tiny_cbor_tests clean_mbed clean_unity 11 | 12 | MBED_OS_DIR := $(TINY_CBOR_TOP)/mbed-os 13 | UNITY_DIR := $(TINY_CBOR_TOP)/e2e-unity 14 | 15 | BUILD_CFLAGS := --profile $(MBED_OS_DIR)/tools/profiles/debug.json 16 | 17 | BUILD_SRCS_CBOR := \ 18 | $(TINY_CBOR_TOP)/TESTS/runner/tiny_cbor_runner \ 19 | $(TINY_CBOR_TOP)/TESTS/runner/tiny_cbor_main \ 20 | $(TINY_CBOR_TOP)/TESTS/tests 21 | 22 | 23 | tiny_cbor_tests: 24 | @echo $(TINYCBOR_TOOLCHAIN) 25 | @#mkdir -p $(OUT_DIR) 26 | @#cp -rfu $(TINY_CBOR_TOP)/TESTS/runner/tiny_cbor_main/tiny_cbor_test_runner_main.cpp $(OUT_DIR) 27 | @mbed test \ 28 | -t $(TINYCBOR_TOOLCHAIN) \ 29 | --compile -v \ 30 | -n $(TEST_LIST) \ 31 | -m $(PLATFORM) \ 32 | --source . \ 33 | --source $(TINY_CBOR_TOP)/TESTS/tests \ 34 | --source $(TINY_CBOR_TOP)/TESTS/runner/tiny_cbor_runner \ 35 | --app-config $(TINY_CBOR_TOP)/mbed_app.json \ 36 | --profile $(TINYCBOR_BUILD_TYPE) \ 37 | $(DFLAGS) $(CFLAGS) $(BUILD_CFLAGS) 38 | 39 | clean_tiny_cbor_tests: 40 | @echo [CLN-BUILD] 41 | @rm -rf $(TINY_CBOR_TOP)/BUILD 42 | 43 | 44 | clean_mbed: 45 | @echo [CLN-MBED] 46 | @rm -rf $(MBED_OS_DIR) 47 | @rm -f $(TINY_CBOR_TOP)/.mbed 48 | 49 | clean_unity: 50 | @echo [CLN-UNITY] 51 | @rm -rf $(UNITY_DIR) 52 | 53 | -------------------------------------------------------------------------------- /tinycbor/src/.mbedignore: -------------------------------------------------------------------------------- 1 | ./open_memstream.c 2 | -------------------------------------------------------------------------------- /tinycbor/src/src.pri: -------------------------------------------------------------------------------- 1 | SOURCES += \ 2 | $$PWD/cborencoder.c \ 3 | $$PWD/cborencoder_close_container_checked.c \ 4 | $$PWD/cborerrorstrings.c \ 5 | $$PWD/cborparser.c \ 6 | $$PWD/cborparser_dup_string.c \ 7 | $$PWD/cborpretty.c \ 8 | $$PWD/cbortojson.c \ 9 | $$PWD/cborvalidation.c \ 10 | 11 | HEADERS += $$PWD/tinycbor.h $$PWD/tinycbor-version.h 12 | 13 | QMAKE_CFLAGS *= $$QMAKE_CFLAGS_SPLIT_SECTIONS 14 | QMAKE_LFLAGS *= $$QMAKE_LFLAGS_GCSECTIONS 15 | INCLUDEPATH += $$PWD 16 | CONFIG(release, debug|release): DEFINES += NDEBUG 17 | -------------------------------------------------------------------------------- /tinycbor/src/tags.txt: -------------------------------------------------------------------------------- 1 | # Tag number; Tag ID; Applicable types (comma-separated); Semantics 2 | 0;DateTimeString;TextString;Standard date/time string 3 | 1;UnixTime_t;Integer;Epoch-based date/time 4 | 2;PositiveBignum;ByteString;Positive bignum 5 | 3;NegativeBignum;ByteString;Negative bignum 6 | 4;Decimal;Array;Decimal fraction 7 | 5;Bigfloat;Array;Bigfloat 8 | 16;COSE_Encrypt0;Array;COSE Single Recipient Encrypted Data Object (RFC 8152) 9 | 17;COSE_Mac0;Array;COSE Mac w/o Recipients Object (RFC 8152) 10 | 18;COSE_Sign1;Array;COSE Single Signer Data Object (RFC 8162) 11 | 21;ExpectedBase64url;ByteString,Array,Map;Expected conversion to base64url encoding 12 | 22;ExpectedBase64;ByteString,Array,Map;Expected conversion to base64 encoding 13 | 23;ExpectedBase16;ByteString,Array,Map;Expected conversion to base16 encoding 14 | 24;EncodedCbor;ByteString;Encoded CBOR data item 15 | 32;Url;TextString;URI 16 | 33;Base64url;TextString;base64url 17 | 34;Base64;TextString;base64 18 | 35;RegularExpression;TextString;Regular expression 19 | 36;MimeMessage;TextString;MIME message 20 | 96;COSE_Encrypt;Array;COSE Encrypted Data Object (RFC 8152) 21 | 97;COSE_Mac;Array;COSE MACed Data Object (RFC 8152) 22 | 98;COSE_Sign;Array;COSE Signed Data Object (RFC 8152) 23 | 55799;Signature;;Self-describe CBOR 24 | -------------------------------------------------------------------------------- /tinycbor/src/tinycbor-version.h: -------------------------------------------------------------------------------- 1 | #define TINYCBOR_VERSION_MAJOR 0 2 | #define TINYCBOR_VERSION_MINOR 5 3 | #define TINYCBOR_VERSION_PATCH 0 4 | -------------------------------------------------------------------------------- /tinycbor/src/tinycbor.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | CONFIG += static 3 | CONFIG -= qt 4 | DESTDIR = ../lib 5 | 6 | include(src.pri) 7 | -------------------------------------------------------------------------------- /update-client-hub/.mbedignore: -------------------------------------------------------------------------------- 1 | */test/* 2 | */Test/* 3 | */test-utils/* 4 | */stubs/* 5 | delta-tool-internal/bsdiff/* 6 | delta-tool-internal/*.sh 7 | delta-tool-internal/test_data/* 8 | delta-tool-internal/source/* 9 | -------------------------------------------------------------------------------- /update-client-hub/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Update client 3 | # 4 | # List of subdirectories to build 5 | TEST_FOLDER := ./TESTS 6 | 7 | # Define compiler toolchain with CC or PLATFORM variables 8 | # Example (GCC toolchains, default $CC and $AR are used) 9 | # make 10 | # 11 | # OR (Cross-compile GCC toolchain) 12 | # make PLATFORM=arm-linux-gnueabi- 13 | # 14 | # OR (ArmCC/Keil) 15 | # make CC=ArmCC AR=ArmAR 16 | # 17 | # OR (IAR-ARM) 18 | # make CC=iccarm 19 | 20 | LIB = libupdateclient.a 21 | 22 | # List of unit test directories for libraries 23 | UNITTESTS := $(sort $(dir $(wildcard $(TEST_FOLDER)*/unittest/*))) 24 | 25 | # If configuration is not specified, use linux 26 | ifeq (,$(CONFIG)) 27 | CONFIG := linux 28 | endif 29 | 30 | FLAGS += TARGET_LIKE_LINUX 31 | 32 | ifeq ($(DEBUG),1) 33 | override CFLAGS += -DHAVE_DEBUG 34 | endif 35 | 36 | COVERAGEFILE := ./lcov/coverage.info 37 | 38 | # 39 | # Define compiler toolchain 40 | # 41 | include ../../libService/toolchain_rules.mk 42 | 43 | $(eval $(call generate_rules,$(LIB),$(SRCS))) 44 | 45 | # Extend default clean rule 46 | clean: clean-extra 47 | 48 | $(CLEANDIRS): 49 | @make -C $(@:clean-%=%) clean 50 | 51 | clean-extra: $(CLEANDIRS) 52 | -------------------------------------------------------------------------------- /update-client-hub/delta-tool-internal/mbed_lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "delta-tool", 3 | "config": { 4 | "BS_PATCH_COMPILE_TIME_MEMORY_ALLOC": { 5 | "help": "memory allocated statically during compile time to bspatch module, will need to be around 2* frame size defined in bsdiff during delta creation. If defined to 0, malloc will be used instead", 6 | "macro_name": "BS_PATCH_COMPILE_TIME_MEMORY_ALLOC", 7 | "value": 1024 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /update-client-hub/modules/atomic-queue/source/critical-pal.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2015-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | /** 20 | * Use critical implementation below when explicitly defined. 21 | */ 22 | #if defined(ATOMIC_QUEUE_USE_PAL) 23 | 24 | #include 25 | #include 26 | 27 | #include "pal.h" 28 | // Module include 29 | #include "aq_critical.h" 30 | 31 | static palMutexID_t mutex = NULLPTR; 32 | 33 | void aq_critical_section_enter(void) 34 | { 35 | if (mutex == NULLPTR) { 36 | palStatus_t rc = pal_osMutexCreate(&mutex); 37 | assert(rc == PAL_SUCCESS); 38 | } 39 | 40 | palStatus_t rc = pal_osMutexWait(mutex, PAL_RTOS_WAIT_FOREVER); 41 | assert(rc == PAL_SUCCESS); 42 | } 43 | 44 | void aq_critical_section_exit(void) 45 | { 46 | palStatus_t rc = pal_osMutexRelease(mutex); 47 | assert(rc == PAL_SUCCESS); 48 | } 49 | 50 | #endif // defined(ATOMIC_QUEUE_USE_PAL) 51 | -------------------------------------------------------------------------------- /update-client-hub/modules/atomic-queue/source/posix.cmake: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- 2 | # Copyright 2015-2017 ARM Ltd. 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # ---------------------------------------------------------------------------- 18 | 19 | if(TARGET_LIKE_POSIX) 20 | target_link_libraries(${YOTTA_MODULE_NAME} "-pthread") 21 | set_target_properties(${YOTTA_MODULE_NAME} PROPERTIES 22 | COMPILE_FLAGS " -pthread ") 23 | endif() 24 | -------------------------------------------------------------------------------- /update-client-hub/modules/common/source/arm_uc_error.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #include "update-client-common/arm_uc_error.h" 20 | 21 | const char *ARM_UC_err2Str(arm_uc_error_t err) 22 | { 23 | switch (err.code) { 24 | #define ENUM_AUTO(name) case name: return #name; 25 | #define ENUM_FIXED(name, val) ENUM_AUTO(name) 26 | ARM_UC_ERR_LIST 27 | #undef ENUM_FIXED 28 | #undef ENUM_AUTO 29 | default: 30 | return "Unknown Error Code"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /update-client-hub/modules/common/update-client-common/arm_uc_common.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UPDATE_COMMON_H 20 | #define ARM_UPDATE_COMMON_H 21 | 22 | #include "update-client-common/arm_uc_config.h" 23 | #include "update-client-common/arm_uc_crypto.h" 24 | #include "update-client-common/arm_uc_error.h" 25 | #include "update-client-common/arm_uc_public.h" 26 | #include "update-client-common/arm_uc_scheduler.h" 27 | #include "update-client-common/arm_uc_trace.h" 28 | #include "update-client-common/arm_uc_types.h" 29 | #include "update-client-common/arm_uc_utilities.h" 30 | 31 | #endif // ARM_UPDATE_COMMON_H 32 | -------------------------------------------------------------------------------- /update-client-hub/modules/common/update-client-common/arm_uc_hw_plat.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UPDATE_HW_PLAT_H 20 | #define ARM_UPDATE_HW_PLAT_H 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | void arm_uc_plat_reboot(void); 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif // ARM_UPDATE_HW_PLAT_H 33 | -------------------------------------------------------------------------------- /update-client-hub/modules/delta-paal/source/bspatch_uc_mbed.c: -------------------------------------------------------------------------------- 1 | // Include bspatch source files, which are ignored with .mbedignore 2 | // in order to avoid collision with the ones used in FOTA 3 | // (due to the nature of mbed-os source file globbing) 4 | 5 | #include "MbedCloudClientConfig.h" 6 | 7 | #if (defined(__MBED__) || defined(__NANOSIMULATOR__)) && !defined(MBED_CLOUD_CLIENT_FOTA_ENABLE) 8 | #include "../../../delta-tool-internal/source/bspatch.c" 9 | #include "../../../delta-tool-internal/source/lz4.c" 10 | #include "../../../delta-tool-internal/source/varint.c" 11 | #endif 12 | -------------------------------------------------------------------------------- /update-client-hub/modules/delta-paal/update-client-delta-paal/arm_uc_pal_delta_paal.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2019 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_DELTA_PAAL_H 20 | #define ARM_UC_PAL_DELTA_PAAL_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | extern ARM_UC_PAAL_UPDATE ARM_UCP_DELTA_PAAL; 25 | 26 | #endif /* ARM_UC_PAL_DELTA_PAAL_H */ 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/delta-paal/update-client-delta-paal/arm_uc_pal_delta_paal_original_reader.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ARM_UC_PAL_DELTA_PAAL_ORIGINAL_READER_H 3 | #define ARM_UC_PAL_DELTA_PAAL_ORIGINAL_READER_H 4 | 5 | #include "update-client-paal/arm_uc_paal_update_api.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | int arm_uc_deltapaal_original_reader(void* buffer, uint64_t length, uint32_t offset); 12 | arm_uc_error_t arm_uc_delta_paal_construct_original_image_file_path(char* buffer, size_t buffer_length); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | #endif /* ARM_UC_PAL_DELTA_PAAL_ORIGINAL_READER_H */ 19 | -------------------------------------------------------------------------------- /update-client-hub/modules/device-identity/.mbedignore: -------------------------------------------------------------------------------- 1 | TESTS/tests/sanity/* -------------------------------------------------------------------------------- /update-client-hub/modules/firmware-manager/.mbedignore: -------------------------------------------------------------------------------- 1 | */test/* 2 | test/* 3 | */stubs/* 4 | stubs/* 5 | 6 | -------------------------------------------------------------------------------- /update-client-hub/modules/lwm2m-mbed/update-client-lwm2m/lwm2m-monitor.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef __ARM_UCS_LWM2M_MONITOR_H__ 20 | #define __ARM_UCS_LWM2M_MONITOR_H__ 21 | 22 | #include "update-client-monitor/arm_uc_monitor.h" 23 | 24 | extern const ARM_UPDATE_MONITOR ARM_UCS_LWM2M_MONITOR; 25 | 26 | #endif // __ARM_UCS_LWM2M_MONITOR_H__ 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/lwm2m-mbed/update-client-lwm2m/update_lwm2m_monitor.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2019 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef __UPDATE_LWM2M_MONITOR_H__ 20 | #define __UPDATE_LWM2M_MONITOR_H__ 21 | 22 | #include "lwm2m-source.h" 23 | 24 | #ifdef LWM2M_SOURCE_USE_C_API 25 | 26 | #include "update-client-monitor/arm_uc_monitor.h" 27 | 28 | const ARM_UPDATE_MONITOR *get_update_lwm2m_monitor(void); 29 | 30 | #endif //LWM2M_SOURCE_USE_C_API 31 | 32 | #endif //__UPDATE_LWM2M_MONITOR_H__ 33 | 34 | -------------------------------------------------------------------------------- /update-client-hub/modules/manifest-manager/.mbedignore: -------------------------------------------------------------------------------- 1 | test/* 2 | */test/* 3 | */stubs/* 4 | stubs/* 5 | 6 | -------------------------------------------------------------------------------- /update-client-hub/modules/manifest-manager/source/arm_uc_mmCommon.c: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2019 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #include "update-client-common/arm_uc_config.h" 20 | 21 | #if defined(ARM_UC_ENABLE) && (ARM_UC_ENABLE == 1) 22 | 23 | #include "update-client-manifest-manager/update-client-manifest-manager-context.h" 24 | #include "arm_uc_mmCommon.h" 25 | #include "arm_uc_mmConfig.h" 26 | #include "update-client-manifest-manager/update-client-manifest-types.h" 27 | 28 | #include 29 | 30 | // Initialisation with an enum silences a compiler warning for ARM ("188-D: enumerated type mixed with another type"). 31 | arm_uc_mmPersistentContext_t arm_uc_mmPersistentContext = { ARM_UC_MM_STATE_INVALID }; 32 | const size_t arm_uc_mmDynamicContextSize = sizeof(arm_uc_mmContext_t); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /update-client-hub/modules/manifest-manager/source/arm_uc_mmFetchFirmwareInfo.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef MANIFEST_MANAGER_FETCH_FIRMWARE_INFO_H 20 | #define MANIFEST_MANAGER_FETCH_FIRMWARE_INFO_H 21 | 22 | 23 | #include "arm_uc_mmConfig.h" 24 | #include "update-client-common/arm_uc_common.h" 25 | 26 | arm_uc_error_t ARM_UC_mmFetchFirmwareInfoFSM(uint32_t event); 27 | 28 | #endif // MANIFEST_MANAGER_FETCH_FIRMWARE_INFO_H 29 | -------------------------------------------------------------------------------- /update-client-hub/modules/manifest-manager/source/arm_uc_mmGetLatestTimestamp.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_MM_GET_LATEST_TIMESTAMP_H 20 | #define ARM_UC_MM_GET_LATEST_TIMESTAMP_H 21 | 22 | #include "update-client-common/arm_uc_error.h" 23 | #include "update-client-common/arm_uc_types.h" 24 | 25 | arm_uc_error_t getLatestManifestTimestamp(uint64_t *ts, arm_uc_buffer_t *key); 26 | arm_uc_error_t getLatestManifestTimestampFSM(uint32_t event); 27 | 28 | #endif // ARM_UC_MM_GET_LATEST_TIMESTAMP_H 29 | -------------------------------------------------------------------------------- /update-client-hub/modules/manifest-manager/source/arm_uc_mmInsertManifest.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef MANIFEST_MANAGER_INSERT_MANIFEST_H 20 | #define MANIFEST_MANAGER_INSERT_MANIFEST_H 21 | 22 | 23 | #include "arm_uc_mmConfig.h" 24 | #include "update-client-common/arm_uc_common.h" 25 | 26 | arm_uc_error_t ARM_UC_mmInsertFSM(uint32_t event); 27 | 28 | #endif // MANIFEST_MANAGER_INSERT_MANIFEST_H 29 | -------------------------------------------------------------------------------- /update-client-hub/modules/manifest-manager/source/arm_uc_mmStateSelector.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef MANIFEST_MANAGER_CORE_FSM_H 20 | #define MANIFEST_MANAGER_CORE_FSM_H 21 | 22 | #include "update-client-common/arm_uc_scheduler.h" 23 | #include "arm_uc_mmConfig.h" 24 | 25 | #include "update-client-manifest-manager/update-client-manifest-manager-context.h" 26 | 27 | arm_uc_error_t ARM_UC_mmSetState(enum arm_uc_mmState_t newState); 28 | arm_uc_error_t ARM_UC_mmFSM(uintptr_t event); 29 | void ARM_UC_mmCallbackFSMEntry(uintptr_t event); 30 | 31 | 32 | 33 | #endif // MANIFEST_MANAGER_CORE_FSM_H 34 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-blockdevice/.mbedignore: -------------------------------------------------------------------------------- 1 | */test/* 2 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-blockdevice/update-client-pal-blockdevice/arm_uc_pal_blockdevice.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2017-2018 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_FLASHIAP_BLOCKDEVICE_H 20 | #define ARM_UC_PAL_FLASHIAP_BLOCKDEVICE_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | extern ARM_UC_PAAL_UPDATE ARM_UCP_FLASHIAP_BLOCKDEVICE; 25 | 26 | #endif /* ARM_UC_PAL_FLASHIAP_BLOCKDEVICE_H */ 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-filesystem/source/arm_uc_pal_filesystem_utils.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_FILESYSTEM_UTILS 20 | #define ARM_UC_PAL_FILESYSTEM_UTILS 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | typedef enum { 29 | FIRMWARE_IMAGE_ITEM_HEADER = 0, 30 | FIRMWARE_IMAGE_ITEM_DATA 31 | } firmwareImageItemType; 32 | 33 | arm_uc_error_t arm_uc_pal_filesystem_get_path(uint32_t location, firmwareImageItemType what, char *dest, 34 | uint32_t dest_size); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif // ARM_UC_PAL_FILESYSTEM_UTILS 41 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-filesystem/update-client-pal-filesystem/arm_uc_pal_extensions.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_EXTENSIONS 20 | #define ARM_UC_PAL_EXTENSIONS 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | arm_uc_error_t pal_ext_imageInitAPI(ARM_UC_PAAL_UPDATE_SignalEvent_t callback); 29 | 30 | arm_uc_error_t pal_ext_imageGetActiveDetails(arm_uc_firmware_details_t *details); 31 | 32 | arm_uc_error_t pal_ext_installerGetDetails(arm_uc_installer_details_t *details); 33 | 34 | arm_uc_error_t pal_ext_imageActivate(uint32_t location); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif // ARM_UC_PAL_EXTENSIONS 41 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-filesystem/update-client-pal-filesystem/arm_uc_pal_filesystem.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_CLASSIC_H 20 | #define ARM_UC_PAL_CLASSIC_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | extern ARM_UC_PAAL_UPDATE ARM_UCP_FILESYSTEM; 25 | 26 | #endif // ARM_UC_PAL_CLASSIC_H 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-flashiap-mcuboot/update-client-pal-flashiap-mcuboot/arm_uc_pal_flashiap_mcuboot.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2020 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_FLASHIAP_MCUBOOT_H 20 | #define ARM_UC_PAL_FLASHIAP_MCUBOOT_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | extern ARM_UC_PAAL_UPDATE ARM_UCP_FLASHIAP_MCUBOOT; 25 | 26 | #endif /* ARM_UC_PAL_FLASHIAP_MCUBOOT_H */ 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-flashiap/update-client-pal-flashiap/arm_uc_pal_flashiap.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_FLASHIAP_H 20 | #define ARM_UC_PAL_FLASHIAP_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | extern ARM_UC_PAAL_UPDATE ARM_UCP_FLASHIAP; 25 | 26 | #endif /* ARM_UC_PAL_FLASHIAP_H */ 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_activate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | mkdir -p /tmp/extended 31 | 32 | # copy header to store 33 | VALUE=$(cp $HEADER /tmp/extended/header.bin) 34 | 35 | exit $VALUE 36 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_active_details.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | # Parse command line 20 | # 21 | # HEADER 22 | # FIRMWARE 23 | # LOCATION 24 | # OFFSET 25 | # SIZE 26 | # 27 | . ../../../arm_update_cmdline.sh 28 | 29 | # copy stored header to expected location 30 | VALUE=$(cp /tmp/extended/header.bin $HEADER) 31 | 32 | echo $HEADER 33 | 34 | exit $VALUE 35 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_details.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | VALUE=$(cp "/tmp/extended/header_${LOCATION}.bin" $HEADER) 31 | 32 | echo $HEADER 33 | 34 | exit $VALUE 35 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_finalize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | # This script is called after the last firmware fragment is written 31 | # and before the firmware is read back for verification. 32 | 33 | exit 0 34 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_initialize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | exit 0 31 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | exit 0 31 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | # create directory to store header and firmware 31 | mkdir -p /tmp/extended 32 | 33 | # move header and firmeware to extended directory for local control 34 | cp $HEADER "/tmp/extended/header_${LOCATION}.bin" 35 | cp $FIRMWARE "/tmp/extended/firmware_${LOCATION}.bin" 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_read.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | # copy fragment from stored firmware to temporary file 31 | VALUE=$(dd if="/tmp/extended/firmware_${LOCATION}.bin" of=/tmp/firmware_fragment.bin count=$SIZE ibs=1 skip=$OFFSET 2>/dev/null) 32 | 33 | # indicate to Update client where to read fragment from 34 | echo "/tmp/firmware_fragment.bin" 35 | 36 | exit $VALUE 37 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/generic/arm_update_write.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Parse command line 21 | # 22 | # HEADER 23 | # FIRMWARE 24 | # LOCATION 25 | # OFFSET 26 | # SIZE 27 | # 28 | . ../../../arm_update_cmdline.sh 29 | 30 | # get size of pre-allocated binary file 31 | FILESIZE="$(wc -c <"/tmp/extended/firmware_${LOCATION}.bin")" 32 | 33 | # insert firmware fragment into binary file 34 | VALUE=$(dd if=$FIRMWARE of="/tmp/extended/firmware_${LOCATION}.bin" ibs=1 obs=1 count="${FILESIZE}" seek="${OFFSET}") 35 | 36 | # clean up 37 | rm $FIRMWARE 38 | 39 | exit $VALUE 40 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/scripts/yotta_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Copyright 2016-2017 ARM Ltd. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http:#www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # ---------------------------------------------------------------------------- 19 | 20 | # Copy generic scripts to top level application so the test app can find them 21 | cp scripts/generic/arm_* ../../ 22 | cp scripts/arm_update_cmdline.sh ../../ 23 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/update-client-pal-linux/arm_uc_pal_linux_ext.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_LINUX_EXT_H 20 | #define ARM_UC_PAL_LINUX_EXT_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | /** 25 | * @brief Write a manifest to a file. 26 | * @param location Storage location ID. 27 | * @param buffer Buffer that contains the manifest. 28 | * @return Returns ERR_NONE if the manifest was written. 29 | * Returns ERR_INVALID_PARAMETER on error. 30 | */ 31 | arm_uc_error_t ARM_UC_PAL_Linux_WriteManifest(uint32_t location, 32 | const arm_uc_buffer_t *manifest); 33 | 34 | #endif // ARM_UC_PAL_LINUX_H 35 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/update-client-pal-linux/arm_uc_pal_linux_generic.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_LINUX_H 20 | #define ARM_UC_PAL_LINUX_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | extern ARM_UC_PAAL_UPDATE ARM_UCP_LINUX_GENERIC; 25 | 26 | #endif // ARM_UC_PAL_LINUX_H 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/pal-linux/update-client-pal-linux/arm_uc_pal_linux_openwrt.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_PAL_LINUX_H 20 | #define ARM_UC_PAL_LINUX_H 21 | 22 | #include "update-client-paal/arm_uc_paal_update_api.h" 23 | 24 | extern ARM_UC_PAAL_UPDATE ARM_UCP_LINUX_OPENWRT; 25 | 26 | #endif // ARM_UC_PAL_LINUX_H 27 | -------------------------------------------------------------------------------- /update-client-hub/modules/resume-engine/.mbedignore: -------------------------------------------------------------------------------- 1 | TESTS/tests/sanity/* 2 | test/* 3 | */test/* 4 | -------------------------------------------------------------------------------- /update-client-hub/modules/source-manager/.mbedignore: -------------------------------------------------------------------------------- 1 | TESTS/tests/sanity/* 2 | test/* 3 | */test/* 4 | */stubs/* 5 | stubs/* 6 | 7 | -------------------------------------------------------------------------------- /update-client-hub/source/update_client_hub_error_handler.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_HUB_ERROR_HANDLER_H 20 | #define ARM_UC_HUB_ERROR_HANDLER_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #include "update_client_hub_state_machine.h" 27 | 28 | #include "update-client-common/arm_uc_common.h" 29 | 30 | void ARM_UC_HUB_AddErrorCallbackInternal(void (*callback)(int32_t error)); 31 | 32 | extern void ARM_UC_HUB_ErrorHandler(int32_t error, arm_uc_hub_state_t state); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif // ARM_UC_HUB_ERROR_HANDLER_H 39 | -------------------------------------------------------------------------------- /update-client-hub/update-client-hub/update_client_certificate.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UC_HUB_CERTIFICATE_H 20 | #define ARM_UC_HUB_CERTIFICATE_H 21 | 22 | #warning This file is deprecated. \ 23 | Use update - client - control - center / arm_uc_certificate.h instead 24 | 25 | #include "update-client-control-center/arm_uc_certificate.h" 26 | 27 | #endif // ARM_UC_HUB_CERTIFICATE_H 28 | -------------------------------------------------------------------------------- /update-client-hub/update-client-hub/update_client_public.h: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Copyright 2016-2017 ARM Ltd. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // ---------------------------------------------------------------------------- 18 | 19 | #ifndef ARM_UPDATE_CLIENT_PUBLIC_H 20 | #define ARM_UPDATE_CLIENT_PUBLIC_H 21 | 22 | #include "update-client-common/arm_uc_public.h" 23 | 24 | #endif /* ARM_UPDATE_CLIENT_PUBLIC_H */ 25 | -------------------------------------------------------------------------------- /zephyr/Kconfig: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 Pelion. 2 | # Copyright (c) 2022 Izuma Networks 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | menuconfig IZUMA_CLIENT 6 | bool "Izuma Device Management Client Library" 7 | 8 | depends on NEWLIB_LIBC 9 | depends on CPLUSPLUS 10 | depends on LIB_CPLUSPLUS 11 | 12 | select REBOOT 13 | select MPU_ALLOW_FLASH_WRITE 14 | select IZUMA_SOURCES 15 | 16 | if IZUMA_CLIENT 17 | 18 | config IZUMA_SOURCES 19 | bool "Build Izuma client from sources" 20 | help 21 | Build Izuma client from sources. 22 | 23 | config APP_LINK_WITH_IZUMA_CLIENT 24 | bool "Link application with Izuma client" 25 | depends on IZUMA_SOURCES 26 | default y 27 | help 28 | Request Zephyr to link the Izuma client library with the application. 29 | 30 | if IZUMA_SOURCES 31 | rsource "Kconfig.client" 32 | rsource "Kconfig.mbedtls" 33 | rsource "Kconfig.pal" 34 | endif 35 | 36 | endif 37 | -------------------------------------------------------------------------------- /zephyr/Kconfig.mbedtls: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 Pelion. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | menu "Mbed TLS options" 5 | 6 | config IZUMA_MBEDTLS_FILE 7 | bool "Built-in Mbed TLS, configuration from file" 8 | select MBEDTLS 9 | 10 | if IZUMA_MBEDTLS_FILE 11 | config MBEDTLS_CFG_FILE 12 | string "Use built-in Mbed TLS with configuration file" 13 | default "config-tls-pelion.h" if IZUMA_MBEDTLS_FILE 14 | endif 15 | 16 | config IZUMA_MBEDTLS_LIB_NAME 17 | string 18 | default "mbedTLS" if MBEDTLS 19 | help 20 | This option allows to specify one or more mbedtls library files to be 21 | linked with Izuma DM. Separate multiple values with space " ". 22 | 23 | endmenu 24 | -------------------------------------------------------------------------------- /zephyr/config/zephyr_update.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2021 Pelion 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef ZEPHYR_UPDATE_H 17 | #define ZEPHYR_UPDATE_H 18 | 19 | /** 20 | * Only enable flag when building Update Client Hub. 21 | */ 22 | #ifdef ARM_UPDATE_CONFIG_H 23 | #define TARGET_LIKE_MBED 1 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /zephyr/module.yml: -------------------------------------------------------------------------------- 1 | build: 2 | cmake: zephyr/cmake 3 | --------------------------------------------------------------------------------