Skip to content

更新1.0.x #7

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 139 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
a05f2bf
代码重构:分层设计
Jun 7, 2021
45558d2
整理explorer层网关接口
Jun 16, 2021
86a002b
整理explorer层数据模板接口
Jun 28, 2021
7d11170
explorer层使用provider类提供hub对象
Jun 29, 2021
d1f42cc
修复explorer网关、数据模板调试问题
Jun 29, 2021
6bb4e88
整理hub广播接口
Jun 30, 2021
4c0c2e2
整理hub设备影子接口
Jun 30, 2021
da55083
整理hub rrpc接口
Jun 30, 2021
4af7bfc
删除explorer无用接口
Jun 30, 2021
d2374d4
整理hub ota接口
Jun 30, 2021
f909723
1.exporer层ota接口整理;2.数据模板支持多个不同设备接入;3.删除无用代码;4.网关sample支持子设备订阅
Jul 1, 2021
6dd5a71
hub层增加用户设备mqtt回调接口
Jul 1, 2021
406fc9a
调整数据模板sample
Jul 1, 2021
2f63067
hub层网关增加子设备topic订阅接口
Jul 1, 2021
2ccce3c
用户删除设备通知功能加到数据模板接口中
Jul 1, 2021
324b71d
使用专门的provider类提供mqtt client对象
Jul 2, 2021
bfb99a8
ota支持多设备同时升级
Jul 5, 2021
3c8d8ce
优化mqtt连接及失败处理逻辑
Jul 5, 2021
2d7e93c
hub各功能模块支持多设备
Jul 6, 2021
7554628
各模块初始化时注册默认topic的回调,用户无需关注topic
Jul 6, 2021
309cedb
完善shadow接口
Jul 6, 2021
eb9a7db
调整目录,区分explorer和hub各自sample
Jul 7, 2021
d3725fb
调整hub动态注册sample
Jul 7, 2021
5bdaa4a
整理broadcast sample
Jul 7, 2021
af43b86
调整mqtt sample
Jul 7, 2021
e4eba98
修复:explorer层接入的mqtt回调注册失败问题
Jul 7, 2021
fb81371
修复:rrpc reply超时问题
Jul 7, 2021
9363254
调整rrpc sample
Jul 7, 2021
bc17f1e
调整hub网关接口
Jul 8, 2021
b2dbf34
调整hub网关sample
Jul 8, 2021
19a5547
调整用户回调,增加userdata参数
Jul 9, 2021
e16b9a6
调整explorer网关sample
Jul 9, 2021
1968d1e
调整enum值比较方式
Jul 12, 2021
dcb8a3b
调整hub ota sample
Jul 12, 2021
eb75a69
调整explorer ota sample
Jul 12, 2021
3cda46c
优化message回调中topic匹配逻辑
Jul 12, 2021
a85cff0
hub网关sample添加子设备ota示例
Jul 12, 2021
59ec8c2
优化topic订阅逻辑
Jul 13, 2021
76e965f
调整explorer数据模板sample
Jul 13, 2021
1a5cfe0
修复userdata传参错误
Jul 13, 2021
629a96d
explorer/hub添加NTP获取精准时间戳接口
Jul 14, 2021
41f3a33
explorer/hub mqtt sample添加获取NTP时间戳示例
Jul 14, 2021
b5090cc
explorer sample:1.删除无哟你文件;2.修改部分文件名称
Jul 14, 2021
85ff688
hub sample:删除sample中main入口
Jul 14, 2021
96e8daf
删除根目录下sample目录
Jul 14, 2021
38bdda7
hub优化disconnect回调通知
Jul 14, 2021
bbd308f
调整ci yml脚本
Jul 14, 2021
a1f643b
调整explorer ci测试
Jul 14, 2021
a902cb4
调整hub ci测试
Jul 14, 2021
7eae35c
log作为子模块复用
Jul 14, 2021
ca39acd
1.调整explorer/hub sample变量命名;2.使用sdk logger模块替换print
Jul 14, 2021
d9808b0
动态注册:1.将获取的psk写入配置文件;2.动态注册后重新mqtt初始化
Jul 15, 2021
7607148
动态注册sample添加注册成功后连接mqtt示例
Jul 15, 2021
f3b475d
添加动态注册接口注释
Jul 15, 2021
9cfd071
整理动态注册说明文档
Jul 15, 2021
f226ad1
explorer动态注册sample成功后连接mqtt示例
Jul 15, 2021
0ac9fec
文档删除测试产品信息
Jul 15, 2021
17ff8cd
mqtt初始化前不构建logger
Jul 15, 2021
35cc3b1
适配ci
Jul 15, 2021
8452a91
NTP接口推出时取消topic订阅
Jul 16, 2021
9e4d125
整理MQTT接入文档
Jul 16, 2021
b08d89b
修复websocket连接失败问题
Jul 16, 2021
4ca2a26
整理基于websocket的mqtt接入文档
Jul 16, 2021
ec6492c
优化hub host赋值及http deinit打印
Jul 19, 2021
93d87c4
整理ota文档
Jul 19, 2021
5ddc3db
整理hub网关文档
Jul 20, 2021
fbc2bb3
整理explorer网关文档
Jul 20, 2021
1adaf19
添加网关接口注释
Jul 20, 2021
a801b52
添加ota接口注释
Jul 20, 2021
2e60a2d
更新hub设备影子文档
Jul 20, 2021
d8b6c27
添加hub设备影子接口注释
Jul 20, 2021
2e1d5d7
整理hub rrpc通信文档
Jul 20, 2021
8792f43
添加rrpc接口注释
Jul 20, 2021
7c14299
整理hub广播通信文档
Jul 20, 2021
329746c
添加hub广播接口注释
Jul 20, 2021
0b6617e
整理hub设备互通文档
Jul 21, 2021
acd63d8
hub添加设备互通示例
Jul 21, 2021
ee2a5f9
整理explorer属性上报文档
Jul 21, 2021
4a5a4b0
优化数据模板对clientToken的管理
Jul 21, 2021
684a25e
整理explorer清除控制文档
Jul 21, 2021
e289787
整理explorer获取设备最新上报信息文档
Jul 21, 2021
4c871df
整理explorer设备信息上报文档
Jul 21, 2021
df9b4a2
事件上报区分多事件及单事件
Jul 21, 2021
7e14016
整理explorer事件上报以及多事件上报文档
Jul 21, 2021
4dee184
数据模板注销时取消订阅service主题
Jul 21, 2021
223cacd
整理explorer订阅与取消订阅Topic.md
Jul 21, 2021
80f5f54
整理控制设备上下线文档
Jul 21, 2021
b78f08c
添加连接方式日志
Jul 22, 2021
714a91d
删除重复文档
Jul 22, 2021
791274b
1.补齐接口注释;2.explorer添加遗漏接口
Jul 22, 2021
3d0f4bb
ci添加device_info.json文件加解密过程
Jul 26, 2021
8eeb3d4
explorer sample支持单元测试
Jul 26, 2021
56b9305
1.hub使用单例模式;2.优化其他功能模块对log模块的引用
Jul 28, 2021
c97e992
hub sample支持单元测试
Jul 28, 2021
bef9726
订阅与取消订阅Topic文档添加对数据模板回调的说明及相关示例日志
Jul 29, 2021
fb18818
添加自建服务器接入指引文档(待完善)
Jul 29, 2021
abdd207
添加explorer/hub SDK接口说明文档
Jul 29, 2021
4f60680
添加日志保存功能
Aug 6, 2021
18b1603
sample适配日志接口修改
Aug 6, 2021
c14bf3a
保存日志指定参数名称
Aug 10, 2021
f485b49
取消topic列表订阅方式
Aug 11, 2021
21e39cf
Merge "NTP接口推出时取消topic订阅"
oldcodefarmer Aug 16, 2021
3fe0db0
scenarized 场景修正 hub 初始化方式,添加 log 默认目录
tonychanchen Aug 16, 2021
f4569ed
替换单元测试设备配置
tonychanchen Aug 16, 2021
4a51352
修复ci 单元测试失败问题
tonychanchen Aug 16, 2021
ca4ae44
fix ci
tonychanchen Aug 16, 2021
1a48c4f
替换 CI 的单元测试设备
tonychanchen Aug 17, 2021
5b2c354
触发CI,添加注释
tonychanchen Aug 17, 2021
a0e734f
延长 CI 连接服务时间
tonychanchen Aug 17, 2021
43736f2
延长 CI 连接服务时长
tonychanchen Aug 17, 2021
edada9e
setup配置传递依赖,修改sdk名称
tonychanchen Aug 20, 2021
32141b0
修改正式版本的发布版本号
tonychanchen Aug 20, 2021
86f097d
修改yaml语法错误
tonychanchen Aug 20, 2021
d32ea97
更新接入文档
tonychanchen Aug 20, 2021
161f431
添加PythonSDK中hub/explorer相关英文文档
Jan 6, 2022
81690c5
添加采用密钥认证方式对设备http的接入
Jan 10, 2022
f93d367
python sdk: IoT Hub 为设备HTTP接入提供测试代码
Jan 11, 2022
59ae245
修改设备接入host和动态注册host提供参数设置,支持海外地域设备;支持私有化brokerURL设置;并添加海外或私有化设备接入等常见问题文档
Feb 18, 2022
83c7541
在device python仓库中添加workflow结果通知功能
Feb 24, 2022
4fed064
update python workflow.
Feb 24, 2022
c8138e8
网关功能单例变量外部创建
Feb 24, 2022
54e6a78
log对象初始化调整
Feb 24, 2022
78c3360
explorer/hub添加设备基于http接入功能,并添加文档说明
Feb 28, 2022
f9158a0
设备基于HTTP方式接入,补充证书认证签名
Mar 3, 2022
fc04d44
添加动态注册证书认证功能,并解析,保存文件至根目录
Mar 8, 2022
e0244e5
资源管理:设备创建上传任务
Mar 10, 2022
7f5c88f
资源设备:资源文件上传功能,上报资源进度
Mar 17, 2022
ee97468
资源管理:修改put请求库
Mar 17, 2022
9a387f8
添加公有云接入三方CA证书指引文档
tonychanchen May 20, 2022
9789e34
调整文档格式
tonychanchen May 23, 2022
e60453b
调整指引文档
tonychanchen May 23, 2022
a4ea235
增加 hub 动态注册 debug 日志
larrytin Aug 4, 2022
9e82858
Update requirements.txt
tonychanchen Sep 10, 2024
9f3f15b
更新sdk依赖
Feb 24, 2025
0dffba8
updae env
Feb 24, 2025
a00999e
update
Feb 24, 2025
58130ba
update env
Feb 24, 2025
e05de8b
update env
Feb 24, 2025
bf28152
Update requirements.txt
tonychanchen Mar 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/files/explorer/device_info.json.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN PGP MESSAGE-----

