├── .gitignore ├── LICENSE ├── README.md ├── README_ZH.md ├── SConscript ├── docs ├── README.md ├── api.md ├── figures │ ├── AliLinkDevelopAddDbgDevice.png │ ├── AliLinkDevelopAddDbgDevice1.png │ ├── AliLinkDevelopAddDev.png │ ├── AliLinkDevelopAddDevProperity.png │ ├── AliLinkDevelopAddPrj.png │ ├── AliLinkDevelopCreatePrj.png │ ├── AliLinkDevelopCreateProduct.png │ ├── AliLinkDevelopCreateProduct1.png │ ├── AliLinkDevelopCreateProduct2.png │ ├── AliLinkDevelopCreateProduct3.png │ ├── AliLinkDevelopCreateProduct4.png │ ├── AliLinkDevelopDbgConsole.png │ ├── AliLinkDevelopDevLog.png │ ├── AliLinkDevelopGetLicense.png │ ├── AliLinkDevelopOTAAddFirmware.png │ ├── AliLinkDevelopOTAPrecess.png │ ├── AliLinkDevelopOTAUpgradSuccess.png │ ├── AliLinkDevelopOTAUpgrading.png │ ├── AliLinkDevelopOTAVerifyFw.png │ ├── AliLinkDevelopOpenDbgConsole.png │ ├── AliLinkDevelopReg.png │ ├── AliLinkDevelopViewDev1.png │ ├── AliLinkDevelopViewMQTTMsg.png │ ├── AliLinkLinkPlatformCoapPrecess.png │ ├── AliLinkPlatformAddDevice.png │ ├── AliLinkPlatformAddOTAFw.png │ ├── AliLinkPlatformCloudPubMsg.png │ ├── AliLinkPlatformCreateProduct.png │ ├── AliLinkPlatformCustomTopic.png │ ├── AliLinkPlatformDeviceOnlineProcess.png │ ├── AliLinkPlatformEnableFwOTAserivices.png │ ├── AliLinkPlatformEnableFwOTAserivices1.png │ ├── AliLinkPlatformGetLicense.png │ ├── AliLinkPlatformLogConsole.png │ ├── AliLinkPlatformMQTTSequence.png │ ├── AliLinkPlatformOTASuccess.png │ ├── AliLinkPlatformOTAUpgrading.png │ ├── AliLinkPlatformOTAVerifyFw.png │ ├── AliLinkPlatformReg.png │ ├── AliLinkPlatformViewDeviceInfo.png │ ├── AliLinkPlatformViewDeviceInfo1.png │ ├── AliLinkPlatformViewDeviceLog.png │ ├── AliLinkPlatformViewOTAProcess.png │ ├── AliLinkPlatformViewTopicList.png │ ├── AliyunIoTKitSDKArch_AFDdedfafe3gvdas.png │ └── AliyunIoTPlatformSceneArchitecture_dae1q2wqsddeewdr.png ├── introduction.md ├── principle.md ├── samples.md ├── user-guide.md └── version.md ├── iotkit-embedded ├── .gitignore ├── LICENSE ├── README.md ├── certs │ ├── iot.mk │ └── root_ca.c ├── config.bat ├── external_libs │ ├── mbedtls │ │ ├── include │ │ │ ├── .gitignore │ │ │ └── mbedtls │ │ │ │ ├── aes.h │ │ │ │ ├── asn1.h │ │ │ │ ├── base64.h │ │ │ │ ├── bignum.h │ │ │ │ ├── bn_mul.h │ │ │ │ ├── check_config.h │ │ │ │ ├── cipher.h │ │ │ │ ├── cipher_internal.h │ │ │ │ ├── config.h │ │ │ │ ├── ctr_drbg.h │ │ │ │ ├── debug.h │ │ │ │ ├── des.h │ │ │ │ ├── ecp.h │ │ │ │ ├── entropy.h │ │ │ │ ├── entropy_poll.h │ │ │ │ ├── error.h │ │ │ │ ├── md.h │ │ │ │ ├── md5.h │ │ │ │ ├── md_internal.h │ │ │ │ ├── net.h │ │ │ │ ├── net_sockets.h │ │ │ │ ├── oid.h │ │ │ │ ├── pem.h │ │ │ │ ├── pk.h │ │ │ │ ├── pk_internal.h │ │ │ │ ├── platform.h │ │ │ │ ├── rsa.h │ │ │ │ ├── sha1.h │ │ │ │ ├── sha256.h │ │ │ │ ├── ssl.h │ │ │ │ ├── ssl_ciphersuites.h │ │ │ │ ├── ssl_cookie.h │ │ │ │ ├── ssl_internal.h │ │ │ │ ├── timing.h │ │ │ │ ├── x509.h │ │ │ │ ├── x509_crl.h │ │ │ │ └── x509_crt.h │ │ ├── iot.mk │ │ └── library │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── aes.c │ │ │ ├── asn1parse.c │ │ │ ├── base64.c │ │ │ ├── bignum.c │ │ │ ├── cipher.c │ │ │ ├── cipher_wrap.c │ │ │ ├── ctr_drbg.c │ │ │ ├── debug.c │ │ │ ├── entropy.c │ │ │ ├── entropy_poll.c │ │ │ ├── error.c │ │ │ ├── md.c │ │ │ ├── md_wrap.c │ │ │ ├── net_sockets.c │ │ │ ├── oid.c │ │ │ ├── pem.c │ │ │ ├── pk.c │ │ │ ├── pk_wrap.c │ │ │ ├── pkparse.c │ │ │ ├── platform.c │ │ │ ├── rsa.c │ │ │ ├── sha1.c │ │ │ ├── sha256.c │ │ │ ├── ssl_ciphersuites.c │ │ │ ├── ssl_cli.c │ │ │ ├── ssl_cookie.c │ │ │ ├── ssl_tls.c │ │ │ ├── timing.c │ │ │ ├── x509.c │ │ │ └── x509_crt.c │ └── nghttp2 │ │ ├── iot.mk │ │ ├── nghttp2.h │ │ ├── nghttp2_buf.c │ │ ├── nghttp2_buf.h │ │ ├── nghttp2_callbacks.c │ │ ├── nghttp2_callbacks.h │ │ ├── nghttp2_debug.c │ │ ├── nghttp2_debug.h │ │ ├── nghttp2_frame.c │ │ ├── nghttp2_frame.h │ │ ├── nghttp2_hd.c │ │ ├── nghttp2_hd.h │ │ ├── nghttp2_hd_huffman.c │ │ ├── nghttp2_hd_huffman.h │ │ ├── nghttp2_hd_huffman_data.c │ │ ├── nghttp2_helper.c │ │ ├── nghttp2_helper.h │ │ ├── nghttp2_http.c │ │ ├── nghttp2_http.h │ │ ├── nghttp2_int.h │ │ ├── nghttp2_map.c │ │ ├── nghttp2_map.h │ │ ├── nghttp2_mem.c │ │ ├── nghttp2_mem.h │ │ ├── nghttp2_net.c │ │ ├── nghttp2_net.h │ │ ├── nghttp2_npn.c │ │ ├── nghttp2_npn.h │ │ ├── nghttp2_option.c │ │ ├── nghttp2_option.h │ │ ├── nghttp2_outbound_item.c │ │ ├── nghttp2_outbound_item.h │ │ ├── nghttp2_pq.c │ │ ├── nghttp2_pq.h │ │ ├── nghttp2_priority_spec.c │ │ ├── nghttp2_priority_spec.h │ │ ├── nghttp2_queue.c │ │ ├── nghttp2_queue.h │ │ ├── nghttp2_rcbuf.c │ │ ├── nghttp2_rcbuf.h │ │ ├── nghttp2_session.c │ │ ├── nghttp2_session.h │ │ ├── nghttp2_stream.c │ │ ├── nghttp2_stream.h │ │ ├── nghttp2_submit.c │ │ ├── nghttp2_submit.h │ │ ├── nghttp2_version.c │ │ └── nghttp2ver.h ├── extract.bat ├── extract.sh ├── make.settings ├── makefile ├── model.json ├── src │ ├── atm │ │ ├── at_api.c │ │ ├── at_api.h │ │ ├── at_conn_mbox.c │ │ ├── at_conn_mbox.h │ │ ├── at_conn_mgmt.c │ │ ├── at_conn_mgmt.h │ │ ├── at_mqtt.c │ │ ├── at_mqtt.h │ │ ├── at_parser.c │ │ ├── at_parser.h │ │ ├── at_tcp.c │ │ ├── at_wrapper.h │ │ └── iot.mk │ ├── coap │ │ ├── CoAPPacket │ │ │ ├── CoAPDeserialize.h │ │ │ ├── CoAPDeserialize_common.c │ │ │ ├── CoAPMessage_common.c │ │ │ ├── CoAPPlatform.h │ │ │ ├── CoAPSerialize.h │ │ │ └── CoAPSerialize_common.c │ │ ├── client │ │ │ ├── Cloud_CoAPExport.h │ │ │ ├── Cloud_CoAPMessage.h │ │ │ ├── Cloud_CoAPNetwork.h │ │ │ ├── Cloud_CoAPPlatform.h │ │ │ ├── CoAPExport.c │ │ │ ├── CoAPMessage.c │ │ │ ├── CoAPNetwork.c │ │ │ ├── README.md │ │ │ └── iotx_coap_api.c │ │ ├── coap_api.h │ │ ├── coap_wrapper.h │ │ ├── examples │ │ │ └── coap_example.c │ │ ├── iot.mk │ │ ├── iotx_coap.h │ │ ├── iotx_coap_config.h │ │ ├── iotx_coap_internal.h │ │ └── server │ │ │ ├── CoAPExport.c │ │ │ ├── CoAPExport.h │ │ │ ├── CoAPInternal.h │ │ │ ├── CoAPMessage.c │ │ │ ├── CoAPMessage.h │ │ │ ├── CoAPNetwork.c │ │ │ ├── CoAPNetwork.h │ │ │ ├── CoAPObserve.c │ │ │ ├── CoAPObserve.h │ │ │ ├── CoAPPlatform.c │ │ │ ├── CoAPResource.c │ │ │ ├── CoAPResource.h │ │ │ ├── CoAPServer.c │ │ │ ├── CoAPServer.h │ │ │ └── README.md │ ├── dev_bind │ │ ├── dev_bind_api.h │ │ ├── dev_bind_wrapper.h │ │ ├── impl │ │ │ ├── awss_bind.c │ │ │ ├── awss_bind_statis.c │ │ │ ├── awss_bind_statis.h │ │ │ ├── awss_cmp.h │ │ │ ├── awss_cmp_coap.c │ │ │ ├── awss_cmp_mqtt.c │ │ │ ├── awss_event.c │ │ │ ├── awss_event.h │ │ │ ├── awss_info.c │ │ │ ├── awss_info.h │ │ │ ├── awss_log.h │ │ │ ├── awss_notify.c │ │ │ ├── awss_notify.h │ │ │ ├── awss_packet.c │ │ │ ├── awss_packet.h │ │ │ ├── awss_report.c │ │ │ ├── awss_reset.h │ │ │ ├── awss_reset │ │ │ │ ├── awss_dev_reset.c │ │ │ │ ├── awss_dev_reset.h │ │ │ │ └── awss_dev_reset_internal.h │ │ │ ├── awss_timer.c │ │ │ ├── awss_timer.h │ │ │ ├── awss_utils.h │ │ │ ├── dev_bind_internal.h │ │ │ ├── iot_import_awss.h │ │ │ ├── os │ │ │ │ ├── os.h │ │ │ │ └── os_misc.c │ │ │ ├── passwd.c │ │ │ └── passwd.h │ │ └── iot.mk │ ├── dev_model │ │ ├── alcs │ │ │ ├── README.md │ │ │ ├── alcs_adapter.c │ │ │ ├── alcs_adapter.h │ │ │ ├── alcs_api.c │ │ │ ├── alcs_api.h │ │ │ ├── alcs_api_internal.h │ │ │ ├── alcs_base64.c │ │ │ ├── alcs_base64.h │ │ │ ├── alcs_client.c │ │ │ ├── alcs_coap.c │ │ │ ├── alcs_coap.h │ │ │ ├── alcs_internal.h │ │ │ ├── alcs_localsetup.c │ │ │ ├── alcs_localsetup.h │ │ │ ├── alcs_mqtt.c │ │ │ ├── alcs_mqtt.h │ │ │ ├── alcs_server.c │ │ │ ├── iotx_alcs.h │ │ │ └── iotx_alcs_config.h │ │ ├── client │ │ │ ├── dm_client.c │ │ │ ├── dm_client.h │ │ │ ├── dm_client_adapter.c │ │ │ └── dm_client_adapter.h │ │ ├── deprecated │ │ │ ├── impl_gateway.c │ │ │ ├── impl_gateway.h │ │ │ ├── impl_ntp.c │ │ │ ├── impl_ntp.h │ │ │ ├── impl_solo.c │ │ │ ├── impl_solo.h │ │ │ ├── iot_export_linkkit.h │ │ │ ├── linkkit_export.h │ │ │ └── linkkit_gateway_export.h │ │ ├── dev_model_api.h │ │ ├── dm_api.c │ │ ├── dm_cota.c │ │ ├── dm_cota.h │ │ ├── dm_fota.c │ │ ├── dm_fota.h │ │ ├── dm_intf.h │ │ ├── dm_ipc.c │ │ ├── dm_ipc.h │ │ ├── dm_log_report.c │ │ ├── dm_manager.c │ │ ├── dm_manager.h │ │ ├── dm_message.c │ │ ├── dm_message.h │ │ ├── dm_message_cache.c │ │ ├── dm_message_cache.h │ │ ├── dm_msg_process.c │ │ ├── dm_msg_process.h │ │ ├── dm_opt.c │ │ ├── dm_opt.h │ │ ├── dm_ota.c │ │ ├── dm_ota.h │ │ ├── dm_shadow.c │ │ ├── dm_shadow.h │ │ ├── dm_tsl_alink.c │ │ ├── dm_tsl_alink.h │ │ ├── dm_utils.c │ │ ├── dm_utils.h │ │ ├── dm_wrapper.h │ │ ├── examples │ │ │ ├── cJSON.c │ │ │ ├── cJSON.h │ │ │ ├── data │ │ │ │ ├── cntdown_tsl.data │ │ │ │ ├── sched_tsl.data │ │ │ │ └── solo_tsl.c │ │ │ ├── gateway.c │ │ │ ├── linkkit_example_gateway.c │ │ │ ├── linkkit_example_solo.c │ │ │ ├── model_for_examples.json │ │ │ └── solo.c │ │ ├── impl_linkkit.c │ │ ├── iot.mk │ │ ├── iotx_cm.c │ │ ├── iotx_cm.h │ │ ├── iotx_cm_coap.c │ │ ├── iotx_cm_coap.h │ │ ├── iotx_cm_internal.h │ │ ├── iotx_cm_mqtt.c │ │ ├── iotx_cm_mqtt.h │ │ ├── iotx_dm.h │ │ ├── iotx_dm_config.h │ │ ├── iotx_dm_internal.h │ │ ├── iotx_log_report.h │ │ └── server │ │ │ ├── dm_server.c │ │ │ ├── dm_server.h │ │ │ ├── dm_server_adapter.c │ │ │ └── dm_server_adapter.h │ ├── dev_reset │ │ ├── dev_reset.c │ │ ├── dev_reset_api.h │ │ ├── dev_reset_internal.h │ │ ├── dev_reset_wrapper.h │ │ ├── examples │ │ │ └── dev_reset_example.c │ │ └── iot.mk │ ├── dev_sign │ │ ├── dev_sign_api.h │ │ ├── dev_sign_config.h │ │ ├── dev_sign_internal.h │ │ ├── dev_sign_mqtt.c │ │ ├── dev_sign_wrapper.h │ │ ├── examples │ │ │ └── dev_sign_example.c │ │ └── iot.mk │ ├── dynamic_register │ │ ├── dynreg.c │ │ ├── dynreg_api.h │ │ ├── dynreg_internal.h │ │ ├── dynreg_wrapper.h │ │ ├── examples │ │ │ └── dynreg_example.c │ │ └── iot.mk │ ├── http │ │ ├── README.md │ │ ├── examples │ │ │ └── http_example.c │ │ ├── http_api.h │ │ ├── http_debug.h │ │ ├── http_wrapper.h │ │ ├── iot.mk │ │ └── iotx_http_api.c │ ├── http2 │ │ ├── examples │ │ │ ├── http2_example_break_resume.c │ │ │ ├── http2_example_stream.c │ │ │ └── http2_example_uploadfile.c │ │ ├── http2_api.c │ │ ├── http2_api.h │ │ ├── http2_config.h │ │ ├── http2_internal.h │ │ ├── http2_upload_api.c │ │ ├── http2_upload_api.h │ │ ├── http2_wrapper.h │ │ ├── iot.mk │ │ └── iotx_http2.c │ ├── infra │ │ ├── infra_aes.c │ │ ├── infra_aes.h │ │ ├── infra_aes_config.h │ │ ├── infra_cjson.c │ │ ├── infra_cjson.h │ │ ├── infra_compat.c │ │ ├── infra_compat.h │ │ ├── infra_config.h │ │ ├── infra_defs.c │ │ ├── infra_defs.h │ │ ├── infra_httpc.c │ │ ├── infra_httpc.h │ │ ├── infra_json_parser.c │ │ ├── infra_json_parser.h │ │ ├── infra_list.h │ │ ├── infra_log.c │ │ ├── infra_log.h │ │ ├── infra_md5.c │ │ ├── infra_md5.h │ │ ├── infra_mem_stats.c │ │ ├── infra_mem_stats.h │ │ ├── infra_net.c │ │ ├── infra_net.h │ │ ├── infra_preauth.c │ │ ├── infra_preauth.h │ │ ├── infra_prt_nwk_payload.c │ │ ├── infra_report.c │ │ ├── infra_report.h │ │ ├── infra_sha1.c │ │ ├── infra_sha1.h │ │ ├── infra_sha256.c │ │ ├── infra_sha256.h │ │ ├── infra_string.c │ │ ├── infra_string.h │ │ ├── infra_timer.c │ │ ├── infra_timer.h │ │ ├── infra_types.h │ │ └── iot.mk │ ├── mqtt │ │ ├── examples │ │ │ ├── mqtt_example.c │ │ │ └── mqtt_example_at.c │ │ ├── impl │ │ │ ├── MQTTConnect.h │ │ │ ├── MQTTConnectClient.c │ │ │ ├── MQTTDeserializePublish.c │ │ │ ├── MQTTPacket.c │ │ │ ├── MQTTPacket.h │ │ │ ├── MQTTPublish.h │ │ │ ├── MQTTSerializePublish.c │ │ │ ├── MQTTSubscribe.h │ │ │ ├── MQTTSubscribeClient.c │ │ │ ├── MQTTUnsubscribe.h │ │ │ ├── MQTTUnsubscribeClient.c │ │ │ ├── iotx_mqtt_client.c │ │ │ ├── iotx_mqtt_client.h │ │ │ ├── iotx_mqtt_config.h │ │ │ └── mqtt_internal.h │ │ ├── iot.mk │ │ ├── mqtt_api.c │ │ ├── mqtt_api.h │ │ └── mqtt_wrapper.h │ ├── ota │ │ ├── examples │ │ │ └── ota_example_mqtt.c │ │ ├── iot.mk │ │ ├── iotx_ota.c │ │ ├── iotx_ota.h │ │ ├── iotx_ota_config.h │ │ ├── iotx_ota_internal.h │ │ ├── ota_api.h │ │ ├── ota_coap.c │ │ ├── ota_fetch.c │ │ ├── ota_lib.c │ │ ├── ota_mqtt.c │ │ └── ota_wrapper.h │ └── wifi_provision │ │ ├── dev_ap │ │ ├── awss_dev_ap.c │ │ ├── awss_dev_ap.h │ │ └── dev_ap_wrapper.h │ │ ├── frameworks │ │ ├── aplist │ │ │ ├── awss_aplist.c │ │ │ └── awss_aplist.h │ │ ├── aws_lib.h │ │ ├── awss.c │ │ ├── awss_main.c │ │ ├── awss_main.h │ │ ├── awss_smartconfig.h │ │ ├── ieee80211 │ │ │ ├── zconfig_ieee80211.c │ │ │ └── zconfig_ieee80211.h │ │ ├── statics │ │ │ ├── awss_statis.c │ │ │ └── awss_statis.h │ │ ├── utils │ │ │ ├── awss_aes_wrapper.c │ │ │ ├── awss_aes_wrapper.h │ │ │ ├── awss_crypt.c │ │ │ ├── awss_crypt.h │ │ │ ├── zconfig_utils.c │ │ │ └── zconfig_utils.h │ │ ├── zconfig_lib.h │ │ ├── zconfig_protocol.c │ │ ├── zconfig_protocol.h │ │ └── zconfig_vendor_common.c │ │ ├── ht40 │ │ ├── awss_ht40.c │ │ └── awss_ht40.h │ │ ├── iot.mk │ │ ├── p2p │ │ ├── awss_wps.c │ │ ├── awss_wps.h │ │ └── p2p_wrapper.h │ │ ├── phone_ap │ │ ├── aha_wrapper.h │ │ ├── awss_aha.c │ │ ├── awss_aha.h │ │ ├── awss_wifimgr.c │ │ └── awss_wifimgr.h │ │ ├── router_ap │ │ ├── awss_adha.c │ │ └── awss_adha.h │ │ ├── smartconfig │ │ ├── awss_smartconfig.c │ │ └── smartconfig_wrapper.h │ │ ├── wifi_provision_api.h │ │ ├── wifi_provision_internal.h │ │ └── zero_config │ │ ├── awss_enrollee.c │ │ ├── awss_enrollee.h │ │ ├── awss_registrar.c │ │ └── zeroconfig_wrapper.h ├── tools │ ├── Config.in │ ├── board │ │ ├── config.alios.esp8266 │ │ ├── config.alios.mk3080 │ │ └── config.ubuntu.x86 │ ├── build-rules │ │ ├── _rules-complib.mk │ │ ├── _rules-coverage.mk │ │ ├── _rules-dist.mk │ │ ├── _rules-flat.mk │ │ ├── _rules-kmod.mk │ │ ├── _rules-libs.mk │ │ ├── _rules-modinfo.mk │ │ ├── _rules-origin.mk │ │ ├── _rules-prefix.mk │ │ ├── _rules-prog.mk │ │ ├── _rules-repo.mk │ │ ├── _rules-submods.mk │ │ ├── _rules-top.mk │ │ ├── docs │ │ │ └── Help.md │ │ ├── funcs.mk │ │ ├── hooks │ │ │ └── pre-commit │ │ ├── misc │ │ │ ├── Doxyfile.tpl │ │ │ ├── config.generic.cmake │ │ │ ├── config.generic.default │ │ │ ├── cut.c │ │ │ └── cut.h │ │ ├── pre-build.sh │ │ ├── rules.mk │ │ ├── scripts │ │ │ ├── add_license.sh │ │ │ ├── del_license.sh │ │ │ ├── exe_coverage_progs.sh │ │ │ ├── gen_cross_toolchain.sh │ │ │ ├── gen_lcov_report.sh │ │ │ ├── gen_one_makefile.sh │ │ │ ├── gen_rom_stats.sh │ │ │ ├── gen_sub_cmake.sh │ │ │ ├── gen_top_cmake.sh │ │ │ └── ops_repository.sh │ │ └── settings.mk │ ├── default_settings.mk │ ├── internal_make_funcs.mk │ ├── menu │ │ ├── Config.atm │ │ ├── Config.coap │ │ ├── Config.dev_bind │ │ ├── Config.dev_model │ │ ├── Config.dev_reset │ │ ├── Config.dev_sign │ │ ├── Config.dynamic_register │ │ ├── Config.http │ │ ├── Config.http2 │ │ ├── Config.infra │ │ ├── Config.mqtt │ │ ├── Config.ota │ │ ├── Config.wifi_provision │ │ └── Config.wrappers │ ├── misc │ │ ├── JSON.sh │ │ ├── compose.sh │ │ ├── linkkit_example_auto.c │ │ ├── makefile.output │ │ ├── wrapper │ │ ├── xtrc_file_rules │ │ └── xtrc_wrapper_rules │ ├── mock_build_options.mk │ ├── parse_make_settings.mk │ ├── prebuilt │ │ ├── macos │ │ │ └── kconfig-frontends-mac │ │ │ │ ├── .libs │ │ │ │ ├── kconfig-conf │ │ │ │ ├── kconfig-mconf │ │ │ │ └── libkconfig-parser-4.11.0.dylib │ │ │ │ ├── AUTHORS │ │ │ │ ├── COPYING │ │ │ │ ├── kconfig-conf │ │ │ │ ├── kconfig-language.txt │ │ │ │ └── kconfig-mconf │ │ ├── ubuntu │ │ │ ├── bin │ │ │ │ ├── gawk │ │ │ │ └── kconfig-mconf │ │ │ └── libs │ │ │ │ ├── libalicrypto.a │ │ │ │ ├── libcurl.a │ │ │ │ ├── libcurl.so │ │ │ │ ├── libid2client.a │ │ │ │ ├── libitls.a │ │ │ │ ├── libkm.a │ │ │ │ ├── libmbedcrypto.a │ │ │ │ └── libplat_gen.a │ │ └── windows │ │ │ ├── kconfig-frontends-3.12.0-windows │ │ │ ├── COPYING │ │ │ ├── README │ │ │ ├── kconfig-mconf.exe │ │ │ ├── libiconv2.dll │ │ │ ├── libintl3.dll │ │ │ └── regex2.dll │ │ │ └── shell.w32-ix86 │ │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ │ ├── MSVCRT40.DLL │ │ │ ├── Psapi.Dll │ │ │ ├── ansi2knr.exe │ │ │ ├── basename.exe │ │ │ ├── bash.exe │ │ │ ├── bc.exe │ │ │ ├── bison.exe │ │ │ ├── cat.exe │ │ │ ├── chgrp.exe │ │ │ ├── chmod.exe │ │ │ ├── chown.exe │ │ │ ├── cksum.exe │ │ │ ├── cmp.exe │ │ │ ├── comm.exe │ │ │ ├── cp.exe │ │ │ ├── cpp.exe │ │ │ ├── csplit.exe │ │ │ ├── curl-ca-bundle.crt │ │ │ ├── curl.exe │ │ │ ├── cut.exe │ │ │ ├── cygwin1.dll │ │ │ ├── cygwinb19.dll │ │ │ ├── date.exe │ │ │ ├── dc.exe │ │ │ ├── dd.exe │ │ │ ├── df.exe │ │ │ ├── diff.exe │ │ │ ├── diff3.exe │ │ │ ├── dircolors.exe │ │ │ ├── dirname.exe │ │ │ ├── du.exe │ │ │ ├── echo.exe │ │ │ ├── egrep.exe │ │ │ ├── env.exe │ │ │ ├── expand.exe │ │ │ ├── expr.exe │ │ │ ├── factor.exe │ │ │ ├── false │ │ │ ├── fgrep.exe │ │ │ ├── find.exe │ │ │ ├── flex.exe │ │ │ ├── fltcr.exe │ │ │ ├── fmt.exe │ │ │ ├── fold.exe │ │ │ ├── gawk.exe │ │ │ ├── gplay.exe │ │ │ ├── grep.exe │ │ │ ├── gsar.exe │ │ │ ├── gunzip.exe │ │ │ ├── gzip.exe │ │ │ ├── head.exe │ │ │ ├── id.exe │ │ │ ├── indent.exe │ │ │ ├── install.exe │ │ │ ├── join.exe │ │ │ ├── jwhois.exe │ │ │ ├── less.exe │ │ │ ├── libcurl.dll │ │ │ ├── ln.exe │ │ │ ├── logname.exe │ │ │ ├── ls.exe │ │ │ ├── m4.exe │ │ │ ├── make.exe │ │ │ ├── md5sum.exe │ │ │ ├── mkdir.exe │ │ │ ├── mkfifo.exe │ │ │ ├── mknod.exe │ │ │ ├── more.exe │ │ │ ├── mv.exe │ │ │ ├── mvdir.exe │ │ │ ├── nl.exe │ │ │ ├── od.exe │ │ │ ├── paste.exe │ │ │ ├── patch.exe │ │ │ ├── pr.exe │ │ │ ├── printenv.exe │ │ │ ├── printf.exe │ │ │ ├── pwd.exe │ │ │ ├── recode.exe │ │ │ ├── rm.exe │ │ │ ├── rman.exe │ │ │ ├── rmdir.exe │ │ │ ├── sdiff.exe │ │ │ ├── sed.exe │ │ │ ├── seq.exe │ │ │ ├── sh.exe │ │ │ ├── shar.exe │ │ │ ├── sleep.exe │ │ │ ├── sort.exe │ │ │ ├── split.exe │ │ │ ├── start_shell.bat │ │ │ ├── su.exe │ │ │ ├── sum.exe │ │ │ ├── sync.exe │ │ │ ├── tac.exe │ │ │ ├── tail.exe │ │ │ ├── tar.exe │ │ │ ├── tee.exe │ │ │ ├── test.exe │ │ │ ├── touch.exe │ │ │ ├── tr.exe │ │ │ ├── true │ │ │ ├── type.exe │ │ │ ├── uname.exe │ │ │ ├── unexpand.exe │ │ │ ├── uniq.exe │ │ │ ├── unshar.exe │ │ │ ├── unzip.exe │ │ │ ├── uudecode.exe │ │ │ ├── uuencode.exe │ │ │ ├── vi.exe │ │ │ ├── wc.exe │ │ │ ├── wget.exe │ │ │ ├── which.exe │ │ │ ├── whoami.exe │ │ │ ├── win32gnu.dll │ │ │ ├── xargs.exe │ │ │ └── yes.exe │ └── project.mk └── wrappers │ ├── atm │ ├── at_mqtt │ │ ├── mqtt_ica.c │ │ └── mqtt_sim800.c │ └── at_tcp │ │ ├── mk3060.c │ │ └── sim800.c │ ├── iot.mk │ ├── iotx_hal_internal.h │ ├── os │ ├── freertos │ │ └── HAL_OS_Freertos.c │ ├── nos │ │ └── HAL_Nos.c │ ├── nucleus │ │ ├── HAL_OS_nucleus.c │ │ └── HAL_TCP_nucleus.c │ └── ubuntu │ │ ├── HAL_AWSS_linux.c │ │ ├── HAL_Crypt_Linux.c │ │ ├── HAL_FS_Linux.c │ │ ├── HAL_KV_linux.c │ │ ├── HAL_OS_linux.c │ │ ├── HAL_TCP_linux.c │ │ ├── HAL_UART_linux.c │ │ └── HAL_UDP_linux.c │ ├── tls │ ├── HAL_DTLS_mbedtls.c │ └── HAL_TLS_mbedtls.c │ └── wrappers_defs.h ├── ports ├── rtthread │ ├── HAL_Crypt_rtthread.c │ ├── HAL_OS_rtthread.c │ ├── HAL_TCP_rtthread.c │ └── HAL_UDP_rtthread.c ├── tls │ └── mbedtls │ │ ├── HAL_DTLS_mbedtls.c │ │ └── HAL_TLS_mbedtls.c └── wrapper.c └── samples ├── coap └── coap_example.c ├── dev_model ├── data │ ├── cntdown_tsl.data │ ├── sched_tsl.data │ └── solo_tsl.c ├── gateway.c ├── linkkit_example_gateway.c ├── linkkit_example_solo.c ├── model_for_examples.json └── solo.c ├── mqtt └── mqtt-example.c └── ota └── ota_mqtt-example.c /.gitignore: -------------------------------------------------------------------------------- 1 | /.vscode 2 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # 文档 2 | 3 | ## 文档列表 4 | 5 | |**文件名** |**描述**| 6 | |:----- |:----| 7 | |[version.md](version.md) |版本信息| 8 | |[introduction.md](introduction.md) |详细介绍| 9 | |[principle.md](principle.md) |工作原理| 10 | |[user-guide.md](user-guide.md) |使用指南| 11 | |[api.md](api.md) |API 说明| 12 | |[samples.md](samples.md) |示例说明| 13 | -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopAddDbgDevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopAddDbgDevice.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopAddDbgDevice1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopAddDbgDevice1.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopAddDev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopAddDev.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopAddDevProperity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopAddDevProperity.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopAddPrj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopAddPrj.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopCreatePrj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopCreatePrj.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopCreateProduct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopCreateProduct.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopCreateProduct1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopCreateProduct1.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopCreateProduct2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopCreateProduct2.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopCreateProduct3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopCreateProduct3.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopCreateProduct4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopCreateProduct4.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopDbgConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopDbgConsole.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopDevLog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopDevLog.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopGetLicense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopGetLicense.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopOTAAddFirmware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopOTAAddFirmware.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopOTAPrecess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopOTAPrecess.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopOTAUpgradSuccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopOTAUpgradSuccess.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopOTAUpgrading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopOTAUpgrading.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopOTAVerifyFw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopOTAVerifyFw.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopOpenDbgConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopOpenDbgConsole.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopReg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopReg.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopViewDev1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopViewDev1.png -------------------------------------------------------------------------------- /docs/figures/AliLinkDevelopViewMQTTMsg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkDevelopViewMQTTMsg.png -------------------------------------------------------------------------------- /docs/figures/AliLinkLinkPlatformCoapPrecess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkLinkPlatformCoapPrecess.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformAddDevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformAddDevice.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformAddOTAFw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformAddOTAFw.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformCloudPubMsg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformCloudPubMsg.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformCreateProduct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformCreateProduct.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformCustomTopic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformCustomTopic.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformDeviceOnlineProcess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformDeviceOnlineProcess.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformEnableFwOTAserivices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformEnableFwOTAserivices.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformEnableFwOTAserivices1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformEnableFwOTAserivices1.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformGetLicense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformGetLicense.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformLogConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformLogConsole.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformMQTTSequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformMQTTSequence.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformOTASuccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformOTASuccess.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformOTAUpgrading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformOTAUpgrading.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformOTAVerifyFw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformOTAVerifyFw.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformReg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformReg.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformViewDeviceInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformViewDeviceInfo.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformViewDeviceInfo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformViewDeviceInfo1.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformViewDeviceLog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformViewDeviceLog.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformViewOTAProcess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformViewOTAProcess.png -------------------------------------------------------------------------------- /docs/figures/AliLinkPlatformViewTopicList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliLinkPlatformViewTopicList.png -------------------------------------------------------------------------------- /docs/figures/AliyunIoTKitSDKArch_AFDdedfafe3gvdas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliyunIoTKitSDKArch_AFDdedfafe3gvdas.png -------------------------------------------------------------------------------- /docs/figures/AliyunIoTPlatformSceneArchitecture_dae1q2wqsddeewdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/docs/figures/AliyunIoTPlatformSceneArchitecture_dae1q2wqsddeewdr.png -------------------------------------------------------------------------------- /docs/principle.md: -------------------------------------------------------------------------------- 1 | # 工作原理 2 | 3 | iotkit SDK 为了方便设备上云封装了丰富的连接协议,如 MQTT、CoAP、HTTP、TLS,并且对硬件平台进行了抽象,使其不收具体的硬件平台限制而更加灵活。 4 | 5 | 通常用户并不需要关心 SDK 底层的实现机制,而只需要了解设备如何通过 SDK 与云端进行数据交互即可,方便用户理解如何使用应用层 API 接口进行业务逻辑编写。这里举例展示了 MQTT 和 OTA 应用的数据交互流程。 6 | 7 | ## MQTT 数据交互流程 8 | 9 | ![MQTT 数据交互流程](./figures/AliLinkPlatformMQTTSequence.png) 10 | 11 | ## OTA 数据交互流程 12 | 13 | 以 MQTT 通道为例,固件升级流程如下图所示: 14 | 15 | ![OTA 固件升级流程](./figures/AliLinkDevelopOTAPrecess.png) 16 | 17 | -------------------------------------------------------------------------------- /docs/version.md: -------------------------------------------------------------------------------- 1 | # 版本和修订 # 2 | 3 | | **Date** | **Version** | **Author** | **Note** | 4 | | -------- | :-----: | :---- | :---- | 5 | | 2018-07-21 | v0.1 | MurphyZhao | 初始版本 | 6 | -------------------------------------------------------------------------------- /iotkit-embedded/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | *.cproject 3 | *.project 4 | *.o 5 | *.d 6 | *.lo 7 | *.gcno 8 | *.gcda 9 | /INSTALL 10 | cscope.* 11 | *.swp 12 | *.swo 13 | ltmain.sh 14 | *.kv 15 | *.bak 16 | /Default/ 17 | .O/ 18 | .config 19 | output/ 20 | ota.bin 21 | src/packages/*.git/hooks/*.sample 22 | vs_build/ 23 | .vs/ 24 | doc/html/ 25 | compile.log 26 | CMakeLists.txt.user 27 | qt_build/ 28 | .vscode/ 29 | GPATH 30 | GRTAGS 31 | GTAGS 32 | iotx-sdk-c-test/ 33 | -------------------------------------------------------------------------------- /iotkit-embedded/README.md: -------------------------------------------------------------------------------- 1 | # C-SDK 简介 2 | 3 | 设备厂商在设备上集成 `C-SDK` 后, 可以将设备安全的接入到阿里云IoT物联网平台, 从而使设备可以被阿里云IoT物联网平台进行管理 4 | 5 | 设备需要支持TCP/IP协议栈或串口通信, 以及C99标准的C库才能集成SDK, zigbee/433/KNX这样的非IP设备需要通过网关设备接入到阿里云IoT物联网平台, 网关设备需要集成C-SDK 6 | 7 | 8 | # 快速开始 9 | 10 | 用户可以通过[快速的体验C-SDK](https://code.aliyun.com/edward.yangx/public-docs/wikis/user-guide/linkkit/Quick_Start)感受如何将设备连接到阿里云物联网平台, 并如何将设备的数据发送到平台/以及如何从物联网平台接收数据 11 | 12 | 13 | # 移植说明 14 | C-SDK与OS/硬件平台无关, 全部部分用C编写, 它定义了HAL层来对接与硬件相关的功能, 因此在使用C-SDK时用户需要去实现相关的HAL函数 15 | 16 | 目前C-SDK已实现了在Linux/Windows/AliOS上HAL的实现, 同时对于一些常见的OS或者模组也进行了适配, 可以[访问此处](https://code.aliyun.com/edward.yangx/public-docs/wikis/user-guide/linkkit/Port_Guide/Porting_Overview)查看如何在相应平台上进行SDK的编译与集成 17 | 18 | 19 | # 编程文档 20 | 21 | SDK提供了一系列的编程文档来描述如何使用SDK提供的软件功能, 请[访问此处](https://code.aliyun.com/edward.yangx/public-docs/wikis/user-guide/Linkkit_User_Manual)进行了解 22 | 23 | -------------------------------------------------------------------------------- /iotkit-embedded/certs/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_cert.a 2 | -------------------------------------------------------------------------------- /iotkit-embedded/certs/root_ca.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #include 6 | 7 | const char *iotx_ca_crt = \ 8 | { 9 | \ 10 | "-----BEGIN CERTIFICATE-----\r\n" 11 | "MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\r\n" \ 12 | "A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\r\n" \ 13 | "b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\r\n" \ 14 | "MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\r\n" \ 15 | "YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\r\n" \ 16 | "aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\r\n" \ 17 | "jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\r\n" \ 18 | "xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\r\n" \ 19 | "1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\r\n" \ 20 | "snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\r\n" \ 21 | "U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\r\n" \ 22 | "9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\r\n" \ 23 | "BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\r\n" \ 24 | "AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\r\n" \ 25 | "yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE\r\n" \ 26 | "38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP\r\n" \ 27 | "AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad\r\n" \ 28 | "DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\r\n" \ 29 | "HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\r\n" \ 30 | "-----END CERTIFICATE-----" 31 | }; 32 | -------------------------------------------------------------------------------- /iotkit-embedded/config.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | chcp 437 3 | 4 | set CONFIG_=FEATURE_ 5 | 6 | .\tools\prebuilt\windows\kconfig-frontends-3.12.0-windows\kconfig-mconf.exe .\tools\Config.in 7 | 8 | if exist .config ( 9 | copy /y .config make.settings 10 | del /F .config 11 | ) 12 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/mbedtls/include/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.sln 3 | *.vcxproj 4 | mbedtls/check_config 5 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/mbedtls/include/mbedtls/net.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | 8 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) 9 | #include "mbedtls/net_sockets.h" 10 | #if defined(MBEDTLS_DEPRECATED_WARNING) 11 | #warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" 12 | #endif /* MBEDTLS_DEPRECATED_WARNING */ 13 | #endif /* !MBEDTLS_DEPRECATED_REMOVED */ 14 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/mbedtls/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_tls.a 2 | 3 | HDR_REFS += src/infra 4 | 5 | CFLAGS := $(filter-out -Wdeclaration-after-statement,$(CFLAGS)) 6 | CFLAGS := $(filter-out -ansi,$(CFLAGS)) 7 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/mbedtls/library/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | libmbed* 3 | *.sln 4 | *.vcxproj 5 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_nghttp2.a 2 | HDR_REFS += src/infra 3 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #include "nghttp2_debug.h" 7 | 8 | #include 9 | 10 | #ifdef DEBUGBUILD 11 | 12 | static void nghttp2_default_debug_vfprintf_callback(const char *fmt, 13 | va_list args) { 14 | vfprintf(stderr, fmt, args); 15 | } 16 | 17 | static nghttp2_debug_vprintf_callback static_debug_vprintf_callback = 18 | nghttp2_default_debug_vfprintf_callback; 19 | 20 | void nghttp2_debug_vprintf(const char *format, ...) { 21 | if (static_debug_vprintf_callback) { 22 | va_list args; 23 | va_start(args, format); 24 | static_debug_vprintf_callback(format, args); 25 | va_end(args); 26 | } 27 | } 28 | 29 | void nghttp2_set_debug_vprintf_callback( 30 | nghttp2_debug_vprintf_callback debug_vprintf_callback) { 31 | static_debug_vprintf_callback = debug_vprintf_callback; 32 | } 33 | 34 | #else /* !DEBUGBUILD */ 35 | 36 | void nghttp2_set_debug_vprintf_callback( 37 | nghttp2_debug_vprintf_callback debug_vprintf_callback) { 38 | (void)debug_vprintf_callback; 39 | } 40 | 41 | #endif /* !DEBUGBUILD */ 42 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_DEBUG_H 7 | #define NGHTTP2_DEBUG_H 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include 11 | #endif /* HAVE_CONFIG_H */ 12 | 13 | #include "nghttp2.h" 14 | 15 | #ifdef DEBUGBUILD 16 | #define DEBUGF(...) nghttp2_debug_vprintf(__VA_ARGS__) 17 | void nghttp2_debug_vprintf(const char *format, ...); 18 | #else 19 | #define DEBUGF(...) \ 20 | do { \ 21 | } while (0) 22 | #endif 23 | 24 | #endif /* NGHTTP2_DEBUG_H */ 25 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_int.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_INT_H 7 | #define NGHTTP2_INT_H 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include 11 | #endif /* HAVE_CONFIG_H */ 12 | 13 | #include "nghttp2.h" 14 | 15 | /* Macros, types and constants for internal use */ 16 | 17 | /* "less" function, return nonzero if |lhs| is less than |rhs|. */ 18 | typedef int (*nghttp2_less)(const void *lhs, const void *rhs); 19 | 20 | /* Internal error code. They must be in the range [-499, -100], 21 | inclusive. */ 22 | typedef enum { 23 | NGHTTP2_ERR_CREDENTIAL_PENDING = -101, 24 | NGHTTP2_ERR_IGN_HEADER_BLOCK = -103, 25 | NGHTTP2_ERR_IGN_PAYLOAD = -104, 26 | /* 27 | * Invalid HTTP header field was received but it can be treated as 28 | * if it was not received because of compatibility reasons. 29 | */ 30 | NGHTTP2_ERR_IGN_HTTP_HEADER = -105, 31 | /* 32 | * Invalid HTTP header field was received, and it is ignored. 33 | * Unlike NGHTTP2_ERR_IGN_HTTP_HEADER, this does not invoke 34 | * nghttp2_on_invalid_header_callback. 35 | */ 36 | NGHTTP2_ERR_REMOVE_HTTP_HEADER = -106 37 | } nghttp2_internal_error; 38 | 39 | #endif /* NGHTTP2_INT_H */ 40 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_MEM_H 7 | #define NGHTTP2_MEM_H 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include 11 | #endif /* HAVE_CONFIG_H */ 12 | 13 | #include "nghttp2.h" 14 | #ifdef INFRA_MEM_STATS 15 | #include "infra_mem_stats.h" 16 | #endif 17 | 18 | /* The default, system standard memory allocator */ 19 | nghttp2_mem *nghttp2_mem_default(void); 20 | 21 | /* Convenient wrapper functions to call allocator function in 22 | |mem|. */ 23 | void *nghttp2_mem_malloc(nghttp2_mem *mem, size_t size); 24 | void nghttp2_mem_free(nghttp2_mem *mem, void *ptr); 25 | void nghttp2_mem_free2(nghttp2_free free_func, void *ptr, void *mem_user_data); 26 | void *nghttp2_mem_calloc(nghttp2_mem *mem, size_t nmemb, size_t size); 27 | void *nghttp2_mem_realloc(nghttp2_mem *mem, void *ptr, size_t size); 28 | 29 | #endif /* NGHTTP2_MEM_H */ 30 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_net.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #include 7 | #include 8 | #include "nghttp2_net.h" 9 | 10 | #if IOT_BYTE_ORDER == LITTLE_ENDIAN 11 | uint32_t nghttp2_htonl(uint32_t hostlong) { 12 | uint32_t res; 13 | unsigned char *p = (unsigned char *)&res; 14 | *p++ = hostlong >> 24; 15 | *p++ = (hostlong >> 16) & 0xffu; 16 | *p++ = (hostlong >> 8) & 0xffu; 17 | *p = hostlong & 0xffu; 18 | return res; 19 | } 20 | 21 | uint16_t nghttp2_htons(uint16_t hostshort) { 22 | uint16_t res; 23 | unsigned char *p = (unsigned char *)&res; 24 | *p++ = hostshort >> 8; 25 | *p = hostshort & 0xffu; 26 | return res; 27 | } 28 | 29 | uint32_t nghttp2_ntohl(uint32_t netlong) { 30 | uint32_t res; 31 | unsigned char *p = (unsigned char *)&netlong; 32 | res = *p++ << 24; 33 | res += *p++ << 16; 34 | res += *p++ << 8; 35 | res += *p; 36 | return res; 37 | } 38 | 39 | uint16_t nghttp2_ntohs(uint16_t netshort) { 40 | uint16_t res; 41 | unsigned char *p = (unsigned char *)&netshort; 42 | res = *p++ << 8; 43 | res += *p; 44 | return res; 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_net.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_NET_H 7 | #define NGHTTP2_NET_H 8 | 9 | #ifndef LITTLE_ENDIAN 10 | #define LITTLE_ENDIAN 1234 11 | #endif 12 | 13 | #ifndef BIG_ENDIAN 14 | #define BIG_ENDIAN 4321 15 | #endif 16 | 17 | #define IOT_BYTE_ORDER LITTLE_ENDIAN 18 | 19 | #if IOT_BYTE_ORDER == BIG_ENDIAN 20 | #define nghttp2_htonl(x) (x) 21 | #define nghttp2_htons(x) (x) 22 | #define nghttp2_ntohl(x) (x) 23 | #define nghttp2_ntohs(x) (x) 24 | #else 25 | /* Windows requires ws2_32 library for ntonl family functions. We 26 | define inline functions for those function so that we don't have 27 | dependeny on that lib. */ 28 | 29 | #ifdef _MSC_VER 30 | #define STIN 31 | #else 32 | #define STIN 33 | #endif 34 | 35 | STIN uint32_t nghttp2_htonl(uint32_t hostlong); 36 | 37 | STIN uint16_t nghttp2_htons(uint16_t hostshort); 38 | 39 | STIN uint32_t nghttp2_ntohl(uint32_t netlong); 40 | 41 | STIN uint16_t nghttp2_ntohs(uint16_t netshort); 42 | 43 | #endif 44 | #endif /* NGHTTP2_NET_H */ 45 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_npn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #include "nghttp2_npn.h" 7 | 8 | #include 9 | 10 | static int select_next_protocol(unsigned char **out, unsigned char *outlen, 11 | const unsigned char *in, unsigned int inlen, 12 | const char *key, unsigned int keylen) { 13 | unsigned int i; 14 | for (i = 0; i + keylen <= inlen; i += (unsigned int)(in[i] + 1)) { 15 | if (memcmp(&in[i], key, keylen) == 0) { 16 | *out = (unsigned char *)&in[i + 1]; 17 | *outlen = in[i]; 18 | return 0; 19 | } 20 | } 21 | return -1; 22 | } 23 | 24 | #define NGHTTP2_HTTP_1_1_ALPN "\x8http/1.1" 25 | #define NGHTTP2_HTTP_1_1_ALPN_LEN (sizeof(NGHTTP2_HTTP_1_1_ALPN) - 1) 26 | 27 | int nghttp2_select_next_protocol(unsigned char **out, unsigned char *outlen, 28 | const unsigned char *in, unsigned int inlen) { 29 | if (select_next_protocol(out, outlen, in, inlen, NGHTTP2_PROTO_ALPN, 30 | NGHTTP2_PROTO_ALPN_LEN) == 0) { 31 | return 1; 32 | } 33 | if (select_next_protocol(out, outlen, in, inlen, NGHTTP2_HTTP_1_1_ALPN, 34 | NGHTTP2_HTTP_1_1_ALPN_LEN) == 0) { 35 | return 0; 36 | } 37 | return -1; 38 | } 39 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_npn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_NPN_H 7 | #define NGHTTP2_NPN_H 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include 11 | #endif /* HAVE_CONFIG_H */ 12 | 13 | #include "nghttp2.h" 14 | 15 | #endif /* NGHTTP2_NPN_H */ 16 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_priority_spec.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #include "nghttp2_priority_spec.h" 7 | 8 | void nghttp2_priority_spec_init(nghttp2_priority_spec *pri_spec, 9 | int32_t stream_id, int32_t weight, 10 | int exclusive) { 11 | pri_spec->stream_id = stream_id; 12 | pri_spec->weight = weight; 13 | pri_spec->exclusive = exclusive != 0; 14 | } 15 | 16 | void nghttp2_priority_spec_default_init(nghttp2_priority_spec *pri_spec) { 17 | pri_spec->stream_id = 0; 18 | pri_spec->weight = NGHTTP2_DEFAULT_WEIGHT; 19 | pri_spec->exclusive = 0; 20 | } 21 | 22 | int nghttp2_priority_spec_check_default(const nghttp2_priority_spec *pri_spec) { 23 | return pri_spec->stream_id == 0 && 24 | pri_spec->weight == NGHTTP2_DEFAULT_WEIGHT && pri_spec->exclusive == 0; 25 | } 26 | 27 | void nghttp2_priority_spec_normalize_weight(nghttp2_priority_spec *pri_spec) { 28 | if (pri_spec->weight < NGHTTP2_MIN_WEIGHT) { 29 | pri_spec->weight = NGHTTP2_MIN_WEIGHT; 30 | } else if (pri_spec->weight > NGHTTP2_MAX_WEIGHT) { 31 | pri_spec->weight = NGHTTP2_MAX_WEIGHT; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_priority_spec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_PRIORITY_SPEC_H 7 | #define NGHTTP2_PRIORITY_SPEC_H 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include 11 | #endif /* HAVE_CONFIG_H */ 12 | 13 | #include "nghttp2.h" 14 | 15 | /* 16 | * This function normalizes pri_spec->weight if it is out of range. 17 | * If pri_spec->weight is less than NGHTTP2_MIN_WEIGHT, it is set to 18 | * NGHTTP2_MIN_WEIGHT. If pri_spec->weight is larger than 19 | * NGHTTP2_MAX_WEIGHT, it is set to NGHTTP2_MAX_WEIGHT. 20 | */ 21 | void nghttp2_priority_spec_normalize_weight(nghttp2_priority_spec *pri_spec); 22 | 23 | #endif /* NGHTTP2_PRIORITY_SPEC_H */ 24 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_QUEUE_H 7 | #define NGHTTP2_QUEUE_H 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include "config.h" 11 | #endif /* HAVE_CONFIG_H */ 12 | 13 | #include "nghttp2.h" 14 | 15 | typedef struct nghttp2_queue_cell { 16 | void *data; 17 | struct nghttp2_queue_cell *next; 18 | } nghttp2_queue_cell; 19 | 20 | typedef struct { 21 | nghttp2_queue_cell *front, *back; 22 | } nghttp2_queue; 23 | 24 | void nghttp2_queue_init(nghttp2_queue *queue); 25 | void nghttp2_queue_free(nghttp2_queue *queue); 26 | int nghttp2_queue_push(nghttp2_queue *queue, void *data); 27 | void nghttp2_queue_pop(nghttp2_queue *queue); 28 | void *nghttp2_queue_front(nghttp2_queue *queue); 29 | void *nghttp2_queue_back(nghttp2_queue *queue); 30 | int nghttp2_queue_empty(nghttp2_queue *queue); 31 | 32 | #endif /* NGHTTP2_QUEUE_H */ 33 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_submit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2_SUBMIT_H 7 | #define NGHTTP2_SUBMIT_H 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include 11 | #endif /* HAVE_CONFIG_H */ 12 | 13 | #include "nghttp2.h" 14 | 15 | #endif /* NGHTTP2_SUBMIT_H */ 16 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2_version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifdef HAVE_CONFIG_H 7 | #include 8 | #endif /* HAVE_CONFIG_H */ 9 | 10 | #include "nghttp2.h" 11 | 12 | static nghttp2_info version = {NGHTTP2_VERSION_AGE, NGHTTP2_VERSION_NUM, 13 | NGHTTP2_VERSION, NGHTTP2_PROTO_VERSION_ID}; 14 | 15 | nghttp2_info *nghttp2_version(int least_version) { 16 | if (least_version > NGHTTP2_VERSION_NUM) 17 | return NULL; 18 | return &version; 19 | } 20 | -------------------------------------------------------------------------------- /iotkit-embedded/external_libs/nghttp2/nghttp2ver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NGHTTP2VER_H 7 | #define NGHTTP2VER_H 8 | 9 | /** 10 | * @macro 11 | * Version number of the nghttp2 library release 12 | */ 13 | #define NGHTTP2_VERSION "nghttp2" 14 | 15 | /** 16 | * @macro 17 | * Numerical representation of the version number of the nghttp2 library 18 | * release. This is a 24 bit number with 8 bits for major number, 8 bits 19 | * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. 20 | */ 21 | #define NGHTTP2_VERSION_NUM 0x013190 22 | 23 | #endif /* NGHTTP2VER_H */ 24 | -------------------------------------------------------------------------------- /iotkit-embedded/extract.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET SHELLDIR=tools\prebuilt\windows\shell.w32-ix86 4 | SET SHELL=%SHELLDIR%/bash.exe 5 | SET BASH=%SHELL% 6 | 7 | SET PATH=%SHELLDIR%;%PATH% 8 | 9 | "%SHELL%" extract.sh 10 | 11 | pause -------------------------------------------------------------------------------- /iotkit-embedded/makefile: -------------------------------------------------------------------------------- 1 | include tools/project.mk 2 | include make.settings 3 | include tools/default_settings.mk 4 | include tools/parse_make_settings.mk 5 | include $(RULE_DIR)/funcs.mk 6 | 7 | # CFLAGS += -DINSPECT_MQTT_FLOW 8 | 9 | COMP_LIB := libiot_sdk.a 10 | COMP_LIB_COMPONENTS := \ 11 | src/infra \ 12 | src/dev_sign \ 13 | 14 | $(call CompLib_Map, FEATURE_MQTT_COMM_ENABLED, src/mqtt) 15 | $(call CompLib_Map, FEATURE_COAP_CLIENT, src/coap) 16 | $(call CompLib_Map, FEATURE_COAP_SERVER, src/coap) 17 | $(call CompLib_Map, FEATURE_SUPPORT_TLS, certs) 18 | $(call CompLib_Map, FEATURE_COAP_DTLS_SUPPORT, certs) 19 | $(call CompLib_Map, FEATURE_DYNAMIC_REGISTER, src/dynamic_register) 20 | $(call CompLib_Map, FEATURE_ATM_ENABLED, src/atm) 21 | $(call CompLib_Map, FEATURE_DEV_RESET, src/dev_reset) 22 | $(call CompLib_Map, FEATURE_OTA_ENABLED, src/ota) 23 | $(call CompLib_Map, FEATURE_DEVICE_MODEL_ENABLED, src/dev_model) 24 | $(call CompLib_Map, FEATURE_HTTP_COMM_ENABLED, src/http) 25 | $(call CompLib_Map, FEATURE_DEV_BIND_ENABLED, src/dev_bind) 26 | $(call CompLib_Map, FEATURE_WIFI_PROVISION_ENABLED, src/wifi_provision) 27 | $(call CompLib_Map, FEATURE_HTTP2_COMM_ENABLED, src/http2) 28 | 29 | SUBDIRS += wrappers 30 | SUBDIRS += external_libs/mbedtls 31 | SUBDIRS += tests 32 | 33 | $(call Append_Conditional, SUBDIRS, external_libs/nghttp2, HTTP2_COMM_ENABLED) 34 | 35 | include $(RULE_DIR)/rules.mk 36 | include tools/mock_build_options.mk 37 | 38 | -------------------------------------------------------------------------------- /iotkit-embedded/src/atm/at_api.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2019 Alibaba Group Holding Limited 3 | */ 4 | 5 | #include "infra_config.h" 6 | 7 | int at_conn_init(void); 8 | int at_parser_init(void); 9 | 10 | /* See detail struct definition in at_wrapper.h */ 11 | struct at_conn_input; 12 | struct at_mqtt_input; 13 | int at_conn_input(struct at_conn_input *param); 14 | int at_mqtt_input(struct at_mqtt_input *param); 15 | 16 | int IOT_ATM_Init(void) 17 | { 18 | #ifdef AT_PARSER_ENABLED 19 | if (at_parser_init() < 0) { 20 | return -1; 21 | } 22 | #endif 23 | 24 | #ifdef AT_TCP_ENABLED 25 | if (at_conn_init() < 0) { 26 | return -1; 27 | } 28 | #endif 29 | 30 | return 0; 31 | } 32 | 33 | 34 | int IOT_ATM_Input(void * param) 35 | { 36 | int ret = -1; 37 | 38 | #if defined(AT_TCP_ENABLED) 39 | ret = at_conn_input((struct at_conn_input *)param); 40 | #elif defined(AT_MQTT_ENABLED) 41 | ret = at_mqtt_input((struct at_mqtt_input *)param); 42 | #endif 43 | 44 | return ret; 45 | } 46 | -------------------------------------------------------------------------------- /iotkit-embedded/src/atm/at_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2019 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef _AT_API_H_ 6 | #define _AT_API_H_ 7 | 8 | /** 9 | * AT module initialization. 10 | * Call this function before example starts. 11 | * at_parser or at_tcp will be initialized if enabled. 12 | * @param[in] none 13 | * 14 | * @return 0 - success, -1 - failure 15 | */ 16 | int IOT_ATM_Init(void); 17 | 18 | 19 | /** 20 | * Hand received data to ATM layer. 21 | * Call this function in low-layer HAL. 22 | * @param[in] param pointer to input struct. 23 | * See struct at_conn_input and struct at_mqtt_input 24 | * in at_wrapper.h 25 | * 26 | * @return 0 - success, -1 - failure 27 | */ 28 | int IOT_ATM_Input(void * param); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /iotkit-embedded/src/atm/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_at.a 2 | 3 | HDR_REFS := src/infra 4 | 5 | ifneq (,$(filter -DATM_ENABLED, $(CFLAGS))) 6 | LIB_SRCS_PATTERN += at_api.c 7 | 8 | ifneq (,$(filter -DAT_TCP_ENABLED, $(CFLAGS))) 9 | LIB_SRCS_PATTERN += at_conn_mbox.c at_conn_mgmt.c at_tcp.c 10 | endif 11 | 12 | ifneq (,$(filter -DAT_MQTT_ENABLED, $(CFLAGS))) 13 | LIB_SRCS_PATTERN += at_mqtt.c 14 | endif 15 | 16 | ifneq (,$(filter -DAT_PARSER_ENABLED, $(CFLAGS))) 17 | LIB_SRCS_PATTERN += at_parser.c 18 | endif 19 | endif 20 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/CoAPPacket/CoAPDeserialize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef __COAP_DESERIALIZE_H__ 8 | #define __COAP_DESERIALIZE_H__ 9 | #include 10 | #include "iotx_coap_internal.h" 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif /* __cplusplus */ 15 | 16 | int CoAPDeserialize_Message(CoAPMessage *msg, unsigned char *buf, int buflen); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif /* __cplusplus */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/CoAPPacket/CoAPPlatform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __COAP_PLATFORM_OS_H__ 6 | #define __COAP_PLATFORM_OS_H__ 7 | 8 | #include 9 | #include "iotx_coap_internal.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif /* __cplusplus */ 14 | 15 | #ifdef INFRA_MEM_STATS 16 | #include "infra_mem_stats.h" 17 | #define coap_malloc(size) LITE_malloc(size, MEM_MAGIC, "coap.local") 18 | #define coap_free(ptr) LITE_free(ptr) 19 | #else 20 | #define coap_malloc(size) HAL_Malloc(size) 21 | #define coap_free(ptr) {HAL_Free((void *)ptr);ptr = NULL;} 22 | #endif 23 | 24 | #ifdef INFRA_LOG 25 | #include "infra_log.h" 26 | #define COAP_ERR(...) log_err("coap_local", __VA_ARGS__) 27 | #define COAP_WRN(...) log_warning("coap_local", __VA_ARGS__) 28 | #define COAP_INFO(...) log_info("coap_local", __VA_ARGS__) 29 | #define COAP_TRC(...) log_debug("coap_local", __VA_ARGS__) 30 | #define COAP_DUMP(...) log_debug("coap_local", __VA_ARGS__) 31 | #define COAP_DEBUG(...) log_debug("coap_local", __VA_ARGS__) 32 | #define COAP_FLOW(...) log_flow("coap_local", __VA_ARGS__) 33 | #else 34 | #define COAP_ERR(...) 35 | #define COAP_WRN(...) 36 | #define COAP_INFO(...) 37 | #define COAP_TRC(...) 38 | #define COAP_DUMP(...) 39 | #define COAP_DEBUG(...) 40 | #define COAP_FLOW(...) 41 | #endif 42 | 43 | int platform_is_multicast(const char *ip_str); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif /* __cplusplus */ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/CoAPPacket/CoAPSerialize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef __COAP_SERIALIZE_H__ 8 | #define __COAP_SERIALIZE_H__ 9 | #include "iotx_coap_internal.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif /* __cplusplus */ 14 | 15 | unsigned short CoAPSerialize_MessageLength(CoAPMessage *msg); 16 | 17 | int CoAPSerialize_Message(CoAPMessage *msg, unsigned char *buf, unsigned short buflen); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif /* __cplusplus */ 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/client/Cloud_CoAPMessage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | 8 | #include "Cloud_CoAPExport.h" 9 | 10 | #ifndef __COAP_HANDLE_MSG_H__ 11 | #define __COAP_HANDLE_MSG_H__ 12 | 13 | int Cloud_CoAPStrOption_add(Cloud_CoAPMessage *message, unsigned short optnum, 14 | unsigned char *data, unsigned short datalen); 15 | 16 | 17 | int Cloud_CoAPUintOption_add(Cloud_CoAPMessage *message, unsigned short optnum, 18 | unsigned int data); 19 | 20 | unsigned short Cloud_CoAPMessageId_gen(Cloud_CoAPContext *context); 21 | 22 | int Cloud_CoAPMessageId_set(Cloud_CoAPMessage *message, unsigned short msgid); 23 | 24 | int Cloud_CoAPMessageType_set(Cloud_CoAPMessage *message, unsigned char type); 25 | 26 | int Cloud_CoAPMessageCode_set(Cloud_CoAPMessage *message, Cloud_CoAPMessageCode code); 27 | 28 | int Cloud_CoAPMessageToken_set(Cloud_CoAPMessage *message, unsigned char *token, 29 | unsigned char tokenlen); 30 | 31 | int Cloud_CoAPMessageUserData_set(Cloud_CoAPMessage *message, void *userdata); 32 | 33 | int Cloud_CoAPMessagePayload_set(Cloud_CoAPMessage *message, unsigned char *payload, 34 | unsigned short payloadlen); 35 | 36 | int Cloud_CoAPMessageHandler_set(Cloud_CoAPMessage *message, Cloud_CoAPRespMsgHandler handler); 37 | 38 | int Cloud_CoAPMessage_init(Cloud_CoAPMessage *message); 39 | 40 | int Cloud_CoAPMessage_destory(Cloud_CoAPMessage *message); 41 | 42 | int Cloud_CoAPMessage_send(Cloud_CoAPContext *context, Cloud_CoAPMessage *message); 43 | 44 | int Cloud_CoAPMessage_recv(Cloud_CoAPContext *context, unsigned int timeout, int readcount); 45 | 46 | int Cloud_CoAPMessage_cycle(Cloud_CoAPContext *context); 47 | 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/client/Cloud_CoAPNetwork.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #include 6 | 7 | #ifndef COAP_TRANSPORT_H__ 8 | #define COAP_TRANSPORT_H__ 9 | 10 | typedef enum { 11 | COAP_ENDPOINT_NOSEC = 0, 12 | COAP_ENDPOINT_DTLS, 13 | COAP_ENDPOINT_PSK, 14 | } coap_endpoint_type; 15 | 16 | 17 | typedef struct { 18 | DTLSContext *context; 19 | } coap_remote_session_t; 20 | 21 | 22 | typedef struct { 23 | int socket_id; 24 | coap_endpoint_type ep_type; 25 | void *context; 26 | } coap_network_t; 27 | 28 | 29 | typedef struct { 30 | coap_endpoint_type ep_type; 31 | unsigned char *p_ca_cert_pem; 32 | char *p_host; 33 | unsigned short port; 34 | } coap_network_init_t; 35 | 36 | 37 | unsigned int Cloud_CoAPNetwork_init(const coap_network_init_t *p_param, coap_network_t *p_network); 38 | 39 | 40 | unsigned int Cloud_CoAPNetwork_write(coap_network_t *p_network, 41 | const unsigned char *p_data, 42 | unsigned int datalen); 43 | 44 | int Cloud_CoAPNetwork_read(coap_network_t *network, unsigned char *data, 45 | unsigned int datalen, unsigned int timeout); 46 | 47 | unsigned int Cloud_CoAPNetwork_deinit(coap_network_t *p_network); 48 | 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/client/Cloud_CoAPPlatform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __COAP_PLATFORM_OS_H__ 6 | #define __COAP_PLATFORM_OS_H__ 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif /* __cplusplus */ 12 | 13 | #ifdef INFRA_MEM_STATS 14 | #include "infra_mem_stats.h" 15 | #define coap_malloc(size) LITE_malloc(size, MEM_MAGIC, "coap.cloud") 16 | #define coap_free(ptr) LITE_free(ptr) 17 | #else 18 | #define coap_malloc(size) HAL_Malloc(size) 19 | #define coap_free(ptr) {HAL_Free((void *)ptr);ptr = NULL;} 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif /* __cplusplus */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/client/README.md: -------------------------------------------------------------------------------- 1 | # README.md: coap cloud 2 | 3 | ## Contents 4 | 5 | ```shell 6 | . 7 | ├── aos.mk 8 | ├── Cloud_CoAPDeserialize.h 9 | ├── Cloud_CoAPExport.h 10 | ├── Cloud_CoAPMessage.h 11 | ├── Cloud_CoAPNetwork.h 12 | ├── Cloud_CoAPPlatform.h 13 | ├── Cloud_CoAPSerialize.h 14 | ├── CMakeLists.txt 15 | ├── CoAPDeserialize.c 16 | ├── CoAPExport.c 17 | ├── CoAPMessage.c 18 | ├── CoAPNetwork.c 19 | ├── CoAPSerialize.c 20 | ├── Config.in 21 | ├── iot.mk 22 | ├── iotx_ca_cert.c 23 | └── iotx_coap_api.c 24 | 25 | ``` 26 | 27 | ## Introduction 28 | Implementation of coap protocol and special customization for connecting alicloud iot platform 29 | 30 | 31 | ### Features 32 | 33 | 34 | 35 | ### Dependencies 36 | 37 | - **hal**. osal and hal to shield different os and hardware 38 | - **infra**. Authentication, net and so on tool set. 39 | 40 | ## API 41 | Please refer to [coap api](https://code.aliyun.com/edward.yangx/public-docs/wikis/user-guide/linkkit/Prog_Guide/API/CoAP_Provides#iot_coap_init) for API details. 42 | ## Reference 43 | Please refer to [coap connect](https://code.aliyun.com/edward.yangx/public-docs/wikis/user-guide/linkkit/Prog_Guide/CoAP_Connect) for example details. 44 | 45 | 46 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_coap.a 2 | HDR_REFS := src/infra 3 | LIB_SRCS_PATTERN := *.c 4 | 5 | $(call Append_Conditional, LIB_SRCS_PATTERN, client/*.c, COAP_CLIENT) 6 | $(call Append_Conditional, LIB_SRCS_PATTERN, CoAPPacket/*.c, COAP_PACKET) 7 | $(call Append_Conditional, LIB_SRCS_PATTERN, server/*.c, COAP_SERVER) 8 | 9 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 10 | 11 | $(call Append_Conditional, LIB_SRCS_EXCLUDE, examples/coap_example.c, COAP_CLIENT) 12 | $(call Append_Conditional, SRCS_coap-example, examples/coap_example.c, COAP_CLIENT) 13 | $(call Append_Conditional, TARGET, coap-example, COAP_CLIENT) -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/iotx_coap.h: -------------------------------------------------------------------------------- 1 | #include "CoAPServer.h" 2 | #include "iotx_coap_internal.h" 3 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/iotx_coap_config.h: -------------------------------------------------------------------------------- 1 | #ifndef __IOTX_COAP_CONFIG__ 2 | #define __IOTX_COAP_CONFIG__ 3 | 4 | #define COAP_MSG_MAX_TOKEN_LEN 8 5 | #define COAP_MSG_MAX_OPTION_NUM 12 6 | #define COAP_MSG_MAX_PATH_LEN 128 7 | #ifndef COAP_LARGE_MEMORY_SUPPORT 8 | #define COAP_MSG_MAX_PDU_LEN 1280 9 | #else 10 | #define COAP_MSG_MAX_PDU_LEN 4096 11 | #endif 12 | 13 | #ifndef CONFIG_COAP_AUTH_TIMEOUT 14 | #define CONFIG_COAP_AUTH_TIMEOUT (3 * 1000) 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/server/CoAPInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef __COAP_INTERNAL_H__ 8 | #define __COAP_INTERNAL_H__ 9 | #include "CoAPNetwork.h" 10 | #include "CoAPExport.h" 11 | #include "iotx_coap_internal.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif /* __cplusplus */ 16 | 17 | 18 | typedef struct 19 | { 20 | void *list_mutex; 21 | struct list_head list; 22 | unsigned char count; 23 | unsigned char maxcount; 24 | }CoAPList; 25 | 26 | 27 | typedef struct 28 | { 29 | unsigned short message_id; 30 | NetworkContext *p_network; 31 | CoAPEventNotifier notifier; 32 | unsigned char *sendbuf; 33 | unsigned char *recvbuf; 34 | CoAPList sendlist; 35 | CoAPList obsserver; 36 | CoAPList obsclient; 37 | CoAPList resource; 38 | unsigned int waittime; 39 | void *appdata; 40 | void *mutex; 41 | }CoAPIntContext; 42 | 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif /* __cplusplus */ 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/server/CoAPNetwork.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __CoAPNETWORK_H__ 6 | #define __CoAPNETWORK_H__ 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif /* __cplusplus */ 12 | 13 | 14 | typedef enum { 15 | COAP_NETWORK_NOSEC = 0, 16 | COAP_NETWORK_DTLS, 17 | } CoAPNetworkType; 18 | 19 | typedef struct { 20 | CoAPNetworkType type; 21 | unsigned short port; 22 | intptr_t fd; 23 | } NetworkConf; 24 | 25 | typedef void NetworkContext; 26 | 27 | 28 | typedef struct { 29 | CoAPNetworkType type; 30 | char *group; 31 | unsigned short port; 32 | #ifdef COAP_DTLS_SUPPORT 33 | /* TODO: */ 34 | #endif 35 | } NetworkInit; 36 | 37 | NetworkContext *CoAPNetwork_init(const NetworkInit *p_param); 38 | 39 | 40 | int CoAPNetwork_write(NetworkContext *p_context, 41 | NetworkAddr *p_remote, 42 | const unsigned char *p_data, 43 | unsigned int datalen, 44 | unsigned int timeout); 45 | 46 | int CoAPNetwork_read(NetworkContext *p_context, 47 | NetworkAddr *p_remote, 48 | unsigned char *p_data, 49 | unsigned int datalen, 50 | unsigned int timeout); 51 | 52 | void CoAPNetwork_deinit(NetworkContext *p_context); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif /* __cplusplus */ 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/server/CoAPResource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | 8 | #ifndef __COAP_RESOURCE_H__ 9 | #define __COAP_RESOURCE_H__ 10 | 11 | #include 12 | #include "iotx_coap_internal.h" 13 | #include "CoAPExport.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif /* __cplusplus */ 18 | 19 | #define COAP_MAX_PATH_CHECKSUM_LEN (5) 20 | 21 | typedef struct { 22 | unsigned short permission; 23 | CoAPRecvMsgHandler callback; 24 | unsigned int ctype; 25 | unsigned int maxage; 26 | struct list_head reslist; 27 | char path[COAP_MAX_PATH_CHECKSUM_LEN]; 28 | char *filter_path; 29 | path_type_t path_type; 30 | } CoAPResource; 31 | 32 | int CoAPResource_init(CoAPContext *context, int res_maxcount); 33 | 34 | int CoAPPathMD5_sum(const char *path, int len, char outbuf[], int outlen); 35 | 36 | int CoAPResource_register(CoAPContext *context, const char *path, 37 | unsigned short permission, unsigned int ctype, 38 | unsigned int maxage, CoAPRecvMsgHandler callback); 39 | 40 | CoAPResource *CoAPResourceByPath_get(CoAPContext *context, const char *path); 41 | int CoAPResource_topicFilterMatch(const char *filter, const char *topic); 42 | int CoAPResource_deinit(CoAPContext *context); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif /* __cplusplus */ 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/server/CoAPServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __COAP_SERVER_H__ 6 | #define __COAP_SERVER_H__ 7 | 8 | #include "CoAPExport.h" 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif /* __cplusplus */ 13 | #define COAP_SERV_MULTITHREAD 14 | 15 | CoAPContext *CoAPServer_init(); 16 | 17 | void CoAPServer_add_timer (void (*on_timer)(void*)); 18 | void CoAPServer_loop(CoAPContext *context); 19 | 20 | void CoAPServer_deinit(CoAPContext *context); 21 | 22 | int CoAPServer_register(CoAPContext *context, const char *uri, CoAPRecvMsgHandler callback); 23 | 24 | int CoAPServerMultiCast_send(CoAPContext *context, NetworkAddr *remote, const char *uri, 25 | unsigned char *buff, unsigned short len, CoAPSendMsgHandler callback, unsigned short *msgid); 26 | 27 | int CoAPServerResp_send(CoAPContext *context, NetworkAddr *remote, unsigned char *buff, unsigned short len, void *req, 28 | const char *paths, CoAPSendMsgHandler callback, unsigned short *msgid, char qos); 29 | 30 | void CoAPServer_thread_leave(); 31 | #ifdef __cplusplus 32 | } 33 | #endif /* __cplusplus */ 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /iotkit-embedded/src/coap/server/README.md: -------------------------------------------------------------------------------- 1 | # README.md: coap local 2 | 3 | ## Contents 4 | 5 | ```shell 6 | . 7 | ├── aos.mk 8 | ├── CMakeLists.txt 9 | ├── CoAPDeserialize.c 10 | ├── CoAPDeserialize.h 11 | ├── CoAPExport.c 12 | ├── CoAPExport.h 13 | ├── CoAPInternal.h 14 | ├── CoAPMessage.c 15 | ├── CoAPMessage.h 16 | ├── CoAPNetwork.c 17 | ├── CoAPNetwork.h 18 | ├── CoAPObserve.c 19 | ├── CoAPObserve.h 20 | ├── CoAPPlatform.c 21 | ├── CoAPPlatform.h 22 | ├── CoAPResource.c 23 | ├── CoAPResource.h 24 | ├── CoAPSerialize.c 25 | ├── CoAPSerialize.h 26 | ├── CoAPServer.c 27 | ├── CoAPServer.h 28 | ├── Config.in 29 | ├── iot.mk 30 | └── README.md 31 | ``` 32 | 33 | ## Introduction 34 | Implementation of coap protocol and special customization for alcs and awss 35 | 36 | 37 | ### Features 38 | 39 | 40 | ### Dependencies 41 | 42 | - **hal**. osal and hal to shield different os and hardware 43 | - **infra**. Authentication, net and so on tool set. 44 | 45 | ## API 46 | none 47 | ## Reference 48 | none 49 | 50 | 51 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/dev_bind_api.h: -------------------------------------------------------------------------------- 1 | int awss_report_cloud(void); 2 | 3 | /** 4 | ** @brief check reset flag in perisistent storage. 5 | ** 6 | ** @retval -1 : failure 7 | ** @retval 0 : sucess 8 | ** @note 9 | ** check reset flag in perisistent storage, if device failed to report reset message last time, retry it. 10 | **/ 11 | int awss_check_reset(void); 12 | 13 | /** 14 | ** @brief report reset to cloud. 15 | ** 16 | ** @retval -1 : failure 17 | ** @retval 0 : sucess 18 | ** @note 19 | ** device will save reset flag if device dosen't connect cloud, device will fails to send reset to cloud. 20 | ** when connection between device and cloud is ready, device will retry to report reset to cloud. 21 | **/ 22 | int awss_report_reset(void); 23 | 24 | /** 25 | ** @brief stop to report reset to cloud. 26 | ** 27 | ** @retval -1 : failure 28 | ** @retval 0 : sucess 29 | ** @note 30 | ** just stop report reset to cloud without any touch reset flag in flash. 31 | **/ 32 | int awss_stop_report_reset(void); 33 | 34 | int awss_bind_deinit(void); 35 | 36 | /** 37 | ** @brief deinit bind operation. 38 | ** 39 | ** @retval -1 : failure 40 | ** @retval 0 : sucess 41 | ** @note 42 | ** stop report token to cloud and release coap topic and handler. 43 | **/ 44 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_bind_statis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_BIND_STATIS_H__ 6 | #define __AWSS_BIND_STATIS_H__ 7 | 8 | #ifndef AWSS_SUPPORT_DEV_BIND_STATIS 9 | #define AWSS_SUPPORT_DEV_BIND_STATIS 10 | #endif 11 | 12 | enum { 13 | AWSS_DB_STATIS_START, 14 | AWSS_DB_STATIS_SUC, 15 | }; 16 | 17 | #ifdef AWSS_SUPPORT_DEV_BIND_STATIS 18 | struct awss_statis_dev_bind_t { 19 | uint32_t dev_bind_cnt; /* the count of token sync */ 20 | uint32_t dev_bind_suc; /* the successful count of token sync */ 21 | uint32_t dev_bind_time_mean; /* the mean time of token sync */ 22 | uint32_t dev_bind_time_max; /* the max time of token sync */ 23 | uint32_t dev_bind_time_min; /* the min time of token sync */ 24 | uint32_t dev_bind_start; /* the start time to sync token */ 25 | uint32_t dev_bind_end; /* the end time of token sync */ 26 | }; /* statistics for token sync */ 27 | 28 | 29 | int awss_bind_report_statis(const char *module); 30 | void awss_bind_update_statis(int type); 31 | void awss_bind_clear_statis(); 32 | void awss_bind_disp_statis(); 33 | 34 | 35 | #define AWSS_DB_UPDATE_STATIS(type) awss_bind_update_statis(type) 36 | #define AWSS_DB_DISP_STATIS() awss_bind_disp_statis() 37 | #define AWSS_DB_CLEAR_STATIS() awss_bind_clear_statis() 38 | #define AWSS_DB_REPORT_STATIS(m) awss_bind_report_statis(m) 39 | #else 40 | #define AWSS_DB_UPDATE_STATIS(type) 41 | #define AWSS_DB_DISP_STATIS() 42 | #define AWSS_DB_CLEAR_STATIS() 43 | #define AWSS_DB_REPORT_STATIS(m) 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_event.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | #include "dev_bind_internal.h" 5 | 6 | extern int iotx_event_post(int event); 7 | 8 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 9 | extern "C" { 10 | #endif 11 | 12 | int awss_event_post(int event) 13 | { 14 | int ret = 0; 15 | void *cb = NULL; 16 | 17 | ret = iotx_event_post(event); 18 | 19 | cb = (void *)iotx_event_callback(ITE_AWSS_STATUS); 20 | if (cb) { 21 | ret = ((int (*)(int))cb)(event); 22 | } 23 | 24 | return ret; 25 | } 26 | 27 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_EVENT_H__ 6 | #define __AWSS_EVENT_H__ 7 | 8 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 9 | extern "C" 10 | { 11 | #endif 12 | 13 | int awss_event_post(int event); 14 | 15 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_INFO_H__ 6 | #define __AWSS_INFO_H__ 7 | 8 | #include 9 | 10 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 11 | extern "C" { 12 | #endif 13 | 14 | int process_get_device_info(void *ctx, void *resource, void *remote, void *request, char is_mcast, int type); 15 | int awss_process_mcast_get_connectap_info(void *ctx, void *resource, void *remote, void *request); 16 | int awss_process_ucast_get_connectap_info(void *ctx, void *resource, void *remote, void *request); 17 | 18 | int awss_stop_connectap_monitor(); 19 | int awss_start_connectap_monitor(); 20 | 21 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 22 | } 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_LOG_H__ 6 | #define __AWSS_LOG_H__ 7 | 8 | #include "infra_log.h" 9 | 10 | #define awss_flow(...) log_flow("awss", __VA_ARGS__) 11 | #define awss_debug(...) log_debug("awss", __VA_ARGS__) 12 | #define awss_info(...) log_info("awss", __VA_ARGS__) 13 | #define awss_warn(...) log_warning("awss", __VA_ARGS__) 14 | #define awss_err(...) log_err("awss", __VA_ARGS__) 15 | #define awss_crit(...) log_crit("awss", __VA_ARGS__) 16 | #define awss_emerg(...) log_emerg("awss", __VA_ARGS__) 17 | #define awss_trace(...) log_crit("awss", __VA_ARGS__) 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_notify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_NOTIFY_H__ 6 | #define __AWSS_NOTIFY_H__ 7 | 8 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 9 | extern "C" 10 | { 11 | #endif 12 | 13 | enum { 14 | AWSS_NOTIFY_DEV_INFO = 0, 15 | AWSS_NOTIFY_DEV_BIND_TOKEN, 16 | AWSS_NOTIFY_DEV_RAND_SIGN, 17 | AWSS_NOTIFY_SUCCESS, 18 | AWSS_NOTIFY_TYPE_MAX, 19 | }; 20 | 21 | #ifdef WIFI_PROVISION_ENABLED 22 | int awss_suc_notify(); 23 | int awss_devinfo_notify(); 24 | int awss_suc_notify_stop(); 25 | int awss_devinfo_notify_stop(); 26 | #endif 27 | 28 | int awss_dev_bind_notify(); 29 | int awss_dev_bind_notify_stop(); 30 | int awss_notify_dev_info(int type, int count); 31 | int online_mcast_get_device_info(void *ctx, void *resource, void *remote, void *request); 32 | int online_ucast_get_device_info(void *ctx, void *resource, void *remote, void *request); 33 | 34 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_reset.h: -------------------------------------------------------------------------------- 1 | #ifndef __AWSS_RESET__ 2 | #define __AWSS_RESET__ 3 | 4 | #define AWSS_RESET_PKT_LEN (256) 5 | #define AWSS_RESET_TOPIC_LEN (128) 6 | #define AWSS_RESET_MSG_ID_LEN (16) 7 | 8 | #define TOPIC_RESET_REPORT "/sys/%s/%s/thing/reset" 9 | #define TOPIC_RESET_REPORT_REPLY "/sys/%s/%s/thing/reset_reply" 10 | #define METHOD_RESET_REPORT "thing.reset" 11 | 12 | #define AWSS_RESET_REQ_FMT "{\"id\":%s, \"version\":\"1.0\", \"method\":\"%s\", \"params\":%s}" 13 | 14 | #define AWSS_KV_RST "awss.rst" 15 | 16 | int awss_check_reset(); 17 | 18 | /** 19 | * @brief report reset to cloud. 20 | * 21 | * @retval -1 : failure 22 | * @retval 0 : sucess 23 | * @note 24 | * device will save reset flag if device dosen't connect cloud, device will fails to send reset to cloud. 25 | * when connection between device and cloud is ready, device will retry to report reset to cloud. 26 | */ 27 | int awss_report_reset(); 28 | 29 | /** 30 | * @brief stop to report reset to cloud. 31 | * 32 | * @retval -1 : failure 33 | * @retval 0 : sucess 34 | * @note 35 | * just stop report reset to cloud without any touch reset flag in flash. 36 | */ 37 | int awss_stop_report_reset(); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_reset/awss_dev_reset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_DEV_RESET_H__ 6 | #define __AWSS_DEV_RESET_H__ 7 | 8 | #include 9 | 10 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 11 | extern "C" { 12 | #endif 13 | 14 | int awss_report_reset_to_cloud(); 15 | int awss_report_reset(); 16 | int awss_check_reset(); 17 | int awss_stop_report_reset(); 18 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_reset/awss_dev_reset_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _AWSS_DEV_RESET_INTERNAL_H_ 2 | #define _AWSS_DEV_RESET_INTERNAL_H_ 3 | 4 | #include "os.h" 5 | 6 | #ifdef INFRA_LOG 7 | #include "infra_log.h" 8 | #define devrst_err(...) log_err("devrst", __VA_ARGS__) 9 | #define devrst_info(...) log_info("devrst", __VA_ARGS__) 10 | #define devrst_debug(...) log_debug("devrst", __VA_ARGS__) 11 | #else 12 | #define devrst_info(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 13 | #define devrst_err(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 14 | #define devrst_debug(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 15 | #endif 16 | 17 | #ifdef INFRA_MEM_STATS 18 | #include "infra_mem_stats.h" 19 | #define devrst_malloc(size) LITE_malloc(size, MEM_MAGIC, "devrst") 20 | #define devrst_free(ptr) LITE_free(ptr) 21 | #else 22 | #define devrst_malloc(size) HAL_Malloc(size) 23 | #define devrst_free(ptr) {HAL_Free((void *)ptr);ptr = NULL;} 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_timer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | #include "dev_bind_internal.h" 5 | 6 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 7 | extern "C" 8 | { 9 | #endif 10 | 11 | int awss_stop_timer(void *timer) 12 | { 13 | if (timer == NULL) 14 | return 0; 15 | HAL_Timer_Stop(timer); 16 | HAL_Timer_Delete(timer); 17 | return 0; 18 | } 19 | #if 0 20 | int awss_start_timer(void **timer, const char *name, void *func, void *user_data, int ms) 21 | { 22 | if (timer == NULL) 23 | return -1; 24 | *timer = HAL_Timer_Create(name, (void (*)(void *))func, user_data); 25 | if (*timer == NULL) 26 | return -1; 27 | HAL_Timer_Stop(*timer); 28 | HAL_Timer_Start(*timer, ms); 29 | return 0; 30 | } 31 | #endif 32 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_TIMER_H__ 6 | #define __AWSS_TIMER_H__ 7 | 8 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 9 | extern "C" 10 | { 11 | #endif 12 | 13 | int awss_stop_timer(void *timer); 14 | 15 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/awss_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_UTILS_H__ 6 | #define __AWSS_UTILS_H__ 7 | 8 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 9 | extern "C" { 10 | #endif 11 | 12 | #include "os.h" 13 | #if 0 14 | #include "iotx_utils.h" 15 | #endif 16 | #include "infra_string.h" 17 | 18 | /** 19 | * @brief string to hex 20 | * 21 | * @param[in] str: input hex string 22 | * @param[in] str_len: length of input hex string 23 | * @param[out] out: output hex byte stream 24 | * @param[in/out] output_len: [in] for output buffer size, [out] for 25 | * output hex byte len 26 | * @Note None. 27 | * 28 | * @retval return num of hex bytes converted, 0 means error. 29 | */ 30 | #define utils_str_to_hex LITE_hexstr_convert 31 | 32 | 33 | /** 34 | * @brief hex to string 35 | * 36 | * @param[in] buf: input hex byte stream 37 | * @param[in] buf_len: input stream length in byte 38 | * @param[out] str: encoded hex string 39 | * @param[in/out] str_len: [in] for str buffer size, [out] for 40 | * encoded string length 41 | * @Note output str buffer is NULL-terminated(if str_buf_len is longer enough) 42 | * 43 | * @retval return length of str converted, 0 means error. 44 | */ 45 | #define utils_hex_to_str(buf, buf_len, str, str_buf_len) LITE_hexbuf_convert(buf, str, buf_len, 1) 46 | 47 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/dev_bind_internal.h: -------------------------------------------------------------------------------- 1 | #include "infra_config.h" 2 | #include 3 | #include 4 | #include 5 | #include "awss_event.h" 6 | #include "awss_timer.h" 7 | #include "awss_log.h" 8 | #include "passwd.h" 9 | #include "awss_utils.h" 10 | #include "infra_compat.h" 11 | #include "awss_packet.h" 12 | #include "awss_notify.h" 13 | #include "awss_cmp.h" 14 | #include "awss_cmp.h" 15 | #include "infra_json_parser.h" 16 | #include "mqtt_api.h" 17 | #include "awss_dev_reset.h" 18 | #include "awss_dev_reset_internal.h" 19 | #include "awss_info.h" 20 | #include "awss_bind_statis.h" 21 | #include "dev_bind_wrapper.h" 22 | #include "coap_api.h" 23 | #include "iotx_coap.h" 24 | #ifdef WIFI_PROVISION_ENABLED 25 | #include "awss_statis.h" 26 | #endif 27 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/impl/passwd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_PASSWD_H__ 6 | #define __AWSS_PASSWD_H__ 7 | 8 | #define KEY_MAX_LEN (40) 9 | #define AES128_KEY_LEN (16) 10 | #define RANDOM_MAX_LEN (16) 11 | 12 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 13 | extern "C" 14 | { 15 | #endif 16 | 17 | enum { 18 | SSID_DECODE_TABLE = 0x0, 19 | NOTIFY_ENCODE_TABLE, 20 | DICT_CRYPT_TABLE_IDX_MAX, 21 | }; 22 | 23 | int awss_dict_crypt(char tab_idx, uint8_t *data, uint8_t len); 24 | #ifdef WIFI_PROVISION_ENABLED 25 | int produce_signature(uint8_t *sign, uint8_t *txt, uint32_t txt_len, const char *key); 26 | #endif 27 | 28 | extern uint8_t aes_random[RANDOM_MAX_LEN]; 29 | 30 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_bind/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_dev_bind.a 2 | LIB_SRCS_PATTERN := *.c 3 | 4 | $(call Append_Conditional, LIB_SRCS_PATTERN, impl/*.c, DEV_BIND_ENABLED) 5 | $(call Append_Conditional, LIB_SRCS_PATTERN, impl/os/*.c, DEV_BIND_ENABLED) 6 | $(call Append_Conditional, LIB_SRCS_PATTERN, impl/awss_reset/*.c, DEV_BIND_ENABLED) 7 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/alcs/README.md: -------------------------------------------------------------------------------- 1 | # README.md: alcs 2 | 3 | ## Contents 4 | 5 | ```shell 6 | . 7 | ├── alcs_adapter.c 8 | ├── alcs_adapter.h 9 | ├── alcs_api.c 10 | ├── alcs_api.h 11 | ├── alcs_api_internal.h 12 | ├── alcs_client.c 13 | ├── alcs_coap.c 14 | ├── alcs_coap.h 15 | ├── alcs_localsetup.c 16 | ├── alcs_localsetup.h 17 | ├── alcs_mqtt.c 18 | ├── alcs_mqtt.h 19 | ├── alcs_server.c 20 | ├── aos.mk 21 | ├── CMakeLists.txt 22 | ├── Config.in 23 | ├── iot.mk 24 | ├── iotx_alcs_config.h 25 | ├── iotx_alcs.h 26 | └── README.md 27 | 28 | ``` 29 | 30 | ## Introduction 31 | Implementation of ICA local communication service. 32 | 33 | 34 | ### Features 35 | 36 | 37 | 38 | ### Dependencies 39 | 40 | - **hal**. osal and hal to shield different os and hardware 41 | - **infra**. Authentication, net and so on tool set. 42 | - **coap local**. for local communication 43 | - **mqtt**. get token form cloud over mqtt 44 | ## API 45 | none 46 | ## Reference 47 | none 48 | 49 | 50 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/alcs/alcs_base64.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALCS_BASE64_H_ 2 | #define _ALCS_BASE64_H_ 3 | 4 | #include "infra_types.h" 5 | 6 | int utils_base64encode(const uint8_t *data, uint32_t inputLength, uint32_t outputLenMax, 7 | uint8_t *encodedData, uint32_t *outputLength); 8 | int utils_base64decode(const uint8_t *data, uint32_t inputLength, uint32_t outputLenMax, 9 | uint8_t *decodedData, uint32_t *outputLength); 10 | #endif -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/alcs/alcs_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALCS_INTERNAL_H_ 2 | #define _ALCS_INTERNAL_H_ 3 | 4 | #include "infra_config.h" 5 | #include "infra_types.h" 6 | #include "infra_defs.h" 7 | #include "infra_md5.h" 8 | #include "infra_sha1.h" 9 | #include "infra_json_parser.h" 10 | #include "alcs_base64.h" 11 | #include "dm_wrapper.h" 12 | 13 | #ifdef INFRA_MEM_STATS 14 | #include "infra_mem_stats.h" 15 | #define ALCS_malloc(size) LITE_malloc(size, MEM_MAGIC, "alcs") 16 | #define ALCS_ADAPTER_malloc(size) LITE_malloc(size, MEM_MAGIC, "alcs_adapter") 17 | #define ALCS_free(ptr) LITE_free(ptr) 18 | #else 19 | #define ALCS_malloc(size) HAL_Malloc(size) 20 | #define ALCS_ADAPTER_malloc(size) HAL_Malloc(size) 21 | #define ALCS_free(ptr) {HAL_Free((void *)ptr);ptr = NULL;} 22 | #endif 23 | 24 | #endif -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/alcs/alcs_localsetup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef _ALCS_LOCALSETUP_H_ 8 | #define _ALCS_LOCALSETUP_H_ 9 | 10 | void alcs_localsetup_init(void *adapter_handle, void* coap_handler, char *product_key,char *device_name); 11 | void alcs_localsetup_add_sub_device (void *adapter_handle,char *product_key,char *device_name); 12 | void alcs_localsetup_deinit(void *handle); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/alcs/iotx_alcs_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __IOTX_ALCS_CONFIG_H__ 6 | #define __IOTX_ALCS_CONFIG_H__ 7 | 8 | #if 0 9 | #ifndef ALCS_CLIENT_ENABLED 10 | #define ALCS_CLIENT_ENABLED (1) 11 | #endif 12 | #endif 13 | 14 | #ifndef ALCS_SERVER_ENABLED 15 | #define ALCS_SERVER_ENABLED (1) 16 | #endif 17 | 18 | #ifndef USE_ALCS_SECURE 19 | #define USE_ALCS_SECURE (1) 20 | #endif 21 | 22 | #ifndef KEYPREFIX_LEN 23 | #define KEYPREFIX_LEN (8) 24 | #endif 25 | 26 | #ifndef GROUPID_LEN 27 | #define GROUPID_LEN (8) 28 | #endif 29 | 30 | #endif /* #ifndef __IOTX_ALCS_CONFIG_H__ */ 31 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/client/dm_client_adapter.h: -------------------------------------------------------------------------------- 1 | #ifndef _DM_CLIENT_ADAPTER_H_ 2 | #define _DM_CLIENT_ADAPTER_H_ 3 | 4 | typedef struct { 5 | int fd; 6 | iotx_conn_info_t *conn_info; 7 | void *callback; 8 | } dm_client_ctx_t; 9 | 10 | int dm_client_open(void); 11 | int dm_client_connect(int timeout_ms); 12 | int dm_client_close(void); 13 | int dm_client_subscribe(char *uri, iotx_cm_data_handle_cb callback, void *context); 14 | int dm_client_unsubscribe(char *uri); 15 | int dm_client_publish(char *uri, unsigned char *payload, int payload_len, iotx_cm_data_handle_cb callback); 16 | int dm_client_yield(unsigned int timeout); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/deprecated/impl_ntp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef NTP_H 7 | #define NTP_H 8 | 9 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 10 | extern "C" { 11 | #endif 12 | 13 | 14 | #define TOPIC_NTP "/ext/ntp/%s/%s/request" 15 | #define TOPIC_NTP_REPLY "/ext/ntp/%s/%s/response" 16 | 17 | #define NTP_TIME_STR_MAX_LEN (20) 18 | 19 | int linkkit_ntp_time_request(void (*)(const char *ntp_offset_time_ms)); 20 | 21 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/deprecated/impl_solo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef _LINKKIT_SOLO_LEGACY_H_ 6 | #define _LINKKIT_SOLO_LEGACY_H_ 7 | 8 | #include "linkkit_export.h" 9 | 10 | #define LINKKIT_SOLO_LEGACY_KEY_ID "id" 11 | #define LINKKIT_SOLO_LEGACY_KEY_CODE "code" 12 | #define LINKKIT_SOLO_LEGACY_KEY_DEVID "devid" 13 | #define LINKKIT_SOLO_LEGACY_KEY_SERVICEID "serviceid" 14 | #define LINKKIT_SOLO_LEGACY_KEY_PROPERTYID "propertyid" 15 | #define LINKKIT_SOLO_LEGACY_KEY_EVENTID "eventid" 16 | #define LINKKIT_SOLO_LEGACY_KEY_PAYLOAD "payload" 17 | #define LINKKIT_SOLO_LEGACY_KEY_CONFIG_ID "configId" 18 | #define LINKKIT_SOLO_LEGACY_KEY_CONFIG_SIZE "configSize" 19 | #define LINKKIT_SOLO_LEGACY_KEY_GET_TYPE "getType" 20 | #define LINKKIT_SOLO_LEGACY_KEY_SIGN "sign" 21 | #define LINKKIT_SOLO_LEGACY_KEY_SIGN_METHOD "signMethod" 22 | #define LINKKIT_SOLO_LEGACY_KEY_URL "url" 23 | #define LINKKIT_SOLO_LEGACY_KEY_VERSION "version" 24 | 25 | typedef struct { 26 | int msgid; 27 | handle_post_cb_fp_t callback; 28 | struct list_head linked_list; 29 | } linkkit_solo_upstream_callback_node_t; 30 | 31 | typedef struct { 32 | void *mutex; 33 | void *upstream_mutex; 34 | int is_started; 35 | int is_leaved; 36 | linkkit_ops_t *user_callback; 37 | void *user_context; 38 | handle_service_cota_callback_fp_t cota_callback; 39 | handle_service_fota_callback_fp_t fota_callback; 40 | struct list_head callback_list; 41 | } linkkit_solo_legacy_ctx_t; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_cota.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef _DM_COTA_H_ 8 | #define _DM_COTA_H_ 9 | 10 | typedef struct { 11 | int is_report_new_config; 12 | } dm_cota_ctx_t; 13 | 14 | int dm_cota_init(void); 15 | int dm_cota_deinit(void); 16 | int dm_cota_perform_sync(_OU_ char *output, _IN_ int output_len); 17 | int dm_cota_get_config(const char *config_scope, const char *get_type, const char *attribute_keys); 18 | int dm_cota_status_check(void); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_fota.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef _DM_FOTA_H_ 8 | #define _DM_FOTA_H_ 9 | 10 | typedef struct { 11 | int is_report_new_config; 12 | } dm_fota_ctx_t; 13 | 14 | int dm_fota_init(void); 15 | int dm_fota_deinit(void); 16 | int dm_fota_perform_sync(_OU_ char *output, _IN_ int output_len); 17 | int dm_fota_status_check(void); 18 | int dm_fota_request_image(_IN_ const char *version, _IN_ int buffer_len); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_intf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef _IOT_DM_API_H_ 8 | #define _IOT_DM_API_H_ 9 | 10 | typedef struct { 11 | void *mutex; 12 | void *cloud_connectivity; 13 | void *local_connectivity; 14 | iotx_dm_event_callback event_callback; 15 | } dm_api_ctx_t; 16 | 17 | #if defined(DEPRECATED_LINKKIT) 18 | typedef struct { 19 | void *mutex; 20 | int devid; 21 | lite_cjson_item_t *lite; 22 | } dm_api_property_t; 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_ipc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef _DM_IPC_H_ 8 | #define _DM_IPC_H_ 9 | 10 | #include "iotx_dm_internal.h" 11 | 12 | typedef struct { 13 | iotx_dm_event_types_t type; 14 | char *data; 15 | } dm_ipc_msg_t; 16 | 17 | typedef struct { 18 | void *data; 19 | struct list_head linked_list; 20 | } dm_ipc_msg_node_t; 21 | 22 | typedef struct { 23 | int max_size; 24 | int size; 25 | struct list_head message_list; 26 | } dm_ipc_msg_list_t; 27 | 28 | typedef struct { 29 | void *mutex; 30 | dm_ipc_msg_list_t msg_list; 31 | } dm_ipc_t; 32 | 33 | int dm_ipc_init(int max_size); 34 | void dm_ipc_deinit(void); 35 | int dm_ipc_msg_insert(void *data); 36 | int dm_ipc_msg_next(void **data); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_message_cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #if !defined(DM_MESSAGE_CACHE_DISABLED) 7 | #ifndef _DM_MESSAGE_CACHE_H_ 8 | #define _DM_MESSAGE_CACHE_H_ 9 | 10 | #include "iotx_dm_internal.h" 11 | 12 | #define DM_MSG_CACHE_TIMEOUT_MS_DEFAULT (10000) 13 | 14 | typedef struct { 15 | int msgid; 16 | int devid; 17 | iotx_dm_event_types_t response_type; 18 | char *data; 19 | uint64_t ctime; 20 | struct list_head linked_list; 21 | } dm_msg_cache_node_t; 22 | 23 | typedef struct { 24 | void *mutex; 25 | int dmc_list_size; 26 | struct list_head dmc_list; 27 | } dm_msg_cache_ctx_t; 28 | 29 | int dm_msg_cache_init(void); 30 | int dm_msg_cache_deinit(void); 31 | int dm_msg_cache_insert(int msg_id, int devid, iotx_dm_event_types_t type, char *data); 32 | int dm_msg_cache_search(_IN_ int msg_id, _OU_ dm_msg_cache_node_t **node); 33 | int dm_msg_cache_remove(int msg_id); 34 | void dm_msg_cache_tick(void); 35 | 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_opt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #if !defined(DEVICE_MODEL_RAWDATA_SOLO) 6 | #ifndef _DM_OPT_H 7 | #define _DM_OPT_H 8 | 9 | typedef enum { 10 | DM_OPT_DOWNSTREAM_PROPERTY_POST_REPLY, 11 | DM_OPT_DOWNSTREAM_EVENT_POST_REPLY, 12 | DM_OPT_UPSTREAM_PROPERTY_SET_REPLY, 13 | DM_OPT_DOWNSTREAM_EVENT_PROPERTY_DESIRED_DELETE_REPLY, 14 | DM_OPT_DOWNSTREAM_EVENT_PROPERTY_DESIRED_GET_REPLY 15 | } dm_opt_t; 16 | 17 | typedef struct { 18 | int prop_post_reply_opt; 19 | int event_post_reply_opt; 20 | int prop_set_reply_opt; 21 | int prop_desired_get_reply_opt; 22 | int prop_desired_delete_reply_opt; 23 | } dm_opt_ctx; 24 | 25 | int dm_opt_set(dm_opt_t opt, void *data); 26 | int dm_opt_get(dm_opt_t opt, void *data); 27 | 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_ota.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef _DM_OTA_H_ 8 | #define _DM_OTA_H_ 9 | 10 | typedef struct { 11 | void *ota_handle; 12 | char product_key[IOTX_PRODUCT_KEY_LEN + 1]; 13 | char device_name[IOTX_DEVICE_NAME_LEN + 1]; 14 | } dm_ota_ctx_t; 15 | 16 | int dm_ota_init(void); 17 | int dm_ota_sub(void); 18 | int dm_ota_deinit(void); 19 | int dm_ota_get_ota_handle(void **handle); 20 | #ifdef DEVICE_MODEL_GATEWAY 21 | #ifdef DEVICE_MODEL_SUBDEV_OTA 22 | int dm_ota_switch_device(int devid); 23 | #endif 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/dm_tsl_alink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #if defined(DEPRECATED_LINKKIT) 6 | #ifndef _DM_TSL_ALINK_H_ 7 | #define _DM_TSL_ALINK_H_ 8 | 9 | /** 10 | * @brief Create TSL struct from TSL string. 11 | * This function used to parse TSL string into TSL struct. 12 | * 13 | * @param tsl. The TSL string in JSON format. 14 | * @param tsl_len. The length of tsl 15 | * @param shadow. The pointer of TSL Struct pointer, will be malloc memory. 16 | * This memory should be free by dm_shw_destroy. 17 | * 18 | * @return success or fail. 19 | * 20 | */ 21 | int dm_tsl_alink_create(_IN_ const char *tsl, _IN_ int tsl_len, _OU_ dm_shw_t **shadow); 22 | 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_alink.a 2 | 3 | HDR_REFS += src/infra 4 | HDR_REFS += src/mqtt 5 | HDR_REFS += src/dev_sign 6 | 7 | DEPENDS += wrappers 8 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 9 | 10 | LIB_SRCS_PATTERN := *.c server/*.c client/*.c deprecated/*.c 11 | 12 | LIB_SRCS_EXCLUDE := examples/linkkit_example_solo.c examples/cJSON.c 13 | SRCS_linkkit-example-solo := examples/linkkit_example_solo.c examples/cJSON.c 14 | 15 | LIB_SRCS_EXCLUDE += examples/linkkit_example_gateway.c examples/cJSON.c 16 | SRCS_linkkit-example-gateway := examples/linkkit_example_gateway.c examples/cJSON.c 17 | 18 | $(call Append_Conditional, LIB_SRCS_PATTERN, alcs/*.c, ALCS_ENABLED) 19 | 20 | ifneq (,$(filter -DDEPRECATED_LINKKIT,$(CFLAGS))) 21 | $(call Append_Conditional, TARGET, linkkit-example-solo, DEVICE_MODEL_ENABLED, BUILD_AOS NO_EXECUTABLES DEVICE_MODEL_GATEWAY) 22 | $(call Append_Conditional, TARGET, linkkit-example-gateway, DEVICE_MODEL_ENABLED DEVICE_MODEL_GATEWAY, BUILD_AOS NO_EXECUTABLES) 23 | else 24 | $(call Append_Conditional, TARGET, linkkit-example-solo, DEVICE_MODEL_ENABLED, BUILD_AOS NO_EXECUTABLES) 25 | $(call Append_Conditional, TARGET, linkkit-example-gateway, DEVICE_MODEL_GATEWAY, BUILD_AOS NO_EXECUTABLES) 26 | endif 27 | 28 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/iotx_cm_coap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef _IOTX_CM_COAP_H_ 6 | #define _IOTX_CM_COAP_H_ 7 | #include "iotx_cm.h" 8 | #include "iotx_cm_internal.h" 9 | #include "coap_api.h" 10 | 11 | 12 | typedef struct { 13 | uint32_t token_num; 14 | void *user_data; 15 | char *topic; 16 | iotx_cm_data_handle_cb responce_cb; 17 | void *context; 18 | dlist_t linked_list; 19 | } coap_response_node_t; 20 | 21 | iotx_cm_connection_t *iotx_cm_open_coap(iotx_cm_init_param_t *params); 22 | 23 | #endif /* _LINKKIT_CM_H_ */ 24 | 25 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/iotx_cm_mqtt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | #ifndef _IOTX_CM_MQTT_H_ 7 | #define _IOTX_CM_MQTT_H_ 8 | 9 | #include "iotx_cm.h" 10 | #include "iotx_cm_internal.h" 11 | 12 | 13 | typedef struct { 14 | uintptr_t packet_id; 15 | char * topic; 16 | void * user_data; 17 | iotx_mqtt_event_handle_func_fpt sub_state_cb; 18 | iotx_cm_data_handle_cb sub_recieve_cb; 19 | dlist_t linked_list; 20 | } mqtt_sub_node_t; 21 | 22 | iotx_cm_connection_t *iotx_cm_open_mqtt(iotx_cm_init_param_t *params); 23 | 24 | 25 | #endif /* _LINKKIT_CM_H_ */ 26 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/iotx_dm_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | #ifndef _IOTX_DM_CONFIG_H_ 8 | #define _IOTX_DM_CONFIG_H_ 9 | 10 | #define IOTX_DM_CLIENT_CONNECT_TIMEOUT_MS (10000) 11 | #define IOTX_DM_CLIENT_SUB_RETRY_MAX_COUNTS (3) 12 | #define IOTX_DM_CLIENT_SUB_TIMEOUT_MS (5000) 13 | #define IOTX_DM_CLIENT_REQUEST_TIMEOUT_MS (2000) 14 | #define IOTX_DM_CLIENT_KEEPALIVE_INTERVAL_MS (30000) 15 | 16 | #ifndef CONFIG_MQTT_TX_MAXLEN 17 | #define CONFIG_MQTT_TX_MAXLEN (1024) 18 | #endif 19 | 20 | #ifndef CONFIG_MQTT_RX_MAXLEN 21 | #define CONFIG_MQTT_RX_MAXLEN (1024) 22 | #endif 23 | 24 | #ifndef CONFIG_DISPATCH_QUEUE_MAXLEN 25 | #define CONFIG_DISPATCH_QUEUE_MAXLEN (50) 26 | #endif 27 | 28 | #ifndef CONFIG_DISPATCH_PACKET_MAXCOUNT 29 | #define CONFIG_DISPATCH_PACKET_MAXCOUNT (0) 30 | #endif 31 | 32 | #ifndef CONFIG_MSGCACHE_QUEUE_MAXLEN 33 | #define CONFIG_MSGCACHE_QUEUE_MAXLEN (50) 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/iotx_log_report.h: -------------------------------------------------------------------------------- 1 | void get_msgid(char *payload, int is_cloud); 2 | int check_target_msg(const char *input, int len); 3 | void send_permance_info(char *input, int input_len, char *comments, int report_format); 4 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/server/dm_server.h: -------------------------------------------------------------------------------- 1 | #ifndef _DM_SERVER_H_ 2 | #define _DM_SERVER_H_ 3 | 4 | #ifdef ALCS_ENABLED 5 | typedef struct { 6 | const char *uri_name; 7 | const char *uri_prefix; 8 | int auth_type; 9 | CoAPRecvMsgHandler callback; 10 | } dm_server_uri_map_t; 11 | 12 | #define DM_SERVER_ALCS_NO_AUTH (0) 13 | #define DM_SERVER_ALCS_AUTH (1) 14 | 15 | void dm_server_alcs_event_handler(void *pcontext, void *phandle, iotx_alcs_event_msg_t *msg); 16 | 17 | int dm_server_subscribe_all(char product_key[IOTX_PRODUCT_KEY_LEN + 1], char device_name[IOTX_DEVICE_NAME_LEN + 1]); 18 | void dm_server_thing_service_property_set(CoAPContext *context, const char *paths, NetworkAddr *remote, 19 | CoAPMessage *message); 20 | void dm_server_thing_service_property_get(CoAPContext *context, const char *paths, NetworkAddr *remote, 21 | CoAPMessage *message); 22 | void dm_server_thing_service_property_post(CoAPContext *context, const char *paths, NetworkAddr *remote, 23 | CoAPMessage *message); 24 | void dm_server_thing_dev_core_service_dev(CoAPContext *context, const char *paths, NetworkAddr *remote, 25 | CoAPMessage *message); 26 | void dm_server_thing_service_request(CoAPContext *context, const char *paths, NetworkAddr *remote, 27 | CoAPMessage *message); 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_model/server/dm_server_adapter.h: -------------------------------------------------------------------------------- 1 | #ifndef _DM_SERVER_ADAPTER_H_ 2 | #define _DM_SERVER_ADAPTER_H_ 3 | 4 | #ifdef ALCS_ENABLED 5 | 6 | #define DM_SERVER_ALCS_ADDR "224.0.1.187" 7 | #define DM_SERVER_ALCS_PORT (5863) 8 | #define DM_SERVER_ALCS_SEND_MAXCOUNT (16) 9 | #define DM_SERVER_ALCS_WAITTIME (200) 10 | #define DM_SERVER_ALCS_OBS_MAXCOUNT (16) 11 | #define DM_SERVER_ALCS_RES_MAXCOUNT (255) 12 | 13 | typedef struct { 14 | void *conn_handle; 15 | } dm_server_ctx_t; 16 | 17 | typedef struct { 18 | char *ip; 19 | uint16_t port; 20 | char *token; 21 | int token_len; 22 | } dm_server_alcs_context_t; 23 | 24 | int dm_server_open(void); 25 | int dm_server_connect(void); 26 | int dm_server_close(void); 27 | int dm_server_send(char *uri, unsigned char *payload, int payload_len, void *context); 28 | int dm_server_subscribe(char *uri, CoAPRecvMsgHandler callback, int auth_type); 29 | int dm_server_add_device(char product_key[IOTX_PRODUCT_KEY_LEN + 1], char device_name[IOTX_DEVICE_NAME_LEN + 1]); 30 | int dm_server_del_device(char product_key[IOTX_PRODUCT_KEY_LEN + 1], char device_name[IOTX_DEVICE_NAME_LEN + 1]); 31 | int dm_server_yield(void); 32 | 33 | #endif 34 | #endif 35 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_reset/dev_reset_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEV_RESET_API_H__ 2 | #define __DEV_RESET_API_H__ 3 | 4 | #include "infra_types.h" 5 | #include "infra_defs.h" 6 | 7 | typedef enum { 8 | IOTX_DEVRST_EVT_RECEIVED 9 | } iotx_devrst_evt_type_t; 10 | 11 | typedef struct { 12 | int msgid; 13 | char *payload; 14 | uint32_t payload_len; 15 | } iotx_devrst_evt_recv_msg_t; 16 | 17 | typedef void (*iotx_devrst_evt_handle_t)(iotx_devrst_evt_type_t evt, void *msg); 18 | 19 | /** 20 | * @brief report reset message to cloud. 21 | * 22 | * @param meta_info. device meta info, only product_key and device_name needed. 23 | * @param extended. reserved. 24 | * 25 | * @retval -1 : failure 26 | * @retval 0 : sucess 27 | */ 28 | int IOT_DevReset_Report(iotx_dev_meta_info_t *meta_info, iotx_devrst_evt_handle_t handle, void *extended); 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_reset/dev_reset_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEV_RESET_INTERNAL_H_ 2 | #define _DEV_RESET_INTERNAL_H_ 3 | 4 | #include 5 | #include 6 | #include "infra_config.h" 7 | #include "infra_types.h" 8 | #include "infra_defs.h" 9 | #include "infra_report.h" 10 | #include "dev_reset_internal.h" 11 | #include "dev_reset_wrapper.h" 12 | #include "dev_reset_api.h" 13 | #include "mqtt_api.h" 14 | 15 | #ifdef INFRA_LOG 16 | #include "infra_log.h" 17 | #define devrst_err(...) log_err("devrst", __VA_ARGS__) 18 | #define devrst_info(...) log_info("devrst", __VA_ARGS__) 19 | #define devrst_debug(...) log_debug("devrst", __VA_ARGS__) 20 | #else 21 | #define devrst_info(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 22 | #define devrst_err(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 23 | #define devrst_debug(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 24 | #endif 25 | 26 | #ifdef INFRA_MEM_STATS 27 | #include "infra_mem_stats.h" 28 | #define devrst_malloc(size) LITE_malloc(size, MEM_MAGIC, "devrst") 29 | #define devrst_free(ptr) LITE_free(ptr) 30 | #else 31 | #define devrst_malloc(size) HAL_Malloc(size) 32 | #define devrst_free(ptr) {HAL_Free((void *)ptr);ptr = NULL;} 33 | #endif 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_reset/dev_reset_wrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEV_RESET_WRAPPER_H_ 2 | #define _DEV_RESET_WRAPPER_H_ 3 | 4 | int HAL_Snprintf(char *str, const int len, const char *fmt, ...); 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_reset/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_reset.a 2 | 3 | HDR_REFS := src/infra src/mqtt 4 | 5 | DEPENDS += wrappers 6 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 7 | 8 | LIB_SRCS_EXCLUDE += examples/dev_reset_example.c 9 | SRCS_dev-reset-example := examples/dev_reset_example.c 10 | 11 | $(call Append_Conditional, TARGET, dev-reset-example, DEV_RESET, BUILD_AOS NO_EXECUTABLES) 12 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_sign/dev_sign_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEV_SIGN_H_ 2 | #define _DEV_SIGN_H_ 3 | 4 | #include "dev_sign_internal.h" 5 | 6 | typedef struct { 7 | char hostname[DEV_SIGN_HOSTNAME_MAXLEN]; 8 | uint16_t port; 9 | char clientid[DEV_SIGN_CLIENT_ID_MAXLEN]; 10 | char username[DEV_SIGN_USERNAME_MAXLEN]; 11 | char password[DEV_SIGN_PASSWORD_MAXLEN]; 12 | } iotx_sign_mqtt_t; 13 | 14 | int32_t IOT_Sign_MQTT(iotx_mqtt_region_types_t region, iotx_dev_meta_info_t *meta, iotx_sign_mqtt_t *signout); 15 | 16 | #endif 17 | 18 | 19 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_sign/dev_sign_config.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEV_SIGN_CONFIG_H_ 2 | #define _DEV_SIGN_CONFIG_H_ 3 | 4 | #define DEV_SIGN_SOURCE_MAXLEN (200) 5 | #define DEV_SIGN_HOSTNAME_MAXLEN (128) 6 | #define DEV_SIGN_CLIENT_ID_MAXLEN (200) 7 | #define DEV_SIGN_USERNAME_MAXLEN (64) 8 | #define DEV_SIGN_PASSWORD_MAXLEN (65) 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_sign/dev_sign_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEV_SIGN_INTERNAL_H_ 2 | #define _DEV_SIGN_INTERNAL_H_ 3 | 4 | #include 5 | #include 6 | #include "infra_config.h" 7 | #include "infra_defs.h" 8 | #include "dev_sign_config.h" 9 | #include "dev_sign_api.h" 10 | #include "dev_sign_wrapper.h" 11 | 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_sign/dev_sign_wrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEV_SIGN_WRAPPER_H 2 | #define _DEV_SIGN_WRAPPER_H 3 | 4 | #include "infra_types.h" 5 | #include "infra_defs.h" 6 | 7 | void HAL_Printf(const char *fmt, ...); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dev_sign/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_sign.a 2 | 3 | HDR_REFS := src/infra 4 | 5 | DEPENDS += wrappers 6 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 7 | 8 | DEPENDS += external_libs/mbedtls 9 | 10 | LIB_SRCS_EXCLUDE := examples/dev_sign_example.c 11 | SRCS_dev-sign-example += examples/dev_sign_example.c 12 | 13 | $(call Append_Conditional, TARGET, dev-sign-example, DEV_SIGN, BUILD_AOS NO_EXECUTABLES) 14 | 15 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dynamic_register/dynreg_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _DYNREG_API_H_ 2 | #define _DYNREG_API_H_ 3 | 4 | #include "infra_types.h" 5 | #include "infra_defs.h" 6 | 7 | int32_t IOT_Dynamic_Register(iotx_http_region_types_t region, iotx_dev_meta_info_t *meta); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dynamic_register/dynreg_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _DYNREG_INTERNAL_H_ 2 | #define _DYNREG_INTERNAL_H_ 3 | 4 | #include "dynreg_wrapper.h" 5 | 6 | #ifdef INFRA_LOG 7 | #include "infra_log.h" 8 | #define dynreg_info(...) log_info("dynreg", __VA_ARGS__) 9 | #define dynreg_err(...) log_err("dynreg", __VA_ARGS__) 10 | #define dynreg_dbg(...) log_debug("dynreg", __VA_ARGS__) 11 | #else 12 | #define dynreg_info(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 13 | #define dynreg_err(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 14 | #define dynreg_dbg(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 15 | #endif 16 | 17 | #ifdef INFRA_MEM_STATS 18 | #include "infra_mem_stats.h" 19 | #define dynreg_malloc(size) LITE_malloc(size, MEM_MAGIC, "dynreg") 20 | #define dynreg_free(ptr) LITE_free(ptr) 21 | #else 22 | #define dynreg_malloc(size) HAL_Malloc(size) 23 | #define dynreg_free(ptr) {HAL_Free((void *)ptr);ptr = NULL;} 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dynamic_register/dynreg_wrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef _DYNREG_WRAPPER_H_ 2 | #define _DYNREG_WRAPPER_H_ 3 | 4 | #include "infra_types.h" 5 | 6 | void *HAL_Malloc(uint32_t size); 7 | void HAL_Free(void *ptr); 8 | void HAL_Printf(const char *fmt, ...); 9 | int HAL_Snprintf(char *str, const int len, const char *fmt, ...); 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dynamic_register/examples/dynreg_example.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "infra_types.h" 4 | #include "infra_defs.h" 5 | #include "dynreg_api.h" 6 | 7 | void HAL_Printf(const char *fmt, ...); 8 | int HAL_GetProductKey(char product_key[IOTX_PRODUCT_KEY_LEN]); 9 | int HAL_GetProductSecret(char *product_secret); 10 | int HAL_GetDeviceName(char device_name[IOTX_DEVICE_NAME_LEN]); 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | int32_t res = 0; 15 | iotx_dev_meta_info_t meta; 16 | iotx_http_region_types_t region = IOTX_HTTP_REGION_SHANGHAI; 17 | HAL_Printf("dynreg example\n"); 18 | 19 | memset(&meta,0,sizeof(iotx_dev_meta_info_t)); 20 | HAL_GetProductKey(meta.product_key); 21 | HAL_GetProductSecret(meta.product_secret); 22 | HAL_GetDeviceName(meta.device_name); 23 | 24 | res = IOT_Dynamic_Register(region, &meta); 25 | if (res < 0) { 26 | HAL_Printf("IOT_Dynamic_Register failed\n"); 27 | return -1; 28 | } 29 | 30 | HAL_Printf("\nDevice Secret: %s\n\n",meta.device_secret); 31 | 32 | return 0; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /iotkit-embedded/src/dynamic_register/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_dynreg.a 2 | 3 | HDR_REFS := src/infra 4 | 5 | DEPENDS += wrappers 6 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 7 | 8 | TARGET := dynreg-example 9 | 10 | LIB_SRCS_EXCLUDE := examples/dynreg_example.c 11 | SRCS_dynreg-example += examples/dynreg_example.c 12 | -------------------------------------------------------------------------------- /iotkit-embedded/src/http/README.md: -------------------------------------------------------------------------------- 1 | # README.md: http 2 | 3 | ## Contents 4 | 5 | ```shell 6 | ├── aos.mk 7 | ├── CMakeLists.txt 8 | ├── Config.in 9 | ├── http_debug.h 10 | ├── iot.mk 11 | ├── iotx_http_api.c 12 | └── README.md 13 | ``` 14 | 15 | ## Introduction 16 | A communication channel implemented in HTTP 17 | 18 | 19 | ### Features 20 | 21 | 22 | 23 | ### Dependencies 24 | 25 | - **hal**. osal and hal to shield different os and hardware 26 | - **infra**. Authentication, net and so on tool set. 27 | 28 | ## API 29 | Please refer to [http api](https://code.aliyun.com/edward.yangx/public-docs/wikis/user-guide/linkkit/Prog_Guide/API/HTTP_Provides#IOT_HTTP_Init) for API details. 30 | ## Reference 31 | Please refer to [http connect](https://code.aliyun.com/edward.yangx/public-docs/wikis/user-guide/linkkit/Prog_Guide/HTTP_Connect) for example details. 32 | 33 | 34 | -------------------------------------------------------------------------------- /iotkit-embedded/src/http/http_debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | 8 | #ifndef __HTTP_DEBUG_H__ 9 | #define __HTTP_DEBUG_H__ 10 | 11 | #ifdef INFRA_LOG 12 | #include "infra_log.h" 13 | #define http_emerg(...) log_emerg("HTTP", __VA_ARGS__) 14 | #define http_crit(...) log_crit("HTTP", __VA_ARGS__) 15 | #define http_err(...) log_err("HTTP", __VA_ARGS__) 16 | #define http_warning(...) log_warning("HTTP", __VA_ARGS__) 17 | #define http_info(...) log_info("HTTP", __VA_ARGS__) 18 | #define http_debug(...) log_debug("HTTP", __VA_ARGS__) 19 | #else 20 | #define http_emerg(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 21 | #define http_crit(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 22 | #define http_err(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 23 | #define http_warning(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 24 | #define http_info(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 25 | #define http_debug(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 26 | #endif 27 | 28 | 29 | #endif /* __HTTP_DEBUG_H__ */ 30 | -------------------------------------------------------------------------------- /iotkit-embedded/src/http/http_wrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef _HTTP_WRAPPER_H 2 | #define _HTTP_WRAPPER_H 3 | 4 | #include "infra_types.h" 5 | #include "infra_defs.h" 6 | #include "wrappers_defs.h" 7 | 8 | void *HAL_Malloc(uint32_t size); 9 | void HAL_Free(void *ptr); 10 | void HAL_Printf(const char *fmt, ...); 11 | int HAL_Snprintf(char *str, const int len, const char *fmt, ...); 12 | uint64_t HAL_UptimeMs(void); 13 | void HAL_SleepMs(uint32_t ms); 14 | 15 | #endif /* #ifndef _HTTP_WRAPPER_H */ 16 | -------------------------------------------------------------------------------- /iotkit-embedded/src/http/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_http.a 2 | 3 | HDR_REFS += src/infra 4 | 5 | DEPENDS += wrappers 6 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 7 | 8 | TARGET := http-example 9 | 10 | LIB_SRCS_EXCLUDE := examples/http_example.c 11 | SRCS_http-example += examples/http_example.c -------------------------------------------------------------------------------- /iotkit-embedded/src/http2/http2_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef _HTTP2_CONFIG_H 6 | #define _HTTP2_CONFIG_H 7 | 8 | /* maximum packet len in one http2 frame */ 9 | #ifndef FS_UPLOAD_PACKET_LEN 10 | #define FS_UPLOAD_PACKET_LEN 10240 /* must < 16384 */ 11 | #endif 12 | 13 | /* maximum content len of the http2 request */ 14 | #ifndef FS_UPLOAD_PART_LEN 15 | #define FS_UPLOAD_PART_LEN (1024 * 1024 * 4) /* 100KB ~ 100MB */ 16 | #endif 17 | 18 | 19 | #endif /* #ifdef _HTTP2_CONFIG_H */ 20 | 21 | -------------------------------------------------------------------------------- /iotkit-embedded/src/http2/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_http2.a 2 | 3 | HDR_REFS += src/infra 4 | 5 | DEPENDS += wrappers external_libs/nghttp2 6 | LDFLAGS += -liot_sdk -liot_hal -liot_tls -liot_nghttp2 7 | 8 | LIB_SRCS_EXCLUDE := examples/http2_example_stream.c examples/http2_example_uploadfile.c examples/http2_example_break_resume.c 9 | 10 | SRCS_http2-example-stream += examples/http2_example_stream.c 11 | SRCS_http2-example-uploadfile += examples/http2_example_uploadfile.c 12 | SRCS_http2-example-break-resume += examples/http2_example_break_resume.c 13 | 14 | $(call Append_Conditional, TARGET, http2-example-stream, HTTP2_COMM_ENABLED) 15 | $(call Append_Conditional, TARGET, http2-example-uploadfile http2-example-break-resume, HTTP2_COMM_ENABLED FS_ENABLED) 16 | 17 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_config.h: -------------------------------------------------------------------------------- 1 | #ifndef _INFRA_CONFIG_H_ 2 | #define _INFRA_CONFIG_H_ 3 | 4 | #include "rtconfig.h" 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_defs.c: -------------------------------------------------------------------------------- 1 | 2 | #include "infra_config.h" 3 | #include "infra_types.h" 4 | #include "infra_defs.h" 5 | 6 | const char * g_infra_mqtt_domain[IOTX_MQTT_DOMAIN_NUMBER] = { 7 | "iot-as-mqtt.cn-shanghai.aliyuncs.com", /* Shanghai */ 8 | "iot-as-mqtt.ap-southeast-1.aliyuncs.com", /* Singapore */ 9 | "iot-as-mqtt.ap-northeast-1.aliyuncs.com", /* Japan */ 10 | "iot-as-mqtt.us-west-1.aliyuncs.com", /* America */ 11 | "iot-as-mqtt.eu-central-1.aliyuncs.com", /* Germany */ 12 | NULL, /* Custom */ 13 | }; 14 | 15 | const char *g_infra_http_domain[IOTX_HTTP_DOMAIN_NUMBER] = { 16 | "iot-auth.cn-shanghai.aliyuncs.com", /* Shanghai */ 17 | "iot-auth.ap-southeast-1.aliyuncs.com", /* Singapore */ 18 | "iot-auth.ap-northeast-1.aliyuncs.com", /* Japan */ 19 | "iot-auth.us-west-1.aliyuncs.com", /* America */ 20 | "iot-auth.eu-central-1.aliyuncs.com", /* Germany */ 21 | NULL, /* Custom */ 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_mem_stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __MEM_STATS_H__ 6 | #define __MEM_STATS_H__ 7 | 8 | #include "infra_list.h" 9 | #include "infra_log.h" 10 | 11 | #if defined(__UBUNTU_SDK_DEMO__) 12 | #include 13 | #endif 14 | 15 | typedef struct { 16 | void *buf; 17 | int buflen; 18 | char *func; 19 | int line; 20 | #if defined(_PLATFORM_IS_LINUX_) 21 | char **bt_symbols; 22 | int bt_level; 23 | #endif 24 | list_head_t list; 25 | void *mem_table; 26 | } OS_malloc_record; 27 | 28 | 29 | #define MEM_MAGIC (0x1234) 30 | 31 | #define LITE_calloc(num, size, ...) LITE_malloc_internal(__func__, __LINE__, (num * size), ##__VA_ARGS__) 32 | #define LITE_malloc(size, ...) LITE_malloc_internal(__func__, __LINE__, size, ##__VA_ARGS__) 33 | #define LITE_realloc(ptr, size, ...) LITE_realloc_internal(__func__, __LINE__, ptr, size, ##__VA_ARGS__) 34 | #define LITE_free(ptr) \ 35 | do { \ 36 | if (!ptr) { \ 37 | log_warning("utils", "%s == NULL! LITE_free(%s) aborted.", #ptr, #ptr); \ 38 | break; \ 39 | } \ 40 | \ 41 | LITE_free_internal((void *)ptr); \ 42 | ptr = NULL; \ 43 | } while(0) 44 | 45 | void *LITE_malloc_internal(const char *f, const int l, int size, ...); 46 | void *LITE_realloc_internal(const char *f, const int l, void *ptr, int size, ...); 47 | void LITE_free_internal(void *ptr); 48 | void LITE_dump_malloc_free_stats(int level); 49 | void **LITE_get_mem_mutex(void); 50 | 51 | #endif /* __MEM_STATS_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_net.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef _INFRA_NET_H_ 6 | #define _INFRA_NET_H_ 7 | 8 | #include "infra_types.h" 9 | 10 | /** 11 | * @brief The structure of network connection(TCP or SSL). 12 | * The user has to allocate memory for this structure. 13 | */ 14 | 15 | struct utils_network; 16 | typedef struct utils_network utils_network_t, *utils_network_pt; 17 | 18 | struct utils_network { 19 | const char *pHostAddress; 20 | uint16_t port; 21 | uint16_t ca_crt_len; 22 | 23 | /**< NULL, TCP connection; NOT NULL, SSL connection */ 24 | const char *ca_crt; 25 | /**< NOT NULL,iTLS connection*/ 26 | char *product_key; 27 | /**< connection handle: 0, NOT connection; NOT 0, handle of the connection */ 28 | uintptr_t handle; 29 | 30 | /**< Read data from server function pointer. */ 31 | int (*read)(utils_network_pt, char *, uint32_t, uint32_t); 32 | 33 | /**< Send data to server function pointer. */ 34 | int (*write)(utils_network_pt, const char *, uint32_t, uint32_t); 35 | 36 | /**< Disconnect the network */ 37 | int (*disconnect)(utils_network_pt); 38 | 39 | /**< Establish the network */ 40 | int (*connect)(utils_network_pt); 41 | }; 42 | 43 | int utils_net_read(utils_network_pt pNetwork, char *buffer, uint32_t len, uint32_t timeout_ms); 44 | int utils_net_write(utils_network_pt pNetwork, const char *buffer, uint32_t len, uint32_t timeout_ms); 45 | int iotx_net_disconnect(utils_network_pt pNetwork); 46 | int iotx_net_connect(utils_network_pt pNetwork); 47 | int iotx_net_init(utils_network_pt pNetwork, const char *host, uint16_t port, const char *ca_crt); 48 | 49 | #endif /* IOTX_COMMON_NET_H */ 50 | 51 | 52 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_preauth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __INFRA_PREAUTH__ 6 | #define __INFRA_PREAUTH__ 7 | 8 | #include "infra_defs.h" 9 | #include "infra_types.h" 10 | 11 | #ifdef INFRA_LOG 12 | #include "infra_log.h" 13 | #define preauth_err(...) log_err("preauth", __VA_ARGS__) 14 | #define preauth_info(...) log_info("preauth", __VA_ARGS__) 15 | #define preauth_debug(...) log_debug("preauth", __VA_ARGS__) 16 | #else 17 | #define preauth_err(...) 18 | #define preauth_info(...) 19 | #define preauth_debug(...) 20 | #endif 21 | 22 | #define PRE_AUTH_HOSTNAME_MAXLEN (64) 23 | #define PRE_AUTH_CLIENT_ID_MAXLEN (200) 24 | #define PRE_AUTH_USERNAME_MAXLEN (64) 25 | #define PRE_AUTH_PASSWORD_MAXLEN (65) 26 | 27 | typedef struct { 28 | char hostname[PRE_AUTH_HOSTNAME_MAXLEN]; 29 | uint16_t port; 30 | char clientid[PRE_AUTH_CLIENT_ID_MAXLEN]; 31 | char username[PRE_AUTH_USERNAME_MAXLEN]; 32 | char password[PRE_AUTH_PASSWORD_MAXLEN]; 33 | } iotx_pre_auth_output_t; 34 | 35 | int preauth_get_connection_info(iotx_mqtt_region_types_t region, iotx_dev_meta_info_t *dev_meta, 36 | const char *sign, const char *device_id, iotx_pre_auth_output_t *preauth_output); 37 | 38 | #endif /* #ifndef __INFRA_PREAUTH__ */ -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_string.h: -------------------------------------------------------------------------------- 1 | #ifndef _INFRA_STRING_H_ 2 | #define _INFRA_STRING_H_ 3 | 4 | #include "infra_types.h" 5 | 6 | int8_t infra_hex2char(uint8_t hex); 7 | void infra_hex2str(uint8_t *input, uint16_t input_len, char *output); 8 | void infra_int2str(uint32_t input, char output[10]); 9 | char *infra_strtok(char *str, const char *delim); 10 | int infra_randstr(char *random, int length); 11 | void LITE_hexstr_convert(char *input, int input_len, unsigned char *output, int output_len); 12 | int infra_str2int(const char *input, int *val); 13 | void LITE_hexbuf_convert(unsigned char *digest, char *out, int in_len, int uppercase); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | 6 | 7 | 8 | #ifndef _INFRA_TIMER_H_ 9 | #define _INFRA_TIMER_H_ 10 | 11 | #include "infra_types.h" 12 | 13 | typedef struct { 14 | uint32_t time; 15 | } iotx_time_t; 16 | 17 | 18 | void iotx_time_start(iotx_time_t *timer); 19 | 20 | uint32_t utils_time_spend(iotx_time_t *start); 21 | 22 | uint32_t iotx_time_left(iotx_time_t *end); 23 | 24 | uint32_t utils_time_is_expired(iotx_time_t *timer); 25 | 26 | void iotx_time_init(iotx_time_t *timer); 27 | 28 | void utils_time_countdown_ms(iotx_time_t *timer, uint32_t millisecond); 29 | 30 | uint32_t utils_time_get_ms(void); 31 | 32 | #endif /* _IOTX_COMMON_TIMER_H_ */ 33 | 34 | 35 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/infra_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _INFRA_TYPES_H_ 2 | #define _INFRA_TYPES_H_ 3 | 4 | #include 5 | #include "infra_config.h" 6 | 7 | #define IOT_TRUE (1) /* indicate boolean value true */ 8 | #define IOT_FALSE (0) /* indicate boolean value false */ 9 | 10 | #if !defined(PLATFORM_HAS_STDINT) 11 | 12 | typedef unsigned char uint8_t; 13 | typedef signed char int8_t; 14 | typedef unsigned short uint16_t; 15 | typedef signed short int16_t; 16 | typedef unsigned int uint32_t; 17 | typedef signed int int32_t; 18 | typedef unsigned long int uint64_t; 19 | typedef signed long int int64_t; 20 | typedef unsigned int uintptr_t; 21 | 22 | #else 23 | 24 | #include 25 | 26 | #endif /* #if !defined(PLATFORM_HAS_STDINT) */ 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /iotkit-embedded/src/infra/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_infra.a 2 | -------------------------------------------------------------------------------- /iotkit-embedded/src/mqtt/impl/MQTTPublish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef MQTTPUBLISH_H_ 6 | #define MQTTPUBLISH_H_ 7 | 8 | #if !defined(DLLImport) 9 | #define DLLImport 10 | #endif 11 | #if !defined(DLLExport) 12 | #define DLLExport 13 | #endif 14 | 15 | DLLExport int MQTTSerialize_publish(unsigned char *buf, int buflen, unsigned char dup, int qos, unsigned char retained, 16 | unsigned short packetid, 17 | MQTTString topicName, unsigned char *payload, int payloadlen); 18 | 19 | DLLExport int MQTTDeserialize_publish(unsigned char *dup, int *qos, unsigned char *retained, unsigned short *packetid, 20 | MQTTString *topicName, 21 | unsigned char **payload, int *payloadlen, unsigned char *buf, int len); 22 | 23 | /* DLLExport int MQTTSerialize_puback(unsigned char* buf, int buflen, unsigned short packetid); */ 24 | DLLExport int MQTTSerialize_pubrel(unsigned char *buf, int buflen, unsigned char dup, unsigned short packetid); 25 | DLLExport int MQTTSerialize_pubcomp(unsigned char *buf, int buflen, unsigned short packetid); 26 | 27 | #endif /* MQTTPUBLISH_H_ */ 28 | 29 | 30 | -------------------------------------------------------------------------------- /iotkit-embedded/src/mqtt/impl/MQTTSubscribe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef MQTTSUBSCRIBE_H_ 6 | #define MQTTSUBSCRIBE_H_ 7 | 8 | #if !defined(DLLImport) 9 | #define DLLImport 10 | #endif 11 | #if !defined(DLLExport) 12 | #define DLLExport 13 | #endif 14 | 15 | DLLExport int MQTTSerialize_subscribe(unsigned char *buf, int buflen, unsigned char dup, unsigned short packetid, 16 | int count, MQTTString topicFilters[], int requestedQoSs[]); 17 | 18 | DLLExport int MQTTDeserialize_subscribe(unsigned char *dup, unsigned short *packetid, 19 | int maxcount, int *count, MQTTString topicFilters[], int requestedQoSs[], unsigned char *buf, int len); 20 | 21 | DLLExport int MQTTSerialize_suback(unsigned char *buf, int buflen, unsigned short packetid, int count, 22 | int *grantedQoSs); 23 | 24 | DLLExport int MQTTDeserialize_suback(unsigned short *packetid, int maxcount, int *count, int grantedQoSs[], 25 | unsigned char *buf, int len); 26 | 27 | 28 | #endif /* MQTTSUBSCRIBE_H_ */ 29 | 30 | 31 | -------------------------------------------------------------------------------- /iotkit-embedded/src/mqtt/impl/MQTTUnsubscribe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef MQTTUNSUBSCRIBE_H_ 6 | #define MQTTUNSUBSCRIBE_H_ 7 | 8 | #if !defined(DLLImport) 9 | #define DLLImport 10 | #endif 11 | #if !defined(DLLExport) 12 | #define DLLExport 13 | #endif 14 | 15 | DLLExport int MQTTSerialize_unsubscribe(unsigned char *buf, int buflen, unsigned char dup, unsigned short packetid, 16 | int count, MQTTString topicFilters[]); 17 | 18 | DLLExport int MQTTDeserialize_unsubscribe(unsigned char *dup, unsigned short *packetid, int max_count, int *count, 19 | MQTTString topicFilters[], 20 | unsigned char *buf, int len); 21 | 22 | DLLExport int MQTTSerialize_unsuback(unsigned char *buf, int buflen, unsigned short packetid); 23 | 24 | DLLExport int MQTTDeserialize_unsuback(unsigned short *packetid, unsigned char *buf, int len); 25 | 26 | #endif /* MQTTUNSUBSCRIBE_H_ */ 27 | 28 | 29 | -------------------------------------------------------------------------------- /iotkit-embedded/src/mqtt/impl/mqtt_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __IOTX_MQTT_INTERNAL_H__ 6 | #define __IOTX_MQTT_INTERNAL_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "infra_types.h" 14 | #include "infra_defs.h" 15 | #include "infra_string.h" 16 | #include "infra_list.h" 17 | #include "infra_report.h" 18 | #include "infra_net.h" 19 | #include "infra_sha256.h" 20 | 21 | #include "dev_sign_api.h" 22 | #include "mqtt_wrapper.h" 23 | #include "iotx_mqtt_config.h" 24 | #include "iotx_mqtt_client.h" 25 | 26 | #include "MQTTPacket.h" 27 | 28 | #ifdef INFRA_LOG 29 | #include "infra_log.h" 30 | #define mqtt_emerg(...) log_emerg("MQTT", __VA_ARGS__) 31 | #define mqtt_crit(...) log_crit("MQTT", __VA_ARGS__) 32 | #define mqtt_err(...) log_err("MQTT", __VA_ARGS__) 33 | #define mqtt_warning(...) log_warning("MQTT", __VA_ARGS__) 34 | #define mqtt_info(...) log_info("MQTT", __VA_ARGS__) 35 | #define mqtt_debug(...) log_debug("MQTT", __VA_ARGS__) 36 | #else 37 | #define mqtt_emerg(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 38 | #define mqtt_crit(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 39 | #define mqtt_err(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 40 | #define mqtt_warning(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 41 | #define mqtt_info(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 42 | #define mqtt_debug(...) do{HAL_Printf(__VA_ARGS__);HAL_Printf("\r\n");}while(0) 43 | #endif 44 | 45 | #endif /* __IOTX_MQTT_INTERNAL_H__ */ 46 | 47 | -------------------------------------------------------------------------------- /iotkit-embedded/src/mqtt/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_mqtt.a 2 | HDR_REFS := src/infra 3 | LIB_SRCS_PATTERN := *.c 4 | 5 | SRCS_mqtt-example := examples/mqtt_example.c 6 | SRCS_mqtt-example-at := examples/mqtt_example_at.c 7 | 8 | $(call Append_Conditional, LIB_SRCS_PATTERN, impl/*.c, MQTT_DEFAULT_IMPL) 9 | $(call Append_Conditional, TARGET, mqtt-example, MQTT_COMM_ENABLED, ATM_ENABLED BUILD_AOS NO_EXECUTABLES) 10 | $(call Append_Conditional, TARGET, mqtt-example-at, ATM_ENABLED BUILD_AOS NO_EXECUTABLES) 11 | 12 | DEPENDS += external_libs/mbedtls 13 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 14 | -------------------------------------------------------------------------------- /iotkit-embedded/src/ota/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_ota.a 2 | 3 | HDR_REFS := src/infra 4 | 5 | DEPENDS += wrappers 6 | LDFLAGS += -liot_sdk -liot_hal -liot_tls 7 | 8 | LIB_SRCS_PATTERN := *.c 9 | 10 | LIB_SRCS_EXCLUDE += examples/ota_example_mqtt.c 11 | SRCS_ota-example-mqtt := examples/ota_example_mqtt.c 12 | 13 | $(call Append_Conditional, TARGET, ota-example-mqtt, OTA_ENABLED, BUILD_AOS NO_EXECUTABLES) 14 | -------------------------------------------------------------------------------- /iotkit-embedded/src/ota/iotx_ota.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __IOTX_OTA_H__ 6 | #define __IOTX_OTA_H__ 7 | 8 | int iotx_ota_get_config(void *handle, const char *configScope, const char *getType, 9 | const char *attributeKeys); 10 | 11 | int iotx_req_image(void *handle, const char *version); 12 | 13 | #endif /* #ifndef __IOTX_OTA_H__ */ 14 | 15 | 16 | -------------------------------------------------------------------------------- /iotkit-embedded/src/ota/iotx_ota_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __IOTX_OTA_CONFIG_H__ 6 | #define __IOTX_OTA_CONFIG_H__ 7 | 8 | #ifndef OTA_SIGNAL_CHANNEL 9 | #define OTA_SIGNAL_CHANNEL (1) 10 | #endif 11 | 12 | #endif /* __IOTX_OTA_CONFIG_H__ */ 13 | 14 | 15 | -------------------------------------------------------------------------------- /iotkit-embedded/src/ota/ota_wrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef _OTA_WRAPPER_H_ 2 | #define _OTA_WRAPPER_H_ 3 | 4 | #include "infra_types.h" 5 | 6 | void *HAL_Malloc(uint32_t size); 7 | void HAL_Free(void *ptr); 8 | void HAL_Printf(const char *fmt, ...); 9 | int HAL_Snprintf(char *str, const int len, const char *fmt, ...); 10 | 11 | int HAL_SetProductKey(char *product_key); 12 | int HAL_SetDeviceName(char *device_name); 13 | int HAL_SetDeviceSecret(char *device_secret); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/dev_ap/awss_dev_ap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_DEV_AP_H__ 6 | #define __AWSS_DEV_AP_H__ 7 | 8 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 9 | extern "C" 10 | { 11 | #endif 12 | 13 | int awss_dev_ap_stop(void); 14 | int awss_dev_ap_start(void); 15 | int wifimgr_process_dev_ap_switchap_request(void *ctx, void *resource, void *remote, void *request); 16 | 17 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 18 | } 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/frameworks/aplist/awss_aplist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_APLIST_H__ 6 | #define __AWSS_APLIST_H__ 7 | 8 | #include 9 | #include "os.h" 10 | #include "zconfig_protocol.h" 11 | 12 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 13 | extern "C" 14 | { 15 | #endif 16 | #ifdef AWSS_SUPPORT_APLIST 17 | struct ap_info { 18 | uint8_t auth; 19 | uint8_t channel; 20 | uint8_t encry[2]; 21 | uint8_t mac[ETH_ALEN]; 22 | char ssid[ZC_MAX_SSID_LEN]; 23 | signed char rssi; 24 | }; 25 | 26 | void aws_try_adjust_chan(void); 27 | 28 | int awss_clear_aplist(void); 29 | int awss_is_ready_clr_aplist(void); 30 | int awss_open_aplist_monitor(void); 31 | int awss_close_aplist_monitor(void); 32 | int awss_init_ieee80211_aplist(void); 33 | int awss_deinit_ieee80211_aplist(void); 34 | int awss_get_auth_info(uint8_t *ssid, uint8_t *bssid, uint8_t *auth, 35 | uint8_t *encry, uint8_t *channel); 36 | int awss_ieee80211_aplist_process(uint8_t *mgmt_header, int len, int link_type, 37 | struct parser_res *res, signed char rssi); 38 | int awss_save_apinfo(uint8_t *ssid, uint8_t* bssid, uint8_t channel, uint8_t auth, 39 | uint8_t pairwise_cipher, uint8_t group_cipher, signed char rssi); 40 | 41 | /* storage to store apinfo */ 42 | extern struct ap_info *zconfig_aplist; 43 | /* aplist num, less than MAX_APLIST_NUM */ 44 | extern uint8_t zconfig_aplist_num; 45 | #endif 46 | 47 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 48 | } 49 | #endif 50 | #endif 51 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/frameworks/awss_main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_MAIN_H__ 6 | #define __AWSS_MAIN_H__ 7 | 8 | #include "awss_log.h" 9 | 10 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 11 | extern "C" 12 | { 13 | #endif 14 | 15 | #define DEFAULT_SSID zc_default_ssid 16 | #define DEFAULT_PASSWD zc_default_passwd 17 | #define ADHA_SSID zc_adha_ssid 18 | #define ADHA_PASSWD zc_adha_passwd 19 | 20 | extern const char *zc_default_ssid; 21 | extern const char *zc_default_passwd; 22 | extern const char *zc_adha_ssid; 23 | extern const char *zc_adha_passwd; 24 | 25 | int __awss_start(void); 26 | int __awss_stop(void); 27 | 28 | int awss_cancel_aha_monitor(void); 29 | 30 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/frameworks/awss_smartconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_SMARTCONFIG_H__ 6 | #define __AWSS_SMARTCONFIG_H__ 7 | 8 | #include 9 | #include "os.h" 10 | #include "zconfig_lib.h" 11 | #include "zconfig_ieee80211.h" 12 | #include "zconfig_protocol.h" 13 | 14 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 15 | extern "C" 16 | { 17 | #endif 18 | 19 | /* invalid channel, neither 0, 0xff, nor 1-13 */ 20 | #define INVALID_CHANNEL (0) 21 | #define PAYLOAD_BITS_CNT (7) 22 | #define PAYLOAD_BITS_MASK ((1 << PAYLOAD_BITS_CNT) - 1) 23 | 24 | extern const uint8_t zconfig_fixed_offset[ZC_ENC_TYPE_MAX + 1][2]; 25 | extern const uint16_t zconfig_hint_frame[]; 26 | 27 | uint8_t is_data_frame(uint16_t len); 28 | uint8_t is_start_frame(uint16_t len); 29 | uint8_t is_group_frame(uint16_t len); 30 | uint8_t get_data_index(uint16_t len); 31 | uint8_t get_group_index(uint16_t len); 32 | 33 | int zconfig_recv_completed(uint8_t tods); 34 | int zconfig_get_ssid_passwd(uint8_t tods); 35 | int package_cmp(uint8_t *package, uint8_t *src, uint8_t *dst, uint8_t tods, uint16_t len); 36 | int package_save(uint8_t *package, uint8_t *src, uint8_t *dst, uint8_t tods, uint16_t len); 37 | int awss_recv_callback_smartconfig(struct parser_res *res); 38 | int awss_ieee80211_smartconfig_process(uint8_t *ieee80211, int len, int link_type, 39 | struct parser_res *res, signed char rssi); 40 | 41 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 42 | } 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/frameworks/utils/awss_aes_wrapper.h: -------------------------------------------------------------------------------- 1 | 2 | #include "wifi_provision_internal.h" 3 | 4 | p_HAL_Aes128_t awss_Aes128_Init( 5 | const uint8_t *key, 6 | const uint8_t *iv); 7 | 8 | int awss_Aes128_Destroy(p_HAL_Aes128_t aes); 9 | 10 | int awss_Aes128_Cbc_Decrypt( 11 | p_HAL_Aes128_t aes, 12 | const void *src, 13 | size_t blockNum, 14 | void *dst); 15 | 16 | int awss_Aes128_Cfb_Decrypt( 17 | p_HAL_Aes128_t aes, 18 | const void *src, 19 | size_t length, 20 | void *dst); 21 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/frameworks/utils/awss_crypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_CRYPT_H__ 6 | #define __AWSS_CRYPT_H__ 7 | 8 | enum { 9 | SEC_LVL_OPEN = 0, /* open */ 10 | SEC_LVL_AES256, /* AES256 */ 11 | SEC_LVL_AES128_DEFAULT, /* AES128 with default key */ 12 | SEC_LVL_AES128_PRODUCT, /* AES128 with key from product_sec */ 13 | SEC_LVL_AES128_DEVICE, /* AES128 with key from device_sec */ 14 | SEC_LVL_AES128_MANU, /* AES128 with key from manufacturer_sec */ 15 | }; 16 | 17 | int aes_decrypt_string(char *cipher, char *plain, int len, int cipher_hex, int sec_lvl, char cbc, const char *rand); 18 | 19 | int awss_get_encrypt_type(); 20 | #endif 21 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/frameworks/utils/zconfig_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __ZCONFIG_UTILS_H__ 6 | #define __ZCONFIG_UTILS_H__ 7 | 8 | #include "os.h" 9 | 10 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 11 | extern "C" 12 | { 13 | #endif 14 | 15 | void dump_mac(uint8_t *src, uint8_t *dst); 16 | void dump_hex(uint8_t *data, int len, int tab_num); 17 | void dump_ascii(uint8_t *data, int len, int tab_num); 18 | 19 | uint16_t zconfig_checksum_v3(uint8_t *data, uint8_t len); 20 | char is_utf8(const char *ansi_str, int length); 21 | 22 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/ht40/awss_ht40.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_HT40_H__ 6 | #define __AWSS_HT40_H__ 7 | 8 | #ifdef AWSS_SUPPORT_HT40 9 | 10 | #include 11 | #include "os.h" 12 | #include "zconfig_ieee80211.h" 13 | #include "zconfig_protocol.h" 14 | 15 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 16 | extern "C" 17 | { 18 | #endif 19 | 20 | struct ht40_ctrl { 21 | uint16_t length; 22 | uint8_t filter; 23 | signed char rssi; 24 | }; 25 | 26 | int ht40_init(void); 27 | int awss_ieee80211_ht_ctrl_process(uint8_t *ht_ctrl, int len, int link_type, 28 | struct parser_res *res, signed char rssi); 29 | int awss_recv_callback_ht_ctrl(struct parser_res *res); 30 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 31 | } 32 | #endif 33 | #endif 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_awss.a 2 | 3 | LIB_SRCS_PATTERN := *.c 4 | 5 | $(call Append_Conditional, LIB_SRCS_PATTERN, smartconfig/*.c, AWSS_SUPPORT_SMARTCONFIG) 6 | $(call Append_Conditional, LIB_SRCS_PATTERN, p2p/*.c, AWSS_SUPPORT_SMARTCONFIG_WPS) 7 | $(call Append_Conditional, LIB_SRCS_PATTERN, zero_config/*.c, AWSS_SUPPORT_ZEROCONFIG) 8 | $(call Append_Conditional, LIB_SRCS_PATTERN, phone_ap/*.c, AWSS_SUPPORT_AHA) 9 | $(call Append_Conditional, LIB_SRCS_PATTERN, router_ap/*.c, AWSS_SUPPORT_ADHA) 10 | $(call Append_Conditional, LIB_SRCS_PATTERN, dev_ap/*.c, AWSS_SUPPORT_DEV_AP) 11 | $(call Append_Conditional, LIB_SRCS_PATTERN, frameworks/*.c, AWSS_FRAMEWORKS) 12 | $(call Append_Conditional, LIB_SRCS_PATTERN, frameworks/*/*.c, AWSS_FRAMEWORKS) 13 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/p2p/awss_wps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_WPS_H__ 6 | #define __AWSS_WPS_H__ 7 | 8 | #ifdef AWSS_SUPPORT_SMARTCONFIG_WPS 9 | 10 | #include 11 | #include "os.h" 12 | #include "zconfig_ieee80211.h" 13 | 14 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 15 | extern "C" 16 | { 17 | #endif 18 | 19 | #define WLAN_OUI_MICROSOFT (0x0050F2) 20 | #define WLAN_OUI_WPS (0x0050F2) 21 | #define WLAN_OUI_TYPE_MICROSOFT_WPA (1) 22 | #define WLAN_OUI_TYPE_WPS (4) 23 | 24 | int awss_recv_callback_wps(struct parser_res *res); 25 | int awss_ieee80211_wps_process(uint8_t *mgmt_header, int len, int link_type, 26 | struct parser_res *res, signed char rssi); 27 | 28 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 29 | } 30 | #endif 31 | #endif /* end AWSS_SUPPORT_SMARTCONFIG_WPS */ 32 | #endif 33 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/phone_ap/awss_aha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_AHA_H__ 6 | #define __AWSS_AHA_H__ 7 | 8 | #include 9 | #include "os.h" 10 | #include "zconfig_ieee80211.h" 11 | 12 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 13 | extern "C" 14 | { 15 | #endif 16 | 17 | int awss_open_aha_monitor(void); 18 | int awss_close_aha_monitor(void); 19 | int awss_aha_monitor_is_timeout(void); 20 | int aws_send_aha_probe_req(void); 21 | int awss_recv_callback_aha_ssid(struct parser_res *res); 22 | int awss_ieee80211_aha_process(uint8_t *mgmt_header, int len, int link_type, struct parser_res *res, signed char rssi); 23 | 24 | extern const char *zc_default_ssid; 25 | extern const char *zc_default_passwd; 26 | 27 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 28 | } 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/phone_ap/awss_wifimgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_WIFIMGR_H__ 6 | #define __AWSS_WIFIMGR_H__ 7 | 8 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 9 | extern "C" 10 | { 11 | #endif 12 | 13 | #if defined(AWSS_SUPPORT_ADHA) || defined(AWSS_SUPPORT_AHA) 14 | 15 | enum { 16 | SHUB_ERR, 17 | SHUB_OK 18 | }; 19 | 20 | int wifimgr_process_get_wifilist_request(void *ctx, void *resource, void *remote, void *request); 21 | int wifimgr_process_mcast_get_device_info(void *ctx, void *resource, void *remote, void *request); 22 | int wifimgr_process_ucast_get_device_info(void *ctx, void *resource, void *remote, void *request); 23 | int wifimgr_process_switch_ap_request(void *ctx, void *resource, void *remote, void *request); 24 | 25 | #endif 26 | 27 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /iotkit-embedded/src/wifi_provision/router_ap/awss_adha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __AWSS_ADHA_H__ 6 | #define __AWSS_ADHA_H__ 7 | 8 | #if defined(AWSS_SUPPORT_ADHA) || defined(AWSS_SUPPORT_AHA) 9 | 10 | #include "zconfig_lib.h" 11 | #include "zconfig_protocol.h" 12 | 13 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 14 | extern "C" 15 | { 16 | #endif 17 | 18 | struct adha_info { 19 | uint8_t try_idx; 20 | uint8_t cnt; 21 | uint8_t aplist[MAX_APLIST_NUM]; 22 | }; 23 | 24 | int awss_init_adha_aplist(void); 25 | int awss_deinit_adha_aplist(void); 26 | extern struct adha_info *adha_aplist; 27 | extern const char *zc_adha_passwd; 28 | extern const char *zc_adha_ssid; 29 | 30 | #ifdef AWSS_SUPPORT_ADHA 31 | int awss_open_adha_monitor(void); 32 | int awss_close_adha_monitor(void); 33 | int aws_send_adha_probe_req(void); 34 | 35 | int awss_is_ready_switch_next_adha(void); 36 | int awss_recv_callback_adha_ssid(struct parser_res *res); 37 | int awss_ieee80211_adha_process(uint8_t *mgmt_header, int len, int link_type, 38 | struct parser_res *res, signed char rssi); 39 | #endif 40 | 41 | #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */ 42 | } 43 | #endif 44 | #endif /* end AWSS_SUPPORT_ADHA || AWSS_SUPPORT_AHA */ 45 | #endif 46 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/Config.in: -------------------------------------------------------------------------------- 1 | mainmenu "Main Menu" 2 | comment "Configure C-SDK for IoT Embedded Devices" 3 | 4 | source "tools/menu/Config.infra" 5 | source "tools/menu/Config.dev_sign" 6 | source "tools/menu/Config.mqtt" 7 | source "tools/menu/Config.dynamic_register" 8 | source "tools/menu/Config.dev_model" 9 | source "tools/menu/Config.wrappers" 10 | source "tools/menu/Config.atm" 11 | source "tools/menu/Config.ota" 12 | source "tools/menu/Config.coap" 13 | source "tools/menu/Config.dev_reset" 14 | source "tools/menu/Config.http" 15 | source "tools/menu/Config.http2" 16 | source "tools/menu/Config.wifi_provision" 17 | source "tools/menu/Config.dev_bind" 18 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/board/config.alios.esp8266: -------------------------------------------------------------------------------- 1 | CONFIG_ENV_CFLAGS += \ 2 | -DBOARD_ESP8266 -u call_user_start \ 3 | -fno-inline-functions \ 4 | -ffunction-sections \ 5 | -fdata-sections \ 6 | -mlongcalls \ 7 | -DESPOS_FOR_ESP8266 -Wl,-static \ 8 | -DXT_USE_THREAD_SAFE_CLIB=0 \ 9 | 10 | CONFIG_ENV_CFLAGS += \ 11 | -Os \ 12 | -DCONFIG_MQTT_TX_MAXLEN=640 \ 13 | -DCONFIG_MQTT_RX_MAXLEN=1200 \ 14 | 15 | 16 | CONFIG_external_libs/mbedtls := 17 | CONFIG_tests := 18 | 19 | CROSS_PREFIX := xtensa-lx106-elf- 20 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/board/config.alios.mk3080: -------------------------------------------------------------------------------- 1 | CONFIG_ENV_CFLAGS += \ 2 | -mcpu=cortex-m4 -march=armv7-m -mthumb \ 3 | -mthumb-interwork -mlittle-endian \ 4 | -fno-short-enums \ 5 | -DCONFIG_PLATFORM_8711B -DM3 -w \ 6 | 7 | CONFIG_ENV_CFLAGS += \ 8 | -Os \ 9 | -DCONFIG_MQTT_TX_MAXLEN=640 \ 10 | -DCONFIG_MQTT_RX_MAXLEN=1200 \ 11 | 12 | CONFIG_external_libs/mbedtls := 13 | CONFIG_tests := 14 | 15 | CROSS_PREFIX := arm-none-eabi- 16 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/board/config.ubuntu.x86: -------------------------------------------------------------------------------- 1 | CONFIG_ENV_CFLAGS += \ 2 | -Os -Wall \ 3 | -g3 --coverage \ 4 | -D_PLATFORM_IS_LINUX_ \ 5 | -D__UBUNTU_SDK_DEMO__ \ 6 | 7 | CONFIG_ENV_CFLAGS += \ 8 | -DWITH_MQTT_DYN_BUF=1 \ 9 | -DWITH_MEM_STATS=0 \ 10 | -DWITH_MEM_STATS_PER_MODULE=0 \ 11 | -DWITH_MQTT_JSON_FLOW=1 \ 12 | -DWITH_MQTT_ZIP_TOPIC=1 \ 13 | -DWITH_MQTT_SUB_SHORTCUT=1 \ 14 | -DSDK_TEAM_TEST \ 15 | 16 | CONFIG_ENV_CFLAGS += \ 17 | -DCONFIG_MQTT_RX_MAXLEN=5000 \ 18 | -DCONFIG_MBEDTLS_DEBUG_LEVEL=0 \ 19 | 20 | 21 | CONFIG_ENV_CFLAGS += -rdynamic 22 | CONFIG_ENV_CFLAGS += -Werror -Wno-unused 23 | 24 | CONFIG_ENV_LDFLAGS += -lpthread -lrt 25 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/_rules-complib.mk: -------------------------------------------------------------------------------- 1 | .PHONY: comp-lib 2 | 3 | ifdef COMP_LIB 4 | ifeq (dynamic,$(CONFIG_LIB_EXPORT)) 5 | define Finalize_CompLib 6 | ( \ 7 | $(CC) -shared -Os -o $(2)/lib$(3).so $(1) $(LDFLAGS); \ 8 | ) 9 | endef 10 | define Info_CompLib 11 | ( \ 12 | EXIST_OBJS="$$(ls $(2) 2>/dev/null)"; \ 13 | \ 14 | echo -ne "\033[1;32m"; \ 15 | printf "\r%-40s%s\n" "[AR] lib$(1).so" "<= "; \ 16 | for i in $${EXIST_OBJS}; do \ 17 | printf "%-40s%s\n" "" " $${i}"|$(SED) 's,$(LIBOBJ_TMPDIR)/,,g'; \ 18 | done; \ 19 | echo -ne "\033[0m"; \ 20 | ) 21 | endef 22 | else 23 | define Finalize_CompLib 24 | ( \ 25 | EXIST_OBJS="$$(ls $(1) 2>/dev/null)"; \ 26 | \ 27 | if [ "$${EXIST_OBJS}" != "" ]; then \ 28 | $(AR) -rcs $(2)/lib$(3).a $${EXIST_OBJS}; \ 29 | fi \ 30 | ) 31 | endef 32 | define Info_CompLib 33 | ( \ 34 | EXIST_OBJS="$$(ls $(2) 2>/dev/null)"; \ 35 | \ 36 | echo -ne "\033[1;35m"; \ 37 | printf "\r%-40s%s\n" "[AR] lib$(1).a" "<= "; \ 38 | for i in $${EXIST_OBJS}; do \ 39 | printf "%-40s%s\n" "" " $${i}"|$(SED) 's,$(LIBOBJ_TMPDIR)/,,g'; \ 40 | done; \ 41 | echo -ne "\033[0m"; \ 42 | ) 43 | endef 44 | endif # dynamic 45 | endif # COMP_LIB 46 | 47 | comp-lib: toolchain 48 | ifdef COMP_LIB 49 | $(TOP_Q)+( \ 50 | if [ -f $(STAMP_PRJ_CFG) ]; then true; else \ 51 | $(call Build_CompLib,FORCE) \ 52 | fi) 53 | else 54 | $(Q)true 55 | endif 56 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/_rules-coverage.mk: -------------------------------------------------------------------------------- 1 | .PHONY: coverage lcov test 2 | 3 | ifneq (,$(COVERAGE_LIST)) 4 | COVERAGE_PROGS := \( 5 | COVERAGE_PROGS += $(COVERAGE_LIST) 6 | COVERAGE_PROGS += \) 7 | COVERAGE_CMD := $(RULE_DIR)/scripts/exe_coverage_progs.sh 8 | endif 9 | 10 | ifeq (,$(COVERAGE_CMD)) 11 | coverage lcov test: 12 | @echo "COVERAGE_CMD not defined, skip" 13 | else 14 | coverage lcov test: 15 | # 16 | # SKIP --coverage existence in $(CFLAGS) checking for now 17 | # 18 | $(Q)$(MAKE) --no-print-directory WITH_LCOV=1 19 | 20 | $(Q)OUTPUT_DIR=$(OUTPUT_DIR) bash <($(SED) '2iPROGS=$(COVERAGE_PROGS)' $(COVERAGE_CMD)) || true 21 | 22 | $(Q)CFLAGS=$(CFLAGS) \ 23 | $(foreach V,$(INFO_ENV_VARS),$(V)="$($(V))") \ 24 | bash $(RULE_DIR)/scripts/gen_lcov_report.sh 25 | 26 | endif 27 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/_rules-kmod.mk: -------------------------------------------------------------------------------- 1 | ifdef KMOD_TARGET 2 | KMOD_NAME := $(subst .o,,$(obj-m)) 3 | KMOD_OBJS := $(foreach mod, $(KMOD_NAME), $($(mod)-objs)) 4 | KMOD_SRCS := $(subst .o,.c,$(KMOD_OBJS)) 5 | KMOD_BUILD_DIR := $(CURDIR)/build-$(shell $(SHELL_DBG) basename $(CURDIR))-kmod 6 | KMOD_MAKEFILE := $(KMOD_BUILD_DIR)/Makefile 7 | 8 | $(firstword $(KMOD_TARGET)): $(KMOD_SRCS) 9 | $(Q)rm -rf $(KMOD_BUILD_DIR) && mkdir -p $(KMOD_BUILD_DIR) 10 | $(Q)cp -f $(KMOD_SRCS) $(KMOD_BUILD_DIR) 11 | $(Q)echo "EXTRA_CFLAGS += " \ 12 | "-I$(CURDIR)" \ 13 | "$(INTERNAL_INCLUDES)" \ 14 | | $(SED) 's/-I/\\\n -I/g' \ 15 | >> $(KMOD_MAKEFILE) 16 | $(Q)echo "" >> $(KMOD_MAKEFILE) 17 | $(Q)echo "obj-m := $(obj-m)" >> $(KMOD_MAKEFILE) 18 | $(Q)echo "" >> $(KMOD_MAKEFILE) 19 | $(Q) \ 20 | $(foreach mod, $(KMOD_NAME), \ 21 | echo "$(mod)-objs := $($(mod)-objs)" \ 22 | | $(SED) 's/ [_a-z]*\.o/ \\\n &/g' \ 23 | >> $(KMOD_MAKEFILE); \ 24 | echo "" >> $(KMOD_MAKEFILE); \ 25 | ) 26 | @$(call Brief_Log,"CC",$(KMOD_TARGET)) 27 | $(Q) \ 28 | LDFLAGS=""; \ 29 | $(MAKE) -C $(KERNEL_DIR) M=$(KMOD_BUILD_DIR) CROSS_COMPILE=$(CROSS_PREFIX) modules 30 | $(Q)cp -f $(KMOD_BUILD_DIR)/*.ko $(CURDIR) 31 | $(Q)mkdir -p $(SYSROOT_LIB) 32 | $(Q)install -m 0755 $(KMOD_BUILD_DIR)/*.ko $(SYSROOT_LIB) 33 | 34 | endif # ifdef KMOD_TARGET 35 | 36 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/_rules-modinfo.mk: -------------------------------------------------------------------------------- 1 | .PHONY: modinfo 2 | 3 | modinfo: 4 | @true 5 | 6 | MODINFO_VARS := \ 7 | EXTRA_SRCS \ 8 | PKG_SWITCH \ 9 | ORIGIN \ 10 | PKG_SOURCE \ 11 | PKG_BRANCH \ 12 | PKG_REVISION \ 13 | PKG_UPSTREAM \ 14 | REF_CFLAGS \ 15 | REF_LDFLAGS \ 16 | LDFLAGS \ 17 | LIBA_TARGET \ 18 | LIB_OBJS \ 19 | TARGET \ 20 | LIBSO_TARGET \ 21 | 22 | ifneq (,$(CONFIG_$(MODULE_NAME))) 23 | $(if $(filter modinfo,$(MAKECMDGOALS)), \ 24 | $(if $(strip $(DEPENDS)), \ 25 | $(info DEPENDS_$(MODULE_NAME) = $(strip $(DEPENDS))) \ 26 | $(info CONFIG_$(MODULE_NAME) = $(CONFIG_$(MODULE_NAME))) \ 27 | ) \ 28 | ) 29 | 30 | $(if $(filter modinfo,$(MAKECMDGOALS)), \ 31 | $(foreach v, $(MODINFO_VARS), \ 32 | $(if $(strip $($(v))), \ 33 | $(info $(v)_$(MODULE_NAME) = $(strip $($(v)))) \ 34 | ) \ 35 | ) \ 36 | ) 37 | 38 | ifeq (0,$(words $(TARGET))) 39 | else 40 | ifeq (1,$(words $(TARGET))) 41 | 42 | $(if $(filter modinfo,$(MAKECMDGOALS)), \ 43 | $(info SRCS_$(TARGET) = $(if $(SRCS_$(TARGET)), \ 44 | $(subst $(TOP_DIR)/,,$(SRCS_$(TARGET))), \ 45 | $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(SRCS)))) \ 46 | ) 47 | 48 | else 49 | 50 | $(if $(filter modinfo,$(MAKECMDGOALS)), \ 51 | $(foreach v, $(TARGET), \ 52 | $(info SRCS_$(v) = $(SRCS_$(v))) \ 53 | ) \ 54 | ) 55 | 56 | endif 57 | endif 58 | endif 59 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/_rules-prefix.mk: -------------------------------------------------------------------------------- 1 | ifeq (,$(findstring llvm,$(CC))) 2 | CFLAGS := "$(sort $(CFLAGS) $(CONFIG_ENV_CFLAGS))" 3 | else 4 | CFLAGS := "$(CFLAGS) $(CONFIG_ENV_CFLAGS)" 5 | endif 6 | 7 | LDFLAGS := $(sort $(LDFLAGS) $(CONFIG_ENV_LDFLAGS)) 8 | 9 | ifeq (dynamic,$(CONFIG_LIB_EXPORT)) 10 | CFLAGS := $(filter-out --coverage,$(CFLAGS)) 11 | endif 12 | 13 | MAKE_ENV_VARS := \ 14 | $(foreach v, \ 15 | $(shell grep -o 'CONFIG_ENV_[_A-Z]*' $(CONFIG_TPL) 2>/dev/null), \ 16 | $(subst CONFIG_ENV_,,$(v)) \ 17 | ) 18 | 19 | # $(eval ...) causes '$' in CFLAGS lost 20 | MAKE_ENV_VARS := $(sort $(filter-out CFLAGS LDFLAGS,$(MAKE_ENV_VARS))) 21 | 22 | $(foreach V, \ 23 | $(MAKE_ENV_VARS), \ 24 | $(eval export $(V) := $(sort $(CONFIG_ENV_$(V)))) \ 25 | ) 26 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/_rules-repo.mk: -------------------------------------------------------------------------------- 1 | OPS_CMDLINE_V := \ 2 | PACKAGE_DIR \ 3 | TOP_DIR \ 4 | STAMP_BLD_VAR \ 5 | 6 | OPS_SCRIPT := \ 7 | $(strip $(foreach V, $(OPS_CMDLINE_V), $(V)="$($(V))")) \ 8 | $(SHELL) \ 9 | $(RULE_DIR)/scripts/ops_repository.sh \ 10 | $(STAMP_BLD_VAR) 11 | 12 | repo-list: config 13 | $(TOP_Q)$(OPS_SCRIPT) list 14 | 15 | repo-update: config 16 | $(TOP_Q)$(OPS_SCRIPT) update 17 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/docs/Help.md: -------------------------------------------------------------------------------- 1 | 常用命令 2 | --- 3 | 4 | | 命令 | 解释 | 5 | |-----------------------|-----------------------------------------------------------------------------------| 6 | | `make distclean` | **清除一切编译过程产生的中间文件, 使当前目录仿佛和刚刚clone下来一样** | 7 | | `make` | **使用默认的或者已选中的平台配置文件开始编译** | 8 | | `make reconfig` | **弹出多平台选择菜单, 用户可按数字键选择, 然后根据相应的硬件平台配置开始编译** | 9 | | `make config` | **显示当前被选择的平台配置文件** | 10 | | `make menuconfig` | **图形化的编辑 make.settings 文件** | 11 | | `make help` | **打印帮助文本** | 12 | | `make env` | **打印当前编译的选项和它们的值** | 13 | 14 | o 访问 https://code.aliyun.com/edward.yangx/public-docs/wikis/home 可获得编译系统线上最新和最全的帮助文档 15 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed. 4 | # Called by "git commit" with no arguments. The hook should 5 | # exit with non-zero status after issuing an appropriate message if 6 | # it wants to stop the commit. 7 | # 8 | # To enable this hook, rename this file to "pre-commit". 9 | 10 | for i in `git status -s | awk '{ print $NF }'`; do 11 | j=$(echo $(basename $i)|cut -d'.' -f2) 12 | if [ "$j" = "c" -o "$j" = "h" -o "$j" = "md" -o "$j" = "mk" ] || [ "$i" = "makefile" -o "$i" = "make.settings" ]; then 13 | if [ "$(find $i -perm /111 2>/dev/null)" != "" ]; then 14 | chmod a-x $i 15 | echo "[chmod] $i" 16 | if [ "$(git status --short $i|cut -c1)" = "M" ]; then 17 | git add $i 18 | fi 19 | fi 20 | else 21 | echo "[skip ] $i" 22 | fi 23 | done 24 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/misc/config.generic.cmake: -------------------------------------------------------------------------------- 1 | CONFIG_ENV_CFLAGS += \ 2 | -Os -Wall \ 3 | -D_PLATFORM_IS_HOST_ \ 4 | 5 | LDFLAGS += -lpthread -lrt 6 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/misc/config.generic.default: -------------------------------------------------------------------------------- 1 | CONFIG_ENV_CFLAGS += -Wall 2 | CONFIG_ENV_CFLAGS += --coverage 3 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/scripts/add_license.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | TEXT=( 4 | "Copyright (c) 2014-2016 Alibaba Group. All rights reserved." 5 | "License-Identifier: Apache-2.0" 6 | "" 7 | "Licensed under the Apache License, Version 2.0 (the \"License\"); you may" 8 | "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, WITHOUT" 15 | "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 | 21 | TOTAL_LINE=${#TEXT[@]} 22 | i=$(( TOTAL_LINE - 1 )) 23 | 24 | sed -i "1i\ */" $1 25 | while (( i >= 0 )); do 26 | j=$(eval echo '${TEXT['$i']}') 27 | 28 | if [ "$j" = "" ]; then 29 | sed -i "1i\ *" $1 30 | else 31 | if [ "$(echo $j|awk '{ print NF }')" = "1" ] && [ "$(echo $j | cut -c1-7)" = "http://" ]; then 32 | sed -i "1i\ * $j" $1 33 | else 34 | sed -i "1i\ * $j" $1 35 | fi 36 | fi 37 | 38 | i=$(( i - 1 )) 39 | done 40 | sed -i "1i\/*" $1 41 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/scripts/del_license.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | START_LINE=$(head -3 $1|grep -n '^ *\/\*'|cut -d':' -f1) 4 | END_LINE=$(grep -m 1 -n '^ *\*\/' $1|cut -d':' -f1) 5 | echo "[${START_LINE},${END_LINE}]" 6 | 7 | if [ "${START_LINE}" != "" ] && [ "${END_LINE}" != "" ]; then 8 | sed -i "${START_LINE},${END_LINE}d" $1 9 | echo "LICENSE REMOVED: $1" 10 | fi 11 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/scripts/exe_coverage_progs.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | set -e 3 | 4 | if [ "${OUTPUT_DIR}" = "" ] || [ ! -d ${OUTPUT_DIR} ]; then exit 1; fi 5 | 6 | cd ${OUTPUT_DIR}/usr/bin 7 | 8 | echo "" 9 | 10 | iter=0 11 | while (( iter < ${#PROGS[@]} )); do 12 | UT_CMD=$(eval echo '${PROGS['${iter}']}') 13 | UT_PROG=$(echo ${UT_CMD}|cut -d' ' -f1) 14 | 15 | echo "[${iter}] RUNNING '${UT_CMD}' with '${UT_PROG}'"|grep --color ".*" 16 | echo "" 17 | 18 | if [ -f ${UT_PROG} ]; then 19 | ${UT_CMD} 20 | else 21 | echo "${UT_CMD} SPECIFIED BUT ${UT_PROG} NOT FOUND"|grep --color ".*" 22 | fi 23 | 24 | iter=$(( iter + 1 )) 25 | done 26 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/build-rules/scripts/gen_cross_toolchain.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | procing() { 4 | trap 'exit 0;' 6 5 | while :; do 6 | for j in '-' '\\' '|' '/'; do 7 | tput sc 8 | echo -ne "[$j]" 9 | sleep 0.1 10 | tput rc 11 | done 12 | done 13 | } 14 | 15 | waiting() { 16 | local pid="$1" 17 | 18 | echo -ne "\033[1;32m" 19 | echo -n "$2 .................... " 20 | procing & 21 | 22 | local tmppid="$!" 23 | wait $pid 24 | tput rc 25 | 26 | echo "done" 27 | echo -ne "\033[0m" 28 | echo "" 29 | kill -6 $tmppid >/dev/null 1>&2 30 | } 31 | 32 | GIT_PREFIX="https://gitee.com/alios-things" 33 | 34 | LOCAL_CC=${TOOLCHAIN_DLDIR}/${RELPATH}/${CC} 35 | LOCAL_AR=${TOOLCHAIN_DLDIR}/${RELPATH}/${AR} 36 | 37 | # echo "[RELPATH]: ${RELPATH}" 38 | # echo "[GITPATH]: ${GITPATH}" 39 | 40 | which ${CC} > /dev/null 2>&1 41 | 42 | if [ $? != 0 ] && [ ! -f ${LOCAL_CC} ]; then 43 | 44 | if [ "${GITPATH}" = "" ]; then 45 | echo "Unable to find available toolchain of [${CC}] from local ENV or Internet. Abort!" | grep --color ".*" 46 | echo "" 47 | exit 1 48 | fi 49 | 50 | echo -n "${GIT_PREFIX}/${GITPATH} -> " 51 | echo -n "$(basename ${OUTPUT_DIR})/$(basename ${TOOLCHAIN_DLDIR})/" 52 | echo "$(dirname ${RELPATH})" 53 | echo "---" 54 | 55 | mkdir -p ${TOOLCHAIN_DLDIR} 56 | cd ${TOOLCHAIN_DLDIR} 57 | git clone -q ${GIT_PREFIX}/${GITPATH} & 58 | 59 | waiting "$!" "downloading toolchain for ${CC}" 60 | cd ${OLDPWD} 61 | 62 | fi 63 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/default_settings.mk: -------------------------------------------------------------------------------- 1 | DEFAULT_BLD ?= $(CONFIG_DIR)/config.ubuntu.x86 2 | POST_ENV_HOOK := Post_Env 3 | POST_FINAL_OUT_HOOK := Post_Distro 4 | 5 | ifeq (Darwin,$(shell uname)) 6 | POST_FINAL_OUT_HOOK := 7 | endif 8 | 9 | CONFIG_LIB_EXPORT ?= static 10 | 11 | # Default CFLAGS setting 12 | # 13 | CFLAGS += -ansi 14 | CFLAGS += -Wdeclaration-after-statement 15 | CFLAGS += -DFORCE_SSL_VERIFY 16 | 17 | # Default INCLUDE list 18 | # 19 | I_DIRS := \ 20 | include \ 21 | include/imports \ 22 | include/exports \ 23 | wrappers \ 24 | 25 | CFLAGS += $(foreach D,$(I_DIRS),$(if $(shell [ -d $(TOP_DIR)/$(D) ] && echo y), -I$(D))) 26 | 27 | # For one makefile Generation 28 | # 29 | EXTRA_INSTALL_HDRS := \ 30 | $(EXPORT_DIR)/iot_import.h \ 31 | $(EXPORT_DIR)/iot_export.h \ 32 | $(EXPORT_DIR)/imports \ 33 | $(EXPORT_DIR)/exports \ 34 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/internal_make_funcs.mk: -------------------------------------------------------------------------------- 1 | 2 | define Post_Env 3 | ( \ 4 | $(foreach V,$(SWITCH_VARS), \ 5 | $(if $(findstring FEATURE_,$(V)), \ 6 | printf "%-40s : %-s\n" "+ $(V)" "$(if $($(V)),$($(V)),n)"; \ 7 | ) \ 8 | ) \ 9 | echo ""; \ 10 | ) 11 | endef 12 | 13 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.atm: -------------------------------------------------------------------------------- 1 | config ATM_ENABLED 2 | bool "FEATURE_ATM_ENABLED" 3 | default n 4 | 5 | menu "ATM Configurations" 6 | depends on ATM_ENABLED 7 | 8 | config AT_TCP_ENABLED 9 | bool "FEATURE_AT_TCP_ENABLED" 10 | default n 11 | 12 | config AT_MQTT_ENABLED 13 | bool "FEATURE_AT_MQTT_ENABLED" 14 | depends on MQTT_COMM_ENABLED 15 | depends on !MQTT_DEFAULT_IMPL 16 | depends on !AT_TCP_ENABLED 17 | default n 18 | 19 | config AT_PARSER_ENABLED 20 | bool "FEATURE_AT_PARSER_ENABLED" 21 | default n 22 | 23 | choice 24 | prompt "AT HAL Configurations" 25 | depends on AT_PARSER_ENABLED 26 | default AT_HAL_NONE 27 | 28 | config AT_HAL_NONE 29 | bool "FEATURE_AT_HAL_NONE" 30 | default n 31 | 32 | config AT_TCP_HAL_MK3060 33 | bool "FEATURE_AT_TCP_HAL_MK3060" 34 | default n 35 | depends on AT_TCP_ENABLED 36 | 37 | config AT_TCP_HAL_SIM800 38 | bool "FEATURE_AT_TCP_HAL_SIM800" 39 | default n 40 | depends on AT_TCP_ENABLED 41 | 42 | config AT_MQTT_HAL_ICA 43 | bool "FEATURE_AT_MQTT_HAL_ICA" 44 | default n 45 | depends on AT_MQTT_ENABLED 46 | 47 | config AT_MQTT_HAL_SIM800 48 | bool "FEATURE_AT_MQTT_HAL_SIM800" 49 | default n 50 | depends on AT_MQTT_ENABLED 51 | 52 | endchoice 53 | 54 | endmenu 55 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.coap: -------------------------------------------------------------------------------- 1 | config COAP_COMM_ENABLED 2 | bool "FEATURE_COAP_COMM_ENABLED" 3 | default n 4 | select COAP_CLIENT 5 | 6 | help 7 | Establish non-persistent connection with AliCloud via CoAP-based protocol 8 | 9 | Switching to "y" leads to building CoAP related implementation into SDK and COAP_COMM_ENABLED included into CFLAGS 10 | Switching to "n" leads to keeping CoAP-based cloud connection implementations out of SDK 11 | 12 | config COAP_PACKET 13 | bool 14 | default n 15 | 16 | config COAP_CLIENT 17 | bool 18 | default n 19 | select INFRA_CJSON 20 | select INFRA_JSON_PARSER 21 | select INFRA_HTTPC 22 | select INFRA_SHA256 23 | select INFRA_MD5 24 | select INFRA_REPORT 25 | select INFRA_STRING 26 | select COAP_DTLS_SUPPORT 27 | select HAL_CRYPTO 28 | select HAL_UDP 29 | select COAP_PACKET 30 | 31 | config COAP_SERVER 32 | bool 33 | default n 34 | select INFRA_MD5 35 | select INFRA_STRING 36 | select INFRA_JSON_PARSER 37 | select INFRA_SHA1 38 | select HAL_UDP 39 | select HAL_KV 40 | select HAL_CRYPTO 41 | select COAP_PACKET 42 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.dev_bind: -------------------------------------------------------------------------------- 1 | config DEV_BIND_ENABLED 2 | 3 | bool "FEATURE_DEV_BIND_ENABLED" 4 | select INFRA_CLASSIC 5 | select INFRA_COMPAT 6 | select COAP_SERVER 7 | select MQTT_COMM_ENABLED 8 | default n 9 | help 10 | Enable dev-bind in SDK 11 | 12 | 13 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.dev_reset: -------------------------------------------------------------------------------- 1 | config DEV_RESET 2 | bool "FEATURE_DEV_RESET" 3 | default n 4 | select MQTT_COMM_ENABLED 5 | select HAL_KV 6 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.dev_sign: -------------------------------------------------------------------------------- 1 | config DEV_SIGN 2 | bool 3 | default y 4 | select INFRA_SHA256 5 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.dynamic_register: -------------------------------------------------------------------------------- 1 | config DYNAMIC_REGISTER 2 | bool "FEATURE_DYNAMIC_REGISTER" 3 | default n 4 | select INFRA_STRING 5 | select INFRA_HTTPC 6 | select INFRA_SHA256 7 | select SUPPORT_TLS 8 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.http: -------------------------------------------------------------------------------- 1 | 2 | config HTTP_COMM_ENABLED 3 | bool "FEATURE_HTTP_COMM_ENABLED" 4 | default n 5 | select INFRA_SHA1 6 | select INFRA_HTTPC 7 | select INFRA_REPORT 8 | select INFRA_JSON_PARSER 9 | select SUPPORT_TLS 10 | help 11 | Establish persistent connection with AliCloud via HTTP-based protocol 12 | 13 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.http2: -------------------------------------------------------------------------------- 1 | config HTTP2_COMM_ENABLED 2 | bool "FEATURE_HTTP2_COMM_ENABLED" 3 | select INFRA_HTTPC 4 | select INFRA_SHA1 5 | select INFRA_TIMER 6 | select SUPPORT_TLS 7 | select ON_DAILY 8 | select FS_ENABLED 9 | default n 10 | help 11 | Establish persistent connection with AliCloud via HTTP2-stream protocol 12 | 13 | config FS_ENABLED 14 | bool 15 | default n 16 | help 17 | USE HAL fs api to enable file upload feature 18 | 19 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.ota: -------------------------------------------------------------------------------- 1 | config OTA_ENABLED 2 | bool "FEATURE_OTA_ENABLED" 3 | depends on MQTT_COMM_ENABLED 4 | select INFRA_STRING 5 | select INFRA_JSON_PARSER 6 | select INFRA_HTTPC 7 | select INFRA_MD5 8 | select INFRA_SHA256 9 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/menu/Config.wrappers: -------------------------------------------------------------------------------- 1 | config HAL_KV 2 | bool 3 | default n 4 | 5 | config SUPPORT_TLS 6 | bool "FEATURE_SUPPORT_TLS" 7 | default y if OTA_ENABLED 8 | 9 | config HAL_CRYPTO 10 | bool 11 | default n 12 | 13 | config HAL_UDP 14 | bool 15 | default n 16 | 17 | config COAP_DTLS_SUPPORT 18 | bool 19 | default n 20 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/misc/compose.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | alias_map() 4 | { 5 | VAR_ALIAS="$1" 6 | VAR_NAME="$2" 7 | VAR_VAL="$(eval echo '${'${VAR_NAME}'}')" 8 | 9 | eval "${VAR_ALIAS}=${VAR_VAL}" 10 | VARS_LIST="${VARS_LIST} ${VAR_ALIAS}" 11 | } 12 | 13 | SELF_DIR=$(cd "$(dirname "$0")";pwd) 14 | JPARSER=${SELF_DIR}/JSON.sh 15 | MODEL_FL="${SELF_DIR}/../../model.json" 16 | SRC_FL="${SELF_DIR}/linkkit_example_auto.c" 17 | DST_FL="$1" 18 | VARS_FL="${PWD}/.temp_dm_auto_cache" 19 | VARS_LIST="" 20 | 21 | if [ -f ${MODEL_FL} ]; then 22 | echo "Processing [${MODEL_FL}] ..." 23 | fi 24 | 25 | ${JPARSER} -c < ${MODEL_FL} > ${VARS_FL} 26 | source ${VARS_FL} 27 | 28 | alias_map "DEVICE_PK" "profile__productKey" 29 | alias_map "DM_PROP_ID" "properties__0__identifier" 30 | alias_map "DM_EVT_ID" "events__1__identifier" 31 | alias_map "DM_EVT_OU_KEY" "events__1__outputData__0__identifier" 32 | 33 | mkdir -p $(dirname ${DST_FL}) 34 | cp ${SRC_FL} ${DST_FL} 35 | echo "Recognised Variables:" 36 | echo "" 37 | for iter in ${VARS_LIST}; do 38 | iter_val=$(eval echo '$'${iter}) 39 | printf "%16s : %-32s\n" ${iter} ${iter_val} 40 | sed -i "s: ###${iter}### :${iter_val}:g" ${DST_FL} 41 | done 42 | echo "" 43 | 44 | rm -f ${VARS_FL} 45 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/mock_build_options.mk: -------------------------------------------------------------------------------- 1 | 2 | ifeq (y,$(strip $(FEATURE_HTTP2_COMM_ENABLED))) 3 | CFLAGS := $(filter-out -DFORCE_SSL_VERIFY,$(CFLAGS)) 4 | endif 5 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/parse_make_settings.mk: -------------------------------------------------------------------------------- 1 | include $(CURDIR)/tools/internal_make_funcs.mk 2 | 3 | SWITCH_VARS := \ 4 | $(shell grep '''config [_A-Z]*''' \ 5 | $$(find -L $(TOP_DIR)/tools -name 'Config.*') \ 6 | | cut -d: -f2 \ 7 | | grep -v menuconfig \ 8 | | grep -v SRCPATH \ 9 | | awk '{ print $$NF }' \ 10 | ) 11 | SWITCH_VARS := $(foreach V,$(sort $(SWITCH_VARS)),FEATURE_$(V)) 12 | 13 | $(foreach v, \ 14 | $(SWITCH_VARS), \ 15 | $(if $(filter y,$($(v))), \ 16 | $(eval CFLAGS += -D$(subst FEATURE_,,$(v)))) \ 17 | ) 18 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/.libs/kconfig-conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/.libs/kconfig-conf -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/.libs/kconfig-mconf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/.libs/kconfig-mconf -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/.libs/libkconfig-parser-4.11.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/.libs/libkconfig-parser-4.11.0.dylib -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/AUTHORS: -------------------------------------------------------------------------------- 1 | Authors of kconfig-frontends. 2 | 3 | The developers of the Linux kernel are the original authors of the kconfig 4 | parser and frontends. The list is too long to reproduce here, but you can 5 | get a pretty complete list from the Linux kernel repository logs: 6 | git shortlog scripts/kconfig 7 | 8 | The packaging uses the GNU autotools build system, of which I 9 | will not try to list the many authors here. 10 | 11 | The initial packaging was done by: 12 | "Yann E. MORIN" 13 | 14 | For a complete list, see the commit-logs of the kconfig repository. 15 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/macos/kconfig-frontends-mac/kconfig-conf: -------------------------------------------------------------------------------- 1 | kconfig-mconf -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/bin/gawk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/bin/gawk -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/bin/kconfig-mconf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/bin/kconfig-mconf -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libalicrypto.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libalicrypto.a -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libcurl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libcurl.a -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libcurl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libcurl.so -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libid2client.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libid2client.a -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libitls.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libitls.a -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libkm.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libkm.a -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libmbedcrypto.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libmbedcrypto.a -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/ubuntu/libs/libplat_gen.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/ubuntu/libs/libplat_gen.a -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/README: -------------------------------------------------------------------------------- 1 | This package contains the kconfig frontends and parser. 2 | 3 | Kconfig is the configuration language used by the Linux kernel. This package 4 | is a simple copy of the frontends and the parser found in the Linux kernel 5 | source tree, with very minor changes to adapt them to being built out of 6 | the kernel build infrastructure. 7 | 8 | This package has been ported to Windows so the code has been changed to get 9 | it work properly. The package also contains a copy PDCurses with some minor 10 | changes. 11 | 12 | Under non Windows platforms use the original package from: 13 | http://ymorin.is-a-geek.org/projects/kconfig-frontends 14 | 15 | --- 16 | 17 | All required .dll files were added to the original package from uvc.de. 18 | 19 | This package and info about it can be found on http://distortos.org/ website. 20 | 21 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/kconfig-mconf.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/kconfig-mconf.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/libiconv2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/libiconv2.dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/libintl3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/libintl3.dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/regex2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/kconfig-frontends-3.12.0-windows/regex2.dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/MSVCRT40.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/MSVCRT40.DLL -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/Psapi.Dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/Psapi.Dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/ansi2knr.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/ansi2knr.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/basename.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/basename.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/bash.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/bash.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/bc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/bc.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/bison.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/bison.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cat.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cat.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/chgrp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/chgrp.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/chmod.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/chmod.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/chown.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/chown.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cksum.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cksum.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cmp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cmp.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/comm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/comm.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cp.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cpp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cpp.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/csplit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/csplit.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/curl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/curl.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cut.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cut.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cygwin1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cygwin1.dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cygwinb19.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/cygwinb19.dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/date.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/date.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dc.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dd.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/df.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/df.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/diff.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/diff.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/diff3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/diff3.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dircolors.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dircolors.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dirname.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/dirname.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/du.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/du.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/echo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/echo.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/egrep.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/egrep.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/env.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/env.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/expand.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/expand.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/expr.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/expr.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/factor.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/factor.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/false: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage="Usage: $0 [OPTION]... 4 | 5 | --help display this help and exit 6 | --version output version information and exit" 7 | 8 | case $# in 9 | 1 ) 10 | case "z${1}" in 11 | z--help ) 12 | echo "$usage"; exit 0 ;; 13 | z--version ) 14 | echo "false - @VERSION@"; exit 0 ;; 15 | * ) ;; 16 | esac 17 | ;; 18 | * ) ;; 19 | esac 20 | 21 | exit 1 22 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fgrep.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fgrep.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/find.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/find.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/flex.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/flex.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fltcr.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fltcr.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fmt.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fmt.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fold.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/fold.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gawk.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gawk.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gplay.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gplay.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/grep.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/grep.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gsar.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gsar.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gunzip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gunzip.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gzip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/gzip.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/head.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/head.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/id.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/id.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/indent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/indent.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/install.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/install.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/join.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/join.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/jwhois.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/jwhois.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/less.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/less.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/libcurl.dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/ln.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/ln.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/logname.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/logname.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/ls.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/ls.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/m4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/m4.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/make.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/make.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/md5sum.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/md5sum.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mkdir.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mkdir.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mkfifo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mkfifo.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mknod.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mknod.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/more.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/more.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mv.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mv.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mvdir.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/mvdir.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/nl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/nl.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/od.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/od.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/paste.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/paste.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/patch.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/patch.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/pr.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/pr.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/printenv.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/printenv.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/printf.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/printf.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/pwd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/pwd.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/recode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/recode.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/rm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/rm.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/rman.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/rman.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/rmdir.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/rmdir.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sdiff.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sdiff.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sed.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sed.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/seq.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/seq.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sh.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sh.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/shar.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/shar.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sleep.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sleep.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sort.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sort.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/split.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/split.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/start_shell.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Get the current directory 3 | REM 4 | for /f "tokens=* delims=/" %%A in ('cd') do set CURRENT_DIR=%%A 5 | 6 | SET SHELLDIR=%CURRENT_DIR% 7 | SET SHELL=%SHELLDIR%/bash.exe 8 | SET BASH=%SHELL% 9 | 10 | SET PATH=%SHELLDIR%;%PATH% 11 | 12 | "%SHELL%" %* 13 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/su.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/su.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sum.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sum.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sync.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/sync.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tac.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tac.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tail.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tail.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tar.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tar.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tee.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tee.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/test.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/test.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/touch.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/touch.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tr.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/tr.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/true: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage="Usage: $0 [OPTION]... 4 | 5 | --help display this help and exit 6 | --version output version information and exit" 7 | 8 | case $# in 9 | 1 ) 10 | case "z${1}" in 11 | z--help ) 12 | echo "$usage"; exit 0 ;; 13 | z--version ) 14 | echo "true - @VERSION@"; exit 0 ;; 15 | * ) ;; 16 | esac 17 | ;; 18 | * ) ;; 19 | esac 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/type.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/type.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uname.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uname.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/unexpand.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/unexpand.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uniq.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uniq.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/unshar.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/unshar.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/unzip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/unzip.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uudecode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uudecode.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uuencode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/uuencode.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/vi.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/vi.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/wc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/wc.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/wget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/wget.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/which.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/which.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/whoami.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/whoami.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/win32gnu.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/win32gnu.dll -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/xargs.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/xargs.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/yes.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RT-Thread-packages/ali-iotkit/f8f2f923e999bf7050b25e24c6b11862fd164ab5/iotkit-embedded/tools/prebuilt/windows/shell.w32-ix86/yes.exe -------------------------------------------------------------------------------- /iotkit-embedded/tools/project.mk: -------------------------------------------------------------------------------- 1 | # Settings of input directory 2 | # 3 | TOP_DIR := $(CURDIR) 4 | RULE_DIR := $(TOP_DIR)/tools/build-rules 5 | CONFIG_DIR := $(TOP_DIR)/tools/board 6 | EXPORT_DIR := 7 | IMPORT_DIR := tools/prebuilt 8 | 9 | # Settings of output directory 10 | # 11 | DIST_DIR := $(TOP_DIR)/output 12 | FINAL_DIR := $(DIST_DIR)/release 13 | 14 | # Settings of project info 15 | PRJ_NAME := iotkit-embedded 16 | PRJ_VERSION := V3.0.1 17 | -------------------------------------------------------------------------------- /iotkit-embedded/wrappers/iot.mk: -------------------------------------------------------------------------------- 1 | LIBA_TARGET := libiot_hal.a 2 | CFLAGS := $(filter-out -ansi,$(CFLAGS)) 3 | 4 | LIB_SRCS_PATTERN += os/$(CONFIG_VENDOR)/*.c 5 | 6 | $(call Append_Conditional, LIB_SRCS_PATTERN, tls/*.c, _PLATFORM_IS_LINUX_ SUPPORT_TLS) 7 | $(call Append_Conditional, LIB_SRCS_PATTERN, tls/*.c, _PLATFORM_IS_LINUX_ COAP_DTLS_SUPPORT) 8 | $(call Append_Conditional, LIB_SRCS_PATTERN, atm/at_tcp/mk3060.c, AT_TCP_ENABLED AT_TCP_HAL_MK3060) 9 | $(call Append_Conditional, LIB_SRCS_PATTERN, atm/at_tcp/sim800.c, AT_TCP_ENABLED AT_TCP_HAL_SIM800) 10 | $(call Append_Conditional, LIB_SRCS_PATTERN, atm/at_mqtt/mqtt_ica.c, AT_MQTT_ENABLED AT_MQTT_HAL_ICA) 11 | $(call Append_Conditional, LIB_SRCS_PATTERN, atm/at_mqtt/mqtt_sim800.c, AT_MQTT_ENABLED AT_MQTT_HAL_SIM800) 12 | $(call Append_Conditional, LIB_SRCS_EXCLUDE, os/ubuntu/HAL_UART_linux.c, , AT_PARSER_ENABLED) 13 | -------------------------------------------------------------------------------- /iotkit-embedded/wrappers/iotx_hal_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | 5 | #ifndef __PLATFORM_DEBUG_H__ 6 | #define __PLATFORM_DEBUG_H__ 7 | 8 | #include "iotx_log.h" 9 | 10 | #define hal_emerg(...) HAL_Printf("[prt] "), HAL_Printf(__VA_ARGS__), HAL_Printf("\r\n") 11 | #define hal_crit(...) HAL_Printf("[prt] "), HAL_Printf(__VA_ARGS__), HAL_Printf("\r\n") 12 | #define hal_err(...) HAL_Printf("[prt] "), HAL_Printf(__VA_ARGS__), HAL_Printf("\r\n") 13 | #define hal_warning(...) HAL_Printf("[prt] "), HAL_Printf(__VA_ARGS__), HAL_Printf("\r\n") 14 | #define hal_info(...) HAL_Printf("[prt] "), HAL_Printf(__VA_ARGS__), HAL_Printf("\r\n") 15 | #define hal_debug(...) HAL_Printf("[prt] "), HAL_Printf(__VA_ARGS__), HAL_Printf("\r\n") 16 | 17 | #endif /* __PLATFORM_DEBUG_H__ */ 18 | 19 | 20 | -------------------------------------------------------------------------------- /iotkit-embedded/wrappers/os/ubuntu/HAL_FS_Linux.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018 Alibaba Group Holding Limited 3 | */ 4 | #include "infra_config.h" 5 | 6 | #ifdef FS_ENABLED 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | void *HAL_Fopen(const char *path, const char *mode) 13 | { 14 | return (void *)fopen(path, mode); 15 | } 16 | 17 | uint32_t HAL_Fread(void *buff, uint32_t size, uint32_t count, void *stream) 18 | { 19 | return fread(buff, (size_t)size, (size_t)count, (FILE *)stream); 20 | } 21 | uint32_t HAL_Fwrite(const void *ptr, uint32_t size, uint32_t count, void *stream) 22 | { 23 | return (uint32_t)fwrite(ptr, (size_t)size, (size_t)count, (FILE *)stream); 24 | } 25 | 26 | int HAL_Fseek(void *stream, long offset, int framewhere) 27 | { 28 | return fseek((FILE *)stream, offset, framewhere); 29 | } 30 | 31 | int HAL_Fclose(void *stream) 32 | { 33 | return fclose((FILE *)stream); 34 | } 35 | 36 | long HAL_Ftell(void *stream) 37 | { 38 | return ftell((FILE *)stream); 39 | } 40 | #endif 41 | 42 | --------------------------------------------------------------------------------