@tencentcloud/sdk-mcp 1.7.7 → 1.7.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +7 -9
  3. package/index.js +8 -8
  4. package/knowledge/chunker.js +1 -0
  5. package/knowledge/doc-url-resolver.js +16 -9
  6. package/knowledge/embedding/build-vectors.js +92 -0
  7. package/knowledge/embedding/embed-model.js +41 -0
  8. package/knowledge/embedding/vector-augment.js +126 -0
  9. package/knowledge/embedding/vector-index.js +70 -0
  10. package/knowledge/frontmatter-meta.js +23 -0
  11. package/knowledge/path-meta.js +56 -0
  12. package/knowledge/search/exact-lookup.js +145 -16
  13. package/knowledge/search/filter-pool.js +77 -33
  14. package/knowledge/search/rank-profile.js +25 -0
  15. package/knowledge/search/requires-framework.js +4 -1
  16. package/knowledge/search/search-core.js +74 -13
  17. package/knowledge/search/search-knowledge.js +24 -34
  18. package/knowledge/search/search-pass.js +495 -169
  19. package/knowledge/search/url-row-scorer.js +24 -6
  20. package/package.json +3 -1
  21. package/resource/index/manifest.json +1 -1
  22. package/resource/index/vectors/index.json +4 -0
  23. package/resource/integration/callkit/preset/android/integration.md +0 -2
  24. package/resource/integration/callkit/preset/ios/integration.md +0 -2
  25. package/resource/integration/chat/preset/react/integration.md +9 -5
  26. package/resource/integration/chat/preset/uni-app/integration.md +4 -0
  27. package/resource/integration/chat/preset/vue/integration.md +10 -6
  28. package/resource/integration/livekit/preset/live/android/prepare-integration.md +0 -4
  29. package/resource/integration/livekit/preset/live/ios/prepare-integration.md +0 -4
  30. package/resource/integration/roomkit/preset/vue/integration.md +154 -208
  31. package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +0 -2
  32. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +0 -2
  33. package/resource/knowledge/callkit/core-sdk/android/make-call.md +0 -2
  34. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +0 -4
  35. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +0 -2
  36. package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +0 -2
  37. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +0 -2
  38. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +0 -4
  39. package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +0 -2
  40. package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +0 -2
  41. package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +0 -2
  42. package/resource/knowledge/callkit/faq/ios.md +0 -2
  43. package/resource/knowledge/callkit/faq/uniapp-app.md +0 -2
  44. package/resource/knowledge/callkit/preset/miniprogram/integration.md +2 -3
  45. package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +0 -2
  46. package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -16
  47. package/resource/knowledge/chat/preset/react/h5/integration.md +16 -5
  48. package/resource/knowledge/chat/preset/vue/features/conversation-list.md +6 -3
  49. package/resource/knowledge/chat/preset/vue/h5/integration.md +7 -4
  50. package/resource/knowledge/iot/app/activate-service.md +95 -0
  51. package/resource/knowledge/iot/app/demo/android.md +93 -0
  52. package/resource/knowledge/iot/app/demo/ios.md +87 -0
  53. package/resource/knowledge/iot/app/demo/miniprogram.md +79 -0
  54. package/resource/knowledge/iot/app/device-binding.md +378 -0
  55. package/resource/knowledge/iot/app/device-sharing.md +414 -0
  56. package/resource/knowledge/iot/app/family-management.md +762 -0
  57. package/resource/knowledge/iot/app/integration/android.md +328 -0
  58. package/resource/knowledge/iot/app/integration/harmonyos.md +326 -0
  59. package/resource/knowledge/iot/app/integration/ios.md +351 -0
  60. package/resource/knowledge/iot/app/integration/miniprogram.md +268 -0
  61. package/resource/knowledge/iot/app/monitor-playback.md +557 -0
  62. package/resource/knowledge/iot/app/remote-control.md +139 -0
  63. package/resource/knowledge/iot/app/video-call.md +559 -0
  64. package/resource/knowledge/iot/app/wechat-call/device-call-miniprogram.md +204 -0
  65. package/resource/knowledge/iot/app/wechat-call/miniprogram-call-device.md +193 -0
  66. package/resource/knowledge/iot/client-api/app/android/txiotcallsession.md +189 -0
  67. package/resource/knowledge/iot/client-api/app/android/txiotcloudstorage.md +77 -0
  68. package/resource/knowledge/iot/client-api/app/android/txiotdevicemanager.md +175 -0
  69. package/resource/knowledge/iot/client-api/app/android/txiotengine.md +172 -0
  70. package/resource/knowledge/iot/client-api/app/android/txiotenginedef.md +163 -0
  71. package/resource/knowledge/iot/client-api/app/android/txiotfamilymanager.md +146 -0
  72. package/resource/knowledge/iot/client-api/app/android/txiotmonitorsession.md +246 -0
  73. package/resource/knowledge/iot/client-api/app/harmonyos/txiotcallsession.md +191 -0
  74. package/resource/knowledge/iot/client-api/app/harmonyos/txiotcloudstorage.md +77 -0
  75. package/resource/knowledge/iot/client-api/app/harmonyos/txiotdevicemanager.md +183 -0
  76. package/resource/knowledge/iot/client-api/app/harmonyos/txiotengine.md +186 -0
  77. package/resource/knowledge/iot/client-api/app/harmonyos/txiotenginedef.md +164 -0
  78. package/resource/knowledge/iot/client-api/app/harmonyos/txiotfamilymanager.md +150 -0
  79. package/resource/knowledge/iot/client-api/app/harmonyos/txiotmonitorsession.md +252 -0
  80. package/resource/knowledge/iot/client-api/app/ios/txiotcallsession.md +199 -0
  81. package/resource/knowledge/iot/client-api/app/ios/txiotcloudstorage.md +76 -0
  82. package/resource/knowledge/iot/client-api/app/ios/txiotdevicemanager.md +173 -0
  83. package/resource/knowledge/iot/client-api/app/ios/txiotengine.md +173 -0
  84. package/resource/knowledge/iot/client-api/app/ios/txiotenginedef.md +171 -0
  85. package/resource/knowledge/iot/client-api/app/ios/txiotfamilymanager.md +146 -0
  86. package/resource/knowledge/iot/client-api/app/ios/txiotmonitorsession.md +250 -0
  87. package/resource/knowledge/iot/client-api/app/miniprogram/txiotcallsession.md +180 -0
  88. package/resource/knowledge/iot/client-api/app/miniprogram/txiotcloudstorage.md +76 -0
  89. package/resource/knowledge/iot/client-api/app/miniprogram/txiotdevicemanager.md +281 -0
  90. package/resource/knowledge/iot/client-api/app/miniprogram/txiotengine.md +183 -0
  91. package/resource/knowledge/iot/client-api/app/miniprogram/txiotenginedef.md +152 -0
  92. package/resource/knowledge/iot/client-api/app/miniprogram/txiotfamilymanager.md +179 -0
  93. package/resource/knowledge/iot/client-api/app/miniprogram/txiotmonitorsession.md +226 -0
  94. package/resource/knowledge/iot/client-api/device/android-smart-device.md +813 -0
  95. package/resource/knowledge/iot/client-api/device/linux-rtos-device.md +2027 -0
  96. package/resource/knowledge/iot/device/activate-service.md +167 -0
  97. package/resource/knowledge/iot/device/ai-voice-chat/advanced-features/custom-agent.md +171 -0
  98. package/resource/knowledge/iot/device/ai-voice-chat/advanced-features/smart-device-control.md +721 -0
  99. package/resource/knowledge/iot/device/ai-voice-chat/integration-guide/android-smart-device.md +247 -0
  100. package/resource/knowledge/iot/device/ai-voice-chat/integration-guide/linux-rtos-device.md +368 -0
  101. package/resource/knowledge/iot/device/ai-voice-chat/overview.md +84 -0
  102. package/resource/knowledge/iot/device/cloud-storage.md +696 -0
  103. package/resource/knowledge/iot/device/data-model.md +972 -0
  104. package/resource/knowledge/iot/device/demo/android-smart-device.md +97 -0
  105. package/resource/knowledge/iot/device/demo/linux-rtos-device.md +106 -0
  106. package/resource/knowledge/iot/device/device-ota-upgrade.md +237 -0
  107. package/resource/knowledge/iot/device/dynamic-registration/android-smart-device.md +275 -0
  108. package/resource/knowledge/iot/device/dynamic-registration/linux-rtos-device.md +297 -0
  109. package/resource/knowledge/iot/device/login-and-register/android-smart-device.md +131 -0
  110. package/resource/knowledge/iot/device/login-and-register/linux-rtos-device.md +291 -0
  111. package/resource/knowledge/iot/device/monitor-pushing/android-smart-device.md +237 -0
  112. package/resource/knowledge/iot/device/monitor-pushing/linux-rtos-device.md +493 -0
  113. package/resource/knowledge/iot/device/video-call/android-smart-device.md +299 -0
  114. package/resource/knowledge/iot/device/video-call/linux-rtos-device.md +465 -0
  115. package/resource/knowledge/iot/device/wechat-call/android-smart-device.md +534 -0
  116. package/resource/knowledge/iot/device/wechat-call/linux-rtos-device.md +681 -0
  117. package/resource/knowledge/iot/kids-watch/overview.md +28 -0
  118. package/resource/knowledge/iot/security-camera/activate-service.md +74 -0
  119. package/resource/knowledge/iot/security-camera/monitor-playback/app-integration.md +302 -0
  120. package/resource/knowledge/iot/security-camera/monitor-playback/device-integration/android.md +237 -0
  121. package/resource/knowledge/iot/security-camera/monitor-playback/device-integration/linux-rtos.md +493 -0
  122. package/resource/knowledge/iot/security-camera/overview.md +31 -0
  123. package/resource/knowledge/iot/security-camera/ptz-control.md +153 -0
  124. package/resource/knowledge/iot/security-camera/recording-and-snapshot.md +182 -0
  125. package/resource/knowledge/iot/security-camera/voice-intercom.md +174 -0
  126. package/resource/knowledge/iot/smart-vision/serviceoverview.md +114 -0
  127. package/resource/knowledge/iot/voice-recorder/app-demo.md +99 -0
  128. package/resource/knowledge/iot/voice-recorder/device-demo.md +189 -0
  129. package/resource/knowledge/iot/voice-recorder/overview.md +64 -0
  130. package/resource/knowledge/livekit/core-sdk/features/android/base-beauty.md +0 -2
  131. package/resource/knowledge/livekit/core-sdk/features/android/gift.md +0 -4
  132. package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +0 -2
  133. package/resource/knowledge/livekit/core-sdk/features/flutter/audio-effect.md +0 -2
  134. package/resource/knowledge/livekit/core-sdk/features/flutter/base-beauty.md +0 -2
  135. package/resource/knowledge/livekit/core-sdk/features/flutter/gift.md +0 -4
  136. package/resource/knowledge/livekit/core-sdk/features/ios/base-beauty.md +0 -2
  137. package/resource/knowledge/livekit/core-sdk/features/ios/gift.md +0 -4
  138. package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +0 -2
  139. package/resource/knowledge/livekit/core-sdk/features/uni-app/base-beauty.md +0 -2
  140. package/resource/knowledge/livekit/core-sdk/features/uni-app/gift.md +0 -4
  141. package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +0 -4
  142. package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +0 -10
  143. package/resource/knowledge/livekit/core-sdk/live/android/integration.md +0 -2
  144. package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +0 -2
  145. package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +0 -10
  146. package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +0 -2
  147. package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +0 -4
  148. package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +0 -10
  149. package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +0 -2
  150. package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +0 -4
  151. package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +0 -4
  152. package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +0 -2
  153. package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +0 -2
  154. package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +0 -4
  155. package/resource/knowledge/livekit/core-sdk/voice/android/integration.md +0 -4
  156. package/resource/knowledge/livekit/core-sdk/voice/flutter/integration.md +0 -2
  157. package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +0 -2
  158. package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +0 -4
  159. package/resource/knowledge/livekit/core-sdk/voice/ios/integration.md +0 -4
  160. package/resource/knowledge/livekit/core-sdk/voice/uni-app/co-guest-interaction.md +0 -2
  161. package/resource/knowledge/livekit/core-sdk/voice/uni-app/integration.md +0 -2
  162. package/resource/knowledge/livekit/faq/error-code.md +0 -2
  163. package/resource/knowledge/push/config/android/honor.md +16 -1
  164. package/resource/knowledge/push/config/android/huawei.md +20 -4
  165. package/resource/knowledge/push/config/android/meizu.md +19 -5
  166. package/resource/knowledge/push/config/android/vivo.md +20 -1
  167. package/resource/knowledge/push/config/donut.md +0 -2
  168. package/resource/knowledge/push/config/harmonyos.md +21 -5
  169. package/resource/knowledge/push/integration/android.md +0 -5
  170. package/resource/knowledge/push/integration/donut.md +0 -3
  171. package/resource/knowledge/push/integration/flutter.md +1 -4
  172. package/resource/knowledge/push/integration/harmonyos.md +0 -3
  173. package/resource/knowledge/push/integration/ios.md +0 -3
  174. package/resource/knowledge/push/integration/react-native.md +0 -5
  175. package/resource/knowledge/push/integration/uni-app.md +0 -3
  176. package/resource/knowledge/push/integration/unity.md +0 -3
  177. package/resource/knowledge/push/integration/unreal-engine.md +0 -3
  178. package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +0 -2
  179. package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +0 -2
  180. package/resource/knowledge/roomkit/core-sdk/android/room-state.md +0 -2
  181. package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +0 -2
  182. package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +0 -2
  183. package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +0 -2
  184. package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +0 -2
  185. package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +0 -2
  186. package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +0 -2
  187. package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +0 -2
  188. package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +0 -2
  189. package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +0 -2
  190. package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -3
  191. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +18 -14
  192. package/resource/knowledge/rtcengine/web/how_to_run_web_sdk_demo.md +0 -2
  193. package/resource/knowledge/rtcengine/web/plugin/23-advanced-support-detection.md +30 -0
  194. package/resource/knowledge/rtcengine/web/plugin/24-advanced-network-quality.md +0 -2
  195. package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -1
  196. package/resource/knowledge/rtcengine/web/plugin/35-advanced-ai-denoiser.md +1 -1
  197. package/resource/knowledge/rtcengine/web/plugin/36-advanced-virtual-background.md +4 -0
  198. package/resource/knowledge/trtc/android/TRTCCloud.md +94 -85
  199. package/resource/knowledge/trtc/android/TRTCCloudDef.md +48 -46
  200. package/resource/knowledge/trtc/android/TRTCCloudListener.md +48 -48
  201. package/resource/knowledge/trtc/android/TXAudioEffectManager.md +18 -18
  202. package/resource/knowledge/trtc/android/TXDeviceManager.md +4 -4
  203. package/resource/knowledge/trtc/android/TXLiteAVCode.md +1 -0
  204. package/resource/knowledge/trtc/c++/ITRTCCloud.md +90 -90
  205. package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +18 -18
  206. package/resource/knowledge/trtc/c++/ITXDeviceManager.md +9 -9
  207. package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +47 -47
  208. package/resource/knowledge/trtc/c++/TRTCTypeDef.md +47 -45
  209. package/resource/knowledge/trtc/c++/TXLiteAVCode.md +1 -0
  210. package/resource/knowledge/trtc/ios/TRTCCloud.md +93 -93
  211. package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +50 -50
  212. package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +8 -8
  213. package/resource/knowledge/trtc/ios/TXDeviceManager.md +9 -9
  214. package/resource/knowledge/trtc/ios/TXLiteAVCode.md +1 -0
  215. package/resource/knowledge/trtc/ios/TXLiveSDKTypeDef.md +48 -46
  216. package/server-config.js +8 -9
  217. package/server.js +1 -1
  218. package/tools/common/finalize_answer.js +1 -1
  219. package/tools/common/present_framework_choice.js +1 -1
  220. package/tools/common/search_trtc_knowledge.js +22 -3
  221. package/tools/definitions/search_trtc_knowledge_def.js +3 -2
  222. package/utils/preflight-route.js +19 -2
  223. package/utils/report-cls-client.js +1 -1
  224. package/utils/report-es-client.js +1 -1