jA0EBwMCQEdzKXolxHrr0sDDAS/p+lpyNU18OpGIntyFt6WTktOe7QBFOCa2zzKJ
0PLJKVs6IK+AqSsWU/ASJhWf7x1MCLywgnXt3Kmo2iZQlP0HFqHD5CZ/AW83DNVU
rFVuoUPot6YYmlMqbLsZp8NVGxZ+Zev5wp7GiadYFmPQsVR/IoLdUikUOoUpWeyI
4aVRk6vgsMZzotAYI6DcdCxEOQdUS7vO5B8ZfEx7ehzWf+giR4PGlH+aQJevaT7X
qHovtcNOK5XPf8hk+QafOYkCDdJP5QaHdfxrDwn7TJHUiLiUvciIYSLOeM16+psP
XevcTYOhMCy44eLMGejFbT3YPqcEK7j+522x9mpPhDlXtA9FLnLYufv5hUNRQ85Q
6sMfGgKSd+AoY6Qbfkk2OhM/wqjM7bpr9wGwzurpxvdYXFZ1kBi78zC/T/HqyOQf
R3LGhW1DijI7Ufo22/+uioaM66S6JVyfBMxVH8n774js2fzh43xOJw1rdgoITSEw
FOW2a7N/O5ZbxLnTctH1K34NA3cr
=rSwV
-----END PGP MESSAGE-----
13 changes: 13 additions & 0 deletions .github/files/hub/device_info.json.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN PGP MESSAGE-----

jA0EBwMCDiAOe23XImfr0sC4AWnWsJkzpMVE7w0aZqHyjIa3pEXxWBJlZcxbSHGr
MyjGqM1sYP4MBQ2aMY9jO2xgsbQbAKDONyhkfdhjw72M7Z5QIiPADwfW+MnTJ96P
Pw8k0riMYjM1sAWM0odPB6Pn7/F0wAW93020+rTNfiqHewlZ2aPxBBMTS1y9uejE
eJ/WgZr+QQm2ZJJOGNi/ncEM4qNwSgnduDCuZn3v8kCSXIoVXZuJ6Xp9kH/9Sl2/
nAz6pKm/YY59yoQrcmxiBCc+44pTG3VfgIs6OAs0t8oZRiwLQNyB3aoAg8kIDJXK
O1pbroSXq7cdC7YvAhHgTu0lfrv1Kkbwc8rn+VLsB4wgAQH32v2uBJniluUiCf7G
KtoNFmjR0HeAbOpyKMM7Z4MbDQPbxaQ3YsZCYwwwnMwBeDoG3ScuNV7lD+mYL4xP
dVaCtjzbnsHgjaqDnmgwfgimAIDbwONa40ZS1YppSvd6+ENRLDu3b+mWqutPE4I+
jQlLu4BDMnTZeA==
=skJN
-----END PGP MESSAGE-----
23 changes: 23 additions & 0 deletions .github/scripts/send_result_to_wecom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