@@ -0,0 +1,275 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - android
5
+ types:
6
+ - feature
7
+ retrievable_scope: always
8
+ feature_domain: device
9
+ ---
10
+
11
+ 本文将介绍如何在 Android 平台基于腾讯云物联网设备端 Android SDK,使用动态注册(Dynamic Register)能力,在产品量产阶段由设备自动从云端获取设备密钥,减少客户手动逐个烧录设备密钥的工作量,提升量产效率。
12
+
13
+ ## 关键概念
14
+
15
+ 动态注册用于产品量产过程中,在控制台批量创建设备后,设备根据 `productId`、`productSecret`、`deviceId`,从后台获取设备密钥(`deviceSecret`)。该机制减少客户手动逐个烧录设备密钥的工作量,提升量产效率。
16
+
17
+ ### 适用场景
18
+ - 量产阶段需要批量激活大量设备,逐一烧录设备密钥成本过高。
19
+
20
+ - 设备出厂时只烧录产品级别的 `productSecret`,由设备首次联网时自行换取设备密钥。
21
+
22
+ - 设备端希望密钥不固化在产线,降低密钥泄漏风险。
23
+
24
+ ### 名词解释
25
+
26
+ |名词|说明|
27
+ |---------|---------|
28
+ |`productId`|产品标识,在控制台创建产品时生成。|
29
+ |`productSecret`|产品密钥,产品级别,用于动态注册时对请求进行 HMAC-SHA256 签名与对响应进行 AES-128-CBC 解密。|
30
+ |`deviceId`|设备名称,在控制台批量创建设备时由平台生成或自定义,需与控制台保持一致。|
31
+ |`deviceSecret`|设备密钥,动态注册成功后由云端下发,后续登录时使用。|
32
+
33
+ ## 前提条件
34
+
35
+ 在接入动态注册功能前,请您先完成以下准备工作:
36
+ 1. 登录 [物联网开发平台控制台](https://console.cloud.tencent.com/iotexplorer),创建产品并记录 `productId` 与 `productSecret`。
37
+
38
+ 2. 在控制台**批量创建设备**,记录每台设备的 `deviceId`。动态注册要求设备名必须先在控制台预创建,否则会返回 `Pre create mode: device not exists`。
39
+
40
+ 3. 在产品详情页**开启动态注册**功能。如果未开启,设备端会收到 `Not support dynamic device register, please check setting first`。
41
+
42
+ 4. 已完成 SDK 初始化(`initSDK`)流程。动态注册仅需 SDK 初始化,**不依赖登录成功**。
43
+
44
+ ## 接入步骤
45
+
46
+ 本节介绍如何调用 SDK 完成动态注册的核心调用:**初始化 SDK、发起注册请求、在回调中获取设备密钥、使用密钥完成登录**。
47
+
48
+ ### 步骤 1:控制台预创建设备并开启动态注册
49
+ 1. 登录 [物联网开发平台控制台](https://console.cloud.tencent.com/iotexplorer),在产品列表中单击创建的产品名称进入详情。
50
+
51
+ 2. 在**设备**页面单击**批量新建设备**,生成若干 `deviceId`。动态注册时传入的 `deviceId` 必须在此列表中存在。
52
+
53
+ 3. 在产品详情页的**动态注册**开关处,确认功能已开启。关闭状态下注册请求会被云端拒绝。
54
+
55
+ ### 步骤 2:初始化 SDK
56
+
57
+ 调用 `initSDK` 完成 SDK 初始化,动态注册依赖 SDK 内部的 HTTP/TLS 能力。初始化成功返回 `0`(`TXIoTError.SUCCESS`)。
58
+ ``` java
59
+ TXIoTDeviceEngine.Config config = new TXIoTDeviceEngine.Config();
60
+ config.storagePath = getFilesDir().getAbsolutePath();
61
+ config.logLevel = TXIoTDeviceEngine.LogLevel.INFO;
62
+
63
+ int ret = TXIoTDeviceEngine.getInstance(applicationContext).initSDK(config);
64
+ if (ret != TXIoTError.SUCCESS) {
65
+ Log.e(TAG, "initSDK failed: " + ret);
66
+ return;
67
+ }
68
+ ```
69
+
70
+ ### 步骤 3:发起动态注册请求
71
+
72
+ 调用 `dynamicRegister` 发起注册,入参 `DynamicRegisterParams`:
73
+
74
+ |字段|说明|
75
+ |---------|---------|
76
+ |`productId`|产品标识,必填。|
77
+ |`deviceId`|设备名称,必填,需在控制台预创建。|
78
+ |`productSecret`|产品密钥,必填,长度需 ≥ 16字节(AES-128 密钥长度要求)。|
79
+
80
+ 回调 `TXIoTValueCallback<String>` 参数说明:
81
+
82
+ |回调|说明|
83
+ |---------|---------|
84
+ |`onSuccess(String deviceKey)`|注册成功,`deviceKey` 为云端下发的设备密钥,后续登录时作为 `deviceSecret` 使用。|
85
+ |`onError(int code, String desc)`|注册失败,`code` 为错误码,`desc` 为错误描述。常见错误码。|
86
+
87
+ > **说明:**
88
+ > - `dynamicRegister` 是异步接口,注册结果通过回调异步返回。
89
+ > - 同一时刻只允许有一个注册请求在途,重复调用会返回 `TXIoTError.DYNAMIC_REGISTER_BUSY`。
90
+
91
+ ``` java
92
+ TXIoTDeviceEngine.DynamicRegisterParams params = new TXIoTDeviceEngine.DynamicRegisterParams();
93
+ params.productId = "YOUR_PRODUCT_ID";
94
+ params.deviceId = "YOUR_DEVICE_ID";
95
+ params.productSecret = "YOUR_PRODUCT_SECRET";
96
+
97
+ TXIoTDeviceEngine.getInstance(applicationContext).dynamicRegister(params, new TXIoTValueCallback<String>() {
98
+ @Override
99
+ public void onSuccess(String deviceKey) {
100
+ Log.i(TAG, "dynamic register success, deviceKey=" + deviceKey);
101
+ // 见步骤 4:使用该密钥登录
102
+ }
103
+
104
+ @Override
105
+ public void onError(int code, String desc) {
106
+ Log.e(TAG, "dynamic register failed: " + code + ", " + desc);
107
+ }
108
+ });
109
+ ```
110
+
111
+ ### 步骤 4:使用获取的密钥登录
112
+
113
+ 动态注册成功后,在回调中拿到 `deviceKey`,将其作为 `deviceSecret` 调用 `login` 完成登录。建议将密钥持久化到本地存储,避免每次开机都重新注册。
114
+ ``` java
115
+ @Override
116
+ public void onSuccess(String deviceKey) {
117
+ Log.i(TAG, "dynamic register success, deviceKey=" + deviceKey);
118
+
119
+ // 建议持久化 deviceKey,下次开机直接复用,无需再次动态注册
120
+ // saveDeviceSecretToStorage(deviceKey);
121
+
122
+ TXIoTDeviceEngine.DeviceInfo deviceInfo = new TXIoTDeviceEngine.DeviceInfo();
123
+ deviceInfo.productId = "YOUR_PRODUCT_ID";
124
+ deviceInfo.deviceId = "YOUR_DEVICE_ID";
125
+ deviceInfo.deviceSecret = deviceKey; // 使用动态注册获取的密钥
126
+
127
+ TXIoTDeviceEngine.getInstance(applicationContext).login(deviceInfo, new TXIoTCallback() {
128
+ @Override
129
+ public void onSuccess() {
130
+ Log.i(TAG, "login success");
131
+ }
132
+
133
+ @Override
134
+ public void onError(int code, String desc) {
135
+ Log.e(TAG, "login failed: " + code + ", " + desc);
136
+ }
137
+ });
138
+ }
139
+ ```
140
+
141
+ > **注意:**
142
+ > `deviceKey` 属于设备敏感凭证,建议持久化到应用私有目录或 Android Keystore 等安全存储中,避免明文保存或提交到代码仓库。
143
+ >
144
+
145
+ ## 完整示例代码
146
+
147
+ 以下示例整合上述步骤,演示在 Android 应用中完成 SDK 初始化、动态注册、并使用获取的密钥登录的完整流程。
148
+ ``` java
149
+ package com.example.iotdemo;
150
+
151
+ import android.content.Context;
152
+ import android.util.Log;
153
+
154
+ import com.tencent.liteav.iot.TXIoTCallback;
155
+ import com.tencent.liteav.iot.TXIoTDeviceEngine;
156
+ import com.tencent.liteav.iot.TXIoTError;
157
+ import com.tencent.liteav.iot.TXIoTValueCallback;
158
+
159
+ public class DynamicRegisterHelper {
160
+
161
+ private static final String TAG = "DynamicRegister";
162
+
163
+ private final TXIoTDeviceEngine mEngine;
164
+ private final String mProductId;
165
+ private final String mDeviceId;
166
+ private final String mProductSecret;
167
+
168
+ public DynamicRegisterHelper(Context context, String productId, String deviceId, String productSecret) {
169
+ mEngine = TXIoTDeviceEngine.getInstance(context.getApplicationContext());
170
+ mProductId = productId;
171
+ mDeviceId = deviceId;
172
+ mProductSecret = productSecret;
173
+ }
174
+
175
+ /** 初始化 SDK 并开始动态注册 */
176
+ public void start() {
177
+ // 1. 初始化 SDK
178
+ TXIoTDeviceEngine.Config config = new TXIoTDeviceEngine.Config();
179
+ config.logLevel = TXIoTDeviceEngine.LogLevel.INFO;
180
+
181
+ int ret = mEngine.initSDK(config);
182
+ if (ret != TXIoTError.SUCCESS) {
183
+ Log.e(TAG, "initSDK failed: " + ret);
184
+ return;
185
+ }
186
+
187
+ // 2. 发起动态注册
188
+ TXIoTDeviceEngine.DynamicRegisterParams params = new TXIoTDeviceEngine.DynamicRegisterParams();
189
+ params.productId = mProductId;
190
+ params.deviceId = mDeviceId;
191
+ params.productSecret = mProductSecret;
192
+
193
+ mEngine.dynamicRegister(params, new TXIoTValueCallback<String>() {
194
+ @Override
195
+ public void onSuccess(String deviceKey) {
196
+ Log.i(TAG, "dynamic register success, deviceKey=" + deviceKey);
197
+ loginWithDeviceKey(deviceKey);
198
+ }
199
+
200
+ @Override
201
+ public void onError(int code, String desc) {
202
+ Log.e(TAG, "dynamic register failed: " + code + ", " + desc);
203
+ }
204
+ });
205
+ }
206
+
207
+ /** 3. 使用动态注册获取的密钥登录 */
208
+ private void loginWithDeviceKey(String deviceKey) {
209
+ // 建议持久化 deviceKey,下次开机直接复用,无需再次动态注册
210
+ // saveDeviceSecretToStorage(deviceKey);
211
+
212
+ TXIoTDeviceEngine.DeviceInfo deviceInfo = new TXIoTDeviceEngine.DeviceInfo();
213
+ deviceInfo.productId = mProductId;
214
+ deviceInfo.deviceId = mDeviceId;
215
+ deviceInfo.deviceSecret = deviceKey;
216
+
217
+ mEngine.login(deviceInfo, new TXIoTCallback() {
218
+ @Override
219
+ public void onSuccess() {
220
+ Log.i(TAG, "login success");
221
+ }
222
+
223
+ @Override
224
+ public void onError(int code, String desc) {
225
+ Log.e(TAG, "login failed: " + code + ", " + desc);
226
+ }
227
+ });
228
+ }
229
+
230
+ /** 4. 业务完成后释放资源 */
231
+ public void release() {
232
+ mEngine.logout(null);
233
+ mEngine.uninitSDK();
234
+ }
235
+ }
236
+ ```
237
+
238
+ > **说明:**
239
+ > 1. 动态注册仅依赖 `initSDK` 成功,无需提前登录;获取到 `deviceKey` 后再执行 `login`。
240
+ > 2. Demo 的 `LoginActivity` 已集成动态注册流程,可参考其实现。
241
+
242
+ ## 编译并运行
243
+
244
+ Demo 已开源,仓库地址:[github.com/Tencent-RTC/Tencent_IoT_Device](https://github.com/Tencent-RTC/Tencent_IoT_Device),Android Demo 位于顶层 `Android/` 目录。
245
+ 1. 使用 `git clone` 将开源 Demo 从 GitHub 克隆到本地。
246
+
247
+ 2. 打开 Android Studio,点击 **Open** 导入工程,等待 Gradle Sync 完成。
248
+
249
+ 3. 连接 **Android 真机**,点击工具栏 **Run** 编译运行。
250
+
251
+ ``` bash
252
+ # 也可在控制台打包 APK 后发送到手机安装
253
+ ./gradlew :app:assembleDebug
254
+ ```
255
+ 4. 观察日志输出,出现以下内容代表动态注册与登录均成功。
256
+
257
+ ``` text
258
+ dynamic register success, deviceKey=xxxxxxxxxxxxx
259
+ login success
260
+ ```
261
+
262
+ ## 常见问题
263
+
264
+ |现象|排查建议|
265
+ |---------|---------|
266
+ |动态注册回调提示 `Not support dynamic device register, please check setting first`。|动态注册功能未在控制台开启。请在产品详情页打开动态注册开关后再试。|
267
+ |动态注册回调提示 `Pre create mode: device not exists`。|传入的 `deviceId` 在控制台未预创建。请先在控制台批量创建对应设备,确保 `deviceId` 与控制台一致。|
268
+ |动态注册回调提示 `Device has been activated`。|该设备已动态注册过且密钥已激活。已注册的设备名再次动态注册会被拒绝,请使用上次获取的密钥登录。|
269
+ |动态注册获取的密钥未登录,再次注册拿到新密钥。|如果动态注册获取的密钥未用于登录,下次仍可执行动态注册,但会获取到新的密钥,之前的密钥同时失效,只能使用最新获取的密钥。|
270
+ |`dynamicRegister` 返回 `DYNAMIC_REGISTER_BUSY`(-20)|上一次注册请求仍在途。SDK 同一时刻只允许一个注册请求,请等待回调返回后再发起新请求。|
271
+ |`dynamicRegister` 返回 `INVALID_ARGUMENT`(-3)|检查 `productId`、`deviceId` 是否为空或过长;`productSecret` 长度是否 ≥ 16字节(AES-128 密钥要求)。|
272
+ |`dynamicRegister` 返回 `NOT_INITIALIZED`(-4)|确认在调用前已成功调用 `initSDK`。|
273
+ |`DYNAMIC_REGISTER_REQUEST_FAILED`(-21)|HTTP 请求失败或云端返回错误。请检查网络、`productSecret` 是否正确、签名是否匹配;查看日志中的错误描述获取具体原因。|
274
+ |`DYNAMIC_REGISTER_RESPONSE_INVALID`(-22)|云端响应格式异常或解密失败。常见原因为 `productSecret` 与控制台不一致(解密失败),或响应被中间代理改写。|
275
+
@@ -0,0 +1,297 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - linux
5
+ types:
6
+ - feature
7
+ retrievable_scope: always
8
+ feature_domain: device
9
+ ---
10
+
11
+ 本文将介绍如何基于腾讯云物联网设备端 SDK,使用动态注册(Dynamic Register)能力,在产品量产阶段由设备自动从云端获取设备密钥,减少客户手动逐个烧录设备密钥的工作量,提升量产效率。
12
+
13
+ ## 关键概念
14
+
15
+ 动态注册用于产品量产过程中,在控制台批量创建设备后,设备根据 `productId`、`product_secret`、`device_id`,从后台获取设备密钥(device_secret)。该机制减少客户手动逐个烧录设备密钥,提升量产效率。
16
+
17
+ ### 适用场景
18
+ - 量产阶段需要批量激活大量设备,逐一烧录设备密钥成本过高。
19
+
20
+ - 设备出厂时只烧录产品级别的 `product_secret`,由设备首次联网时自行换取设备密钥。
21
+
22
+ - 设备端希望密钥不固化在产线,降低密钥泄漏风险。
23
+
24
+ ### 名词解释
25
+
26
+ |名词|说明|
27
+ |---------|---------|
28
+ |productId|产品标识,在控制台创建产品时生成。|
29
+ |product_secret|产品密钥,产品级别,用于动态注册时对请求进行 HMAC-SHA256 签名与对响应进行 AES-128-CBC 解密。|
30
+ |device_id|设备名称,在控制台批量创建设备时由平台生成或自定义,需与控制台保持一致。|
31
+ |device_secret|设备密钥,动态注册成功后由云端下发,后续登录时使用。|
32
+
33
+ ## 前提条件
34
+
35
+ 在接入动态注册功能前,请您先完成以下准备工作:
36
+ 1. 登录 [物联网开发平台控制台](https://console.cloud.tencent.com/iotexplorer),创建产品并记录 `productId` 与 `product_secret`。
37
+
38
+ 2. 在控制台**批量创建设备**,记录每台设备的 `device_id`。动态注册要求设备名必须先在控制台预创建,否则会返回 `Pre create mode: device not exists`。
39
+
40
+ 3. 在产品详情页**开启动态注册**功能。如果未开启,设备端会收到 `Not support dynamic device register, please check setting first`。
41
+
42
+ 4. 已完成 [登录与注册](https://cloud.tencent.com/document/product/1081/135023) 文档中 `tc_iot_init` 的初始化流程(动态注册仅需 SDK 初始化,不依赖 `tc_iot_login` 登录成功)。
43
+
44
+ ## 接入步骤
45
+
46
+ 本节介绍如何调用 SDK 完成动态注册的核心调用:发起注册请求、在回调中获取设备密钥、使用密钥完成登录。
47
+
48
+ ### 步骤 1:控制台预创建设备并开启动态注册
49
+ 1. 登录 [物联网开发平台控制台](https://console.cloud.tencent.com/iotexplorer),在产品列表中单击创建的产品名称进入详情。
50
+
51
+ 2. 在**设备**页面单击**批量新建设备**,生成若干 `device_id`。动态注册时传入的 `device_id` 必须在此列表中存在。
52
+
53
+ 3. 在产品详情页的**动态注册**开关处,确认功能已开启。关闭状态下注册请求会被云端拒绝。
54
+
55
+ ### 步骤 2:初始化 SDK
56
+
57
+ 调用 `tc_iot_init` 完成 SDK 初始化,动态注册依赖 SDK 内部的 HTTP/TLS 能力。
58
+ ``` c
59
+ #include "tc_iot.h"
60
+
61
+ tc_iot_config_s config;
62
+ memset(&config, 0, sizeof(config));
63
+ config.storage_path = "./";
64
+ config.log_level = TC_IOT_LOG_LEVEL_INFO;
65
+
66
+ tc_iot_error_e rc = tc_iot_init(&config);
67
+ if (rc != TC_IOT_ERR_SUCCESS) {
68
+ printf("tc_iot_init failed: %d\n", rc);
69
+ return -1;
70
+ }
71
+ ```
72
+
73
+ ### 步骤 3:发起动态注册请求
74
+
75
+ 调用 `tc_iot_dynamic_register` 发起注册,入参 `tc_iot_dynamic_register_param_s`:
76
+
77
+ |字段|说明|
78
+ |---------|---------|
79
+ |`product_id`|产品标识,必填。|
80
+ |`device_id`|设备名称,必填,需在控制台预创建。|
81
+ |`product_secret`|产品密钥,必填,长度需 ≥ 16字节(AES-128 密钥长度要求)。|
82
+
83
+ 回调 `tc_iot_dynamic_register_cb` 参数说明:
84
+
85
+ |参数|说明|
86
+ |---------|---------|
87
+ |`error_code`|`TC_IOT_ERR_SUCCESS` 表示成功;其余为错误码。|
88
+ |`error_message`|失败时的错误描述,成功时为 NULL。|
89
+ |`device_key`|注册成功时返回的设备密钥,失败时为 NULL。|
90
+
91
+ > **说明:**
92
+ > - `tc_iot_dynamic_register` 是异步接口,返回值仅表示参数是否合法以及请求是否成功入队;真正的注册结果通过回调异步返回。
93
+ > - 同一时刻只允许有一个注册请求在途,重复调用会返回 `TC_IOT_ERR_DYNAMIC_REGISTER_BUSY`。
94
+
95
+ 发起动态注册:
96
+ ``` c
97
+ static void on_dynamic_register(tc_iot_error_e error_code, const char *error_message,
98
+ const char *device_key) {
99
+ if (error_code != TC_IOT_ERR_SUCCESS || !device_key) {
100
+ printf("dynamic register failed|error=%d|message=%s\n", error_code,
101
+ error_message ? error_message : "");
102
+ return;
103
+ }
104
+ printf("dynamic register device key:%s, err_msg:%s\n", device_key, error_message);
105
+ }
106
+
107
+ tc_iot_dynamic_register_param_s param = {
108
+ .product_id = "YOUR_PRODUCT_ID",
109
+ .device_id = "YOUR_DEVICE_ID",
110
+ .product_secret = "YOUR_PRODUCT_SECRET",
111
+ };
112
+
113
+ tc_iot_error_e rc = tc_iot_dynamic_register(&param, on_dynamic_register);
114
+ if (rc != TC_IOT_ERR_SUCCESS) {
115
+ printf("tc_iot_dynamic_register failed: %d\n", rc);
116
+ }
117
+ ```
118
+
119
+ ### 步骤 4:使用获取的密钥登录
120
+
121
+ 动态注册成功后,在回调中拿到 `device_key`,将其作为 `device_secret` 调用 `tc_iot_login` 完成登录。建议将密钥持久化到本地存储,避免每次开机都重新注册。
122
+ ``` c
123
+ static volatile int s_login_done = 0;
124
+ static tc_iot_error_e s_login_rc = TC_IOT_ERR_SUCCESS;
125
+
126
+ static void on_login(tc_iot_error_e error_code, const char *error_message) {
127
+ s_login_rc = error_code;
128
+ s_login_done = 1;
129
+ if (error_code == TC_IOT_ERR_SUCCESS) {
130
+ printf("[demo] login success\n");
131
+ } else {
132
+ printf("[demo] login failed: %d, msg=%s\n", error_code,
133
+ error_message ? error_message : "");
134
+ }
135
+ }
136
+
137
+ static void on_dynamic_register(tc_iot_error_e error_code, const char *error_message,
138
+ const char *device_key) {
139
+ if (error_code != TC_IOT_ERR_SUCCESS || !device_key) {
140
+ printf("dynamic register failed|error=%d|message=%s\n", error_code,
141
+ error_message ? error_message : "");
142
+ return;
143
+ }
144
+ printf("dynamic register success, device_key:%s\n", device_key);
145
+
146
+ // 建议持久化 device_key,下次开机直接复用,无需再次动态注册
147
+ // save_device_secret_to_storage(device_key);
148
+
149
+ tc_iot_device_info_s dev = {
150
+ .product_id = "YOUR_PRODUCT_ID",
151
+ .device_id = "YOUR_DEVICE_ID",
152
+ .device_secret = device_key,
153
+ };
154
+ tc_iot_error_e rc = tc_iot_login(&dev, on_login);
155
+ if (rc != TC_IOT_ERR_SUCCESS) {
156
+ printf("tc_iot_login failed: %d\n", rc);
157
+ }
158
+ }
159
+ ```
160
+
161
+ ## 完整示例代码
162
+ ``` c
163
+ #include <stdio.h>
164
+ #include <stdlib.h>
165
+ #include <string.h>
166
+ #include <unistd.h>
167
+
168
+ #include "tc_iot.h"
169
+
170
+ static volatile int s_reg_done = 0;
171
+ static volatile int s_login_done = 0;
172
+ static tc_iot_error_e s_login_rc = TC_IOT_ERR_SUCCESS;
173
+
174
+ static void on_login(tc_iot_error_e error_code, const char *error_message) {
175
+ s_login_rc = error_code;
176
+ s_login_done = 1;
177
+ if (error_code == TC_IOT_ERR_SUCCESS) {
178
+ printf("[demo] login success\n");
179
+ } else {
180
+ printf("[demo] login failed: %d, msg=%s\n", error_code,
181
+ error_message ? error_message : "");
182
+ }
183
+ }
184
+
185
+ static void on_dynamic_register(tc_iot_error_e error_code, const char *error_message,
186
+ const char *device_key) {
187
+ s_reg_done = 1;
188
+ if (error_code != TC_IOT_ERR_SUCCESS || !device_key) {
189
+ printf("[demo] dynamic register failed|error=%d|message=%s\n", error_code,
190
+ error_message ? error_message : "");
191
+ return;
192
+ }
193
+ printf("[demo] dynamic register success, device_key:%s\n", device_key);
194
+
195
+ // 用动态注册拿到的密钥登录
196
+ tc_iot_device_info_s dev = {
197
+ .product_id = "YOUR_PRODUCT_ID",
198
+ .device_id = "YOUR_DEVICE_ID",
199
+ .device_secret = device_key,
200
+ };
201
+ tc_iot_error_e rc = tc_iot_login(&dev, on_login);
202
+ if (rc != TC_IOT_ERR_SUCCESS) {
203
+ printf("[demo] tc_iot_login failed: %d\n", rc);
204
+ }
205
+ }
206
+
207
+ int main(int argc, char **argv) {
208
+ (void)argc;
209
+ (void)argv;
210
+
211
+ // 1. 初始化 SDK
212
+ tc_iot_config_s config;
213
+ memset(&config, 0, sizeof(config));
214
+ config.storage_path = "./";
215
+ config.log_level = TC_IOT_LOG_LEVEL_INFO;
216
+
217
+ tc_iot_error_e rc = tc_iot_init(&config);
218
+ if (rc != TC_IOT_ERR_SUCCESS) {
219
+ printf("tc_iot_init failed: %d\n", rc);
220
+ return 1;
221
+ }
222
+
223
+ // 2. 发起动态注册
224
+ tc_iot_dynamic_register_param_s param = {
225
+ .product_id = "YOUR_PRODUCT_ID",
226
+ .device_id = "YOUR_DEVICE_ID",
227
+ .product_secret = "YOUR_PRODUCT_SECRET",
228
+ };
229
+
230
+ rc = tc_iot_dynamic_register(&param, on_dynamic_register);
231
+ if (rc != TC_IOT_ERR_SUCCESS) {
232
+ printf("tc_iot_dynamic_register failed: %d\n", rc);
233
+ tc_iot_deinit();
234
+ return 1;
235
+ }
236
+
237
+ // 3. 等待动态注册 + 登录完成
238
+ int waited_ms = 0;
239
+ while (!s_reg_done && waited_ms < 15000) {
240
+ usleep(100 * 1000);
241
+ waited_ms += 100;
242
+ }
243
+ if (!s_reg_done) {
244
+ printf("[demo] dynamic register timeout\n");
245
+ tc_iot_deinit();
246
+ return 1;
247
+ }
248
+
249
+ waited_ms = 0;
250
+ while (!s_login_done && waited_ms < 10000) {
251
+ usleep(100 * 1000);
252
+ waited_ms += 100;
253
+ }
254
+
255
+ // 4. 业务完成后释放资源
256
+ if (s_login_done && s_login_rc == TC_IOT_ERR_SUCCESS) {
257
+ tc_iot_logout();
258
+ }
259
+ tc_iot_deinit();
260
+ printf("[demo] main exit\n");
261
+ return 0;
262
+ }
263
+ ```
264
+
265
+ ## 编译并运行
266
+ 1. 在项目根目录执行 CMake 编译。编译前请将示例程序中 `"YOUR_PRODUCT_ID"`, `"YOUR_DEVICE_ID"`, `"YOUR_PRODUCT_SECRET"` 替换为控制台获取的有效数据。
267
+
268
+ ``` bash
269
+ cmake -B build
270
+ cmake --build build -j
271
+ ```
272
+ 2. 运行可执行文件。
273
+
274
+ ``` bash
275
+ ./build/iot_video_demo
276
+ ```
277
+ 3. 观察日志输出,出现以下内容代表动态注册与登录均成功。
278
+
279
+ ``` bash
280
+ [demo] dynamic register success, device_key:xxxxxxxxxxxxx
281
+ [demo] login success
282
+ ```
283
+
284
+ ## 常见问题
285
+
286
+ |现象|排查建议|
287
+ |---------|---------|
288
+ |动态注册回调提示错误 `Not support dynamic device register, please check setting first`。|动态注册功能未在控制台开启。请在产品详情页打开动态注册开关后再试。|
289
+ |动态注册回调提示错误`"Pre create mode: device not exists"`。|传入的 `device_id` 在控制台未预创建。请先在控制台批量创建对应设备,确保 `device_id` 与控制台一致。|
290
+ |动态注册回调提示错误`"Device has been activated"`。|该设备已动态注册过且密钥已激活。已注册的设备名再次动态注册会被拒绝,请使用上次获取的密钥登录,或参考下方说明。|
291
+ |动态注册获取的密钥未登录,再次注册拿到新密钥。|如果动态注册获取的密钥未用于登录,下次仍可执行动态注册,但会获取到新的密钥,之前的密钥同时失效,只能使用最新获取的密钥。|
292
+ |`tc_iot_dynamic_register` 返回 `TC_IOT_ERR_DYNAMIC_REGISTER_BUSY`。|上一次注册请求仍在途。SDK 同一时刻只允许一个注册请求,请等待回调返回后再发起新请求。|
293
+ |`tc_iot_dynamic_register` 返回 `TC_IOT_ERR_INVALID_ARGUMENT`。|检查 `product_id`、`device_id` 是否为空或过长(需 < 64字节);`product_secret` 长度是否 ≥ 16字节(AES-128 密钥要求)。|
294
+ |`tc_iot_dynamic_register` 返回 `TC_IOT_ERR_NOT_INITIALIZED`。|确认在调用前已成功调用 `tc_iot_init`。|
295
+ |`TC_IOT_ERR_DYNAMIC_REGISTER_REQUEST_FAILED`|HTTP 请求失败或云端返回错误。请检查网络、`product_secret` 是否正确、签名是否匹配;查看 SDK 日志中的 `error_message` 获取具体原因。|
296
+ |`TC_IOT_ERR_DYNAMIC_REGISTER_RESPONSE_INVALID`|云端响应格式异常或解密失败。常见原因为 `product_secret` 与控制台不一致(解密失败),或响应被中间代理改写。|
297
+