color=""
if [ $2 == "success" ]
then
echo "success"
color="info"
else
echo "fail"
color="warning"
fi

curl "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=$IOT_WECOM_CID_ROBOT_KEY" \
-H 'Content-Type: application/json' \
-d '
{
"msgtype": "markdown",
"markdown": {
"content": "**repo: \"'"$1"'\"**\n
>result:<font color=\"'"$color"'\">\"'"$2"'\"</font>\n
>[action](https://github.com/tencentyun/iot-device-python/actions)"\n
}
}'
34 changes: 28 additions & 6 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,43 @@ on:
- '**.md'
- 'LICENSE'

env:
IOT_WECOM_CID_ROBOT_KEY: ${{ secrets.IOT_WECOM_CID_ROBOT_KEY }}

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: '3.13'

- name: Install dependencies
run: |
pip install setuptools wheel twine
python setup.py check
python -m pip install --upgrade pip
pip install setuptools wheel twine

- name: Unittest TestCase
env:
PROVISIONING_PASSWORD: ${{ secrets.GPG_DECRYPT_PASSPHRASE }}
run: |
python -m venv test_env
source test_env/bin/activate
pip install setuptools
python setup.py install
pip install -r requirements.txt
python sample/test.py
gpg --quiet -d --passphrase "$PROVISIONING_PASSWORD" --batch .github/files/explorer/device_info.json.asc > explorer/sample/device_info.json
gpg --quiet -d --passphrase "$PROVISIONING_PASSWORD" --batch .github/files/hub/device_info.json.asc > hub/sample/device_info.json
python explorer/sample/test.py
python hub/sample/test.py

- name: Publish to Test PyPI
if: startsWith(github.event.ref, 'refs/heads')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.IOT_TEST_PYPI_UPLOAD_TOKEN }}
Expand All @@ -47,8 +57,20 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.IOT_PYPI_UPLOAD_TOKEN }}
run: |
VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
echo $VERSION
rm -rf dist/
sed -i "s#resp = urllib.request.*#resp = urllib.request.urlopen(f\'https://pypi.org/pypi/{name}/json\')#g" setup.py

sed -i "s#version=.*#version=\"$VERSION\",#g" setup.py
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Report success result to wecom
if: ${{ success() }}
run: |
echo success!!!
bash .github/scripts/send_result_to_wecom.sh ${{ github.event.repository.name }} success
- name: Report fail result to wecom
if: ${{ failure() }}
run: |
echo fail!!!
bash .github/scripts/send_result_to_wecom.sh ${{ github.event.repository.name }} fail
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ dist/
test_env/
samples/
build.sh
TIoTExploreSDK.egg-info/
*.pyc
*.egg-info/
*.pyc
logs/log
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
简体中文 | [English](./README_EN-US.md)

# 产品介绍

本仓库中包含两个产品:腾讯云物联网通信(IoT Hub) 和 腾讯云物联网开发平台(IoT Explorer) ,本仓库提供 Python 接入方式 。
Expand Down
27 changes: 27 additions & 0 deletions README_EN-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[简体中文](https://github.com/tencentyun/iot-device-python) | English

# Product Overview

This repository contains two products: IoT Hub and IoT Explorer. It provides the Python connection method.

## IoT Hub SDK for Python

Tencent Cloud Internet of Things Hub (IoT Hub) aims to provide a secure, stable, and efficient connection platform that helps developers quickly achieve stable, high-concurrency, and omnidirectional data communications among devices, user applications, and cloud services at low costs. It can implement cross-device interaction, device data reporting, and configuration distribution. Further, by opening up the linkage between device data and Tencent Cloud services based on the rule engine, it allows for the storage, real-time computation, and smart processing and analysis of massive amounts of data with speed and ease. For more information, please see [IoT Hub](https://cloud.tencent.com/document/product/634).

This repository provides the IoT Hub device SDK. You can securely connect Python-enabled devices to IoT Hub by integrating the SDK into them.

* [IoT Hub device SDK for Python](hub/)


## IoT Explorer SDK for Python

Tencent Cloud Internet of Things Explorer (IoT Explorer) provides device manufacturers, solution providers, and application developers in various industries with one-stop device automation services. It offers the capabilities to connect and manage high numbers of devices and develop mini programs and is interconnected with the basic products and AI capabilities of Tencent Cloud, which helps improve the device automation efficiency in traditional industries, reduce the development and OPS costs, and empower the business growth. For more information, please see [IoT Explorer](https://cloud.tencent.com/document/product/1081).

This repository provides the IoT Explorer device SDK. You can securely connect Python-enabled devices to IoT Explorer by connecting their drivers or integrating the SDK into them.

* [IoT Explorer device SDK for Python](explorer/)


## Domain names involved in SDKs

For the domain names involved in the corresponding SDKs of the two products, please see [Domain Names Involved in Device SDKs](https://github.com/tencentyun/iot-device-java/wiki/Device-SDK涉及的域名).
4 changes: 4 additions & 0 deletions explorer/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
简体中文 | [English](doc/en)

* [腾讯云物联网开发平台设备端 IoT Explorer Python-SDK](#腾讯云物联网开发平台设备端-IoT-Explorer-Python-SDK)
* [前提条件](#前提条件)
* [工程配置](#工程配置)
* [下载IoT Explorer Python-SDK Demo示例代码](#下载IoT-Explorer-Python-SDK-Demo示例代码)
* [功能文档](#功能文档)
* [SDK API 说明](#SDK-API-说明)
* [常见问题](#常见问题)

# 腾讯云物联网开发平台设备端 IoT Explorer Python-SDK
欢迎使用腾讯云物联网开发平台设备端 IoT Explorer Python-SDK 。
Expand Down Expand Up @@ -33,3 +36,4 @@ SDK支持pip安装,以及本地源码安装,详细接入步骤请参考 [SDK
* [事件上报以及多事件上报](doc/事件上报以及多事件上报.md)
* [检查固件更新](doc/检查固件更新.md)
* [网关使用示例](doc/网关使用示例.md)
* [常见问题](doc/常见问题.md)
2 changes: 1 addition & 1 deletion explorer/doc/SDK接入说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Install from pip

```
pip install TIoTExploreSDK
pip install tencent-iot-device
```


Expand Down
83 changes: 83 additions & 0 deletions explorer/doc/SDK接口说明.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
* [API接口说明](#API接口说明)
* [MQTT接口](#MQTT接口)
* [网关接口](#网关接口)
* [数据模板接口](#设备影子接口)
* [动态注册接口](#动态注册接口)
* [OTA接口](#OTA接口)
* [LOG接口](#LOG接口)

# API接口说明
## MQTT接口

| 接口名称 | 接口描述 |
| :-: | :-: |
| connect | MQTT连接 |
| disconnect | 断开MQTT连接 |
| subscribe | MQTT订阅 |
| unsubscribe | MQTT取消订阅 |
| publish | MQTT发布消息 |
| registerMqttCallback | 注册MQTT回调函数 |
| registerUserCallback | 注册用户回调函数 |
| isMqttConnected | MQTT是否正常连接 |
| getConnectState | 获取MQTT连接状态 |
| setReconnectInterval | 设置MQTT重连尝试间隔 |
| setMessageTimout | 设置消息发送超时时间 |
| setKeepaliveInterval | 设置MQTT保活间隔 |

## 网关接口
| 接口名称 | 接口描述 |
| :-: | :-: |
| gatewayInit | 网关初始化 |
| isSubdevStatusOnline | 判断子设备是否在线 |
| updateSubdevStatus | 更新子设备在线状态 |
| gatewaySubdevGetConfigList | 获取配置文件中子设备列表 |
| gatewaySubdevOnline | 代理子设备上线 |
| gatewaySubdevOffline | 代理子设备下线 |
| gatewaySubdevBind | 绑定子设备 |
| gatewaySubdevUnbind | 解绑子设备 |
| gatewaySubdevSubscribe | 子设备订阅 |

## 数据模板接口
| 接口名称 | 接口描述 |
| :-: | :-: |
| templateInit | 数据模板初始化 |
| getEventsList | 获取设备event列表 |
| getActionList | 获取设备action列表 |
| getPropertyList | 获取设备property列表 |
| templateSetup | 解析数据模板 |
| templateEventPost | events上报 |
| templateJsonConstructReportArray | 构建上报的json结构 |
| templateReportSysInfo | 设备信息上报 |
| templateControlReply | 控制消息应答 |
| templateActionReply | action消息应答 |
| templateGetStatus | 获取设备最新状态 |
| templateReport | 设备属性上报 |
| clearControl | 清除控制 |
| templateDeinit | 数据模板销毁 |

## 动态注册接口
| 接口名称 | 接口描述 |
| :-: | :-: |
| dynregDevice | 获取设备动态注册的信息 |

## OTA接口
| 接口名称 | 接口描述 |
| :-: | :-: |
| otaInit | OTA初始化 |
| otaIsFetching | 判断是否正在下载 |
| otaIsFetchFinished | 判断是否下载完成 |
| otaReportUpgradeSuccess | 上报升级成功消息 |
| otaReportUpgradeFail | 上报升级失败消息 |
| otaIoctlNumber | 获取下载固件大小等int类型信息 |
| otaIoctlString | 获取下载固件md5等string类型信息 |
| otaResetMd5 | 重置md5信息 |
| otaMd5Update | 更新md5信息 |
| httpInit | 初始化http |
| otaReportVersion | 上报当前固件版本信息 |
| otaDownloadStart | 开始固件下载 |
| otaFetchYield | 读取固件 |

## LOG接口
| 接口名称 | 接口描述 |
| :-: | :-: |
| logInit | 日志初始化 |
28 changes: 28 additions & 0 deletions explorer/doc/en/PRELIM__SDK接入说明_EN-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
* [How to Import](#How-to-Import)

## How to Import

**How to import**

- Install from pip

```
pip install tencent-iot-device
```


- Build from source

```
git clone https://github.com/tencentyun/iot-device-python.git
cd iot-device-python
python setup.py install
```


**SDK for Python source code**

- If you want to develop a project through code integration, you can download the SDK for Python source code from [Github](../).
- If you want to develop a project by importing the source code, you can refer to [Latest release](https://github.com/tencentyun/iot-device-python/releases) for the specific version number.


83 changes: 83 additions & 0 deletions explorer/doc/en/PRELIM__SDK接口说明_EN-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
* [API Description](#API-Description)
* [MQTT APIs](#MQTT-APIs)
* [Gateway APIs](#Gateway-APIs)
* [Data template APIs](#Data-template-APIs)
* [Dynamic registration APIs](#Dynamic-registration-APIs)
* [OTA APIs](#OTA-APIs)
* [Log APIs](#Log-APIs)

# API Description
## MQTT APIs

| API | Description |
| :-: | :-: |
| connect | Establishes MQTT connection |
| disconnect | Closes MQTT connection |
| subscribe | Subscribes to MQTT |
| unsubscribe | Unsubscribes from MQTT |
| publish | Publishes message over MQTT |
| registerMqttCallback | Registers MQTT callback function |
| registerUserCallback | Registers user callback function |
| isMqttConnected | Checks whether MQTT is normally connected |
| getConnectState | Gets MQTT connection status |
| setReconnectInterval | Sets MQTT reconnection attempt interval |
| setMessageTimout | Sets message sending timeout period |
| setKeepaliveInterval | Sets MQTT keepalive interval |

## Gateway APIs
| API | Description |
| :-: | :-: |
| gatewayInit | Initializes gateway |
| isSubdevStatusOnline | Determines whether subdevice is online |
| updateSubdevStatus | Updates subdevice's online status |
| gatewaySubdevGetConfigList | Gets subdevice list from configuration file |
| gatewaySubdevOnline | Proxies subdevice connection |
| gatewaySubdevOffline | Proxies subdevice disconnection |
| gatewaySubdevBind | Binds subdevice |
| gatewaySubdevUnbind | Unbinds subdevice |
| gatewaySubdevSubscribe | Proxies subdevice subscription |

## Data template APIs
| API | Description |
| :-: | :-: |
| templateInit | Initializes data template |
| getEventsList | Gets device event list |
| getActionList | Gets device action list |
| getPropertyList | Gets device attribute list |
| templateSetup | Parses data template |
| templateEventPost | Reports event |
| templateJsonConstructReportArray | Constructs JSON structure for reporting |
| templateReportSysInfo | Reports device information |
| templateControlReply | Replies to control message |
| templateActionReply | Replies to action message |
| templateGetStatus | Gets latest device status |
| templateReport | Reports device attribute |
| clearControl | Clears control |
| templateDeinit | Terminates data template |

## Dynamic registration APIs
| API | Description |
| :-: | :-: |
| dynregDevice | Gets the dynamic registration information of device |

## OTA APIs
| API | Description |
| :-: | :-: |
| otaInit | Initializes OTA |
| otaIsFetching | Determines whether the download is in progress |
| otaIsFetchFinished | Determines whether the download is completed |
| otaReportUpgradeSuccess | Reports update success message |
| otaReportUpgradeFail | Reports update failure message |
| otaIoctlNumber | Gets the information of the downloaded firmware in `int` type, such as the size |
| otaIoctlString | Gets the information of the downloaded firmware in `String` type, such as MD5 |
| otaResetMd5 | Resets MD5 information |
| otaMd5Update | Updates MD5 information |
| httpInit | Initializes HTTP |
| otaReportVersion | Reports the information of current firmware version |
| otaDownloadStart | Starts firmware download |
| otaFetchYield | Reads firmware |

## Log APIs
| API | Description |
| :-: | :-: |
| logInit | Initializes log |
Loading
Loading