@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,131 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - android
5
+ types:
6
+ - feature
7
+ retrievable_scope: always
8
+ feature_domain: device
9
+ ---
10
+
11
+ 本文将介绍如何快速完成腾讯云物联网(IoT)设备端 SDK 的接入,跑通登录功能。
12
+
13
+ ## 前提条件
14
+
15
+ ### 开通服务
16
+
17
+ 在使用 IoT 设备端 SDK 前,您需要前往控制台,创建产品并在产品下创建设备。具体步骤参见 [开通服务](https://cloud.tencent.com/document/product/1081/135239)。
18
+
19
+ 开通服务后,请记录以下设备三元组信息,在后续 登录 步骤中会用到:
20
+ - **ProductId**(产品 ID)
21
+
22
+ - **DeviceName**(设备名称)
23
+
24
+ - **DeviceSecret**(设备密钥)
25
+
26
+ > **注意:**
27
+ >
28
+ > 设备三元组是设备登录平台的唯一身份凭证,请妥善保管 DeviceSecret,避免硬编码提交到公共代码仓库。
29
+ >
30
+
31
+ ### 环境准备
32
+ - Android Studio 3.5 及以上版本。
33
+
34
+ - 最低兼容 Android 5.0(SDK API Level 21)及以上。
35
+
36
+ ## 创建项目
37
+
38
+ 参考以下步骤创建一个新的 Android 项目。如果已有项目,可跳过本节。
39
+ 1. 打开 Android Studio,选择 New Project(新建项目)。
40
+
41
+ 2. 选择 **Empty Views Activity** 模板,单击 **Next**。
42
+
43
+ 3. 在 Configure your project 页面配置:
44
+
45
+ - Language 选择 Java。
46
+
47
+ - Minimum SDK 选择 Android 5.0(API 21)及以上。
48
+
49
+ - Build configuration language 选择 Groovy DSL (build.gradle)。
50
+
51
+ ## 集成 SDK
52
+ 1. 在 app/build.gradle(非根目录的 build.gradle)的 dependencies 中添加 TRTC SDK 以及 IoT SDK 依赖:
53
+
54
+ ``` java
55
+ dependencies {
56
+ //TRTC SDK
57
+ implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
58
+ // 物联网设备端 SDK
59
+ implementation 'com.tencent.liteav.iot:tx-iot-device:latest.release'
60
+ }
61
+ ```
62
+ 2. 完成配置后,在 Android Studio 工具栏单击 **Sync Now**,SDK 将自动下载并集成到工程中。出现 Build successful 即表示成功。
63
+
64
+ ## 接入步骤
65
+
66
+ ### 步骤 1:初始化 SDK
67
+
68
+ 调用 TXIoTDeviceEngine.getInstance 获取 SDK 实例,并通过 TXIoTDeviceEngine.initSDK 初始化,以及注册日志回调和设备状态推送监听。
69
+
70
+ |参数|类型|说明|
71
+ |---------|---------|---------|
72
+ |`storagePath`|`String`|本地持久化目录;可为 NULL;非空时长度须合法(实现侧上限约 256)。|
73
+ |`logLevel`|`TXIoTDeviceEngine.LogLevel`|日志级别。|
74
+ |`region`|`String`|地域。|
75
+
76
+ ``` java
77
+ TXIoTDeviceEngine ioTDeviceEngine = TXIoTDeviceEngine.getInstance(getApplicationContext());
78
+ ioTDeviceEngine.addListener(new TXIoTDeviceEngine.Listener() {
79
+ @Override
80
+ public void onLog(TXIoTDeviceEngine.LogLevel level, String log) {
81
+ Log.d(TAG, "onLog: level = " + level + ", log = " + log);
82
+ }
83
+
84
+ @Override
85
+ public void onDeviceStateChanged(TXIoTDeviceEngine.DeviceState oldState, TXIoTDeviceEngine.DeviceState newState) {
86
+ Log.d(TAG, "onDeviceStateChanged: oldState = " + oldState + ", newState = " + newState);
87
+ }
88
+ });
89
+
90
+ //初始化 SDK
91
+ TXIoTDeviceEngine.Config config = new TXIoTDeviceEngine.Config();
92
+ config.storagePath = "file_path";
93
+ config.logLevel = TXIoTDeviceEngine.LogLevel.INFO;
94
+ config.region = "china";//国内取值为china,国外取值为us-east、europe、ap-bangkok
95
+ ioTDeviceEngine.initSDK(config);
96
+ ```
97
+
98
+ ### 步骤 2:登录
99
+
100
+ 调用 TXIoTDeviceEngine.login 完成鉴权并登录,并通过回调监听登录结果。
101
+
102
+ |参数|类型|说明|
103
+ |---------|---------|---------|
104
+ |`productId`|`String`|产品 ID。|
105
+ |`deviceId`|`String`|设备名称,即 `DeviceName`。|
106
+ |`deviceSecret`|`String`|设备密钥。|
107
+
108
+ ``` java
109
+ TXIoTDeviceEngine.DeviceInfo deviceInfo = new TXIoTDeviceEngine.DeviceInfo();
110
+ deviceInfo.productId = "PRODUCT_ID";
111
+ deviceInfo.deviceId = "DEVICE_NAME";
112
+ deviceInfo.deviceSecret = "DEVICE_SECRET";
113
+ ioTDeviceEngine.login(deviceInfo, new TXIoTCallback() {
114
+ @Override
115
+ public void onSuccess() {
116
+ //登录成功
117
+ }
118
+
119
+ @Override
120
+ public void onError(int code, String desc) {
121
+ //登录失败
122
+ }
123
+ });
124
+ ```
125
+
126
+ ## 常见问题
127
+
128
+ |现象|排查建议|
129
+ |---------|---------|
130
+ |login 长时间无回调 / 超时|检查设备三元组是否正确、网络是否可达、本机系统时间是否准确。|
131
+
@@ -0,0 +1,291 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - linux
5
+ types:
6
+ - feature
7
+ retrievable_scope: always
8
+ feature_domain: device
9
+ ---
10
+
11
+ 本文将介绍如何快速接入腾讯云物联网设备端 SDK,跑通**登录**功能。
12
+
13
+ ## 前提条件
14
+
15
+ ### 开通服务
16
+
17
+ 在使用 IoT 设备端 SDK 前,您需要前往控制台,创建产品并在产品下创建设备。具体步骤参见 开通服务。
18
+
19
+ 开通服务后,请记录以下设备三元组信息,在后续 登录 步骤中会用到:
20
+ - **ProductId**(产品 ID)
21
+
22
+ - **DeviceName**(设备名称)
23
+
24
+ - **DeviceSecret**(设备密钥)
25
+
26
+ > **注意:**
27
+ >
28
+ > 设备三元组是设备登录平台的唯一身份凭证,请妥善保管 DeviceSecret,避免硬编码提交到公共代码仓库。
29
+ >
30
+
31
+ ### 环境准备
32
+
33
+ 请根据您实际对接的设备芯片平台,准备对应的编译环境。本文以 Linux 本机环境为例演示接入流程,帮助您快速跑通登录功能;正式对接您的设备时,替换为目标芯片平台的交叉编译工具链即可,示例代码无需改动。
34
+
35
+ 【Linux 本机(快速体验)】
36
+
37
+ |环境项|要求|
38
+ |---------|---------|
39
+ |操作系统|x86_64 Linux(Ubuntu 18.04+ / CentOS 7+ 等主流发行版)。|
40
+ |编译工具|CMake 3.10 及以上、GCC / Clang(支持 C99)。|
41
+ |系统依赖库|`pthread`、`m`(数学库)、`dl`、`z`(zlib)。|
42
+
43
+ 【嵌入式设备(交叉编译)】
44
+
45
+ |环境项|要求|
46
+ |---------|---------|
47
+ |交叉编译工具链|与目标芯片架构匹配的 GCC / Clang 交叉工具链(如 `arm-linux-gnueabihf-gcc`、`aarch64-none-linux-gnu-gcc` 等),具体工具链由芯片厂商 SDK 或 FAE 提供。|
48
+ |编译工具|CMake 3.21 及以上(交叉编译需要通过 `-DCMAKE_TOOLCHAIN_FILE` 指定工具链配置文件)。|
49
+ |sysroot|部分工具链已自带默认 sysroot,无需单独指定;如需自定义。|
50
+ |系统依赖库|与目标架构匹配的 `pthread`、`m`、`dl`、`z` 等库版本,通常随交叉工具链一并提供。|
51
+
52
+ > **说明:**
53
+ > 不同芯片平台的交叉编译工具链配置差异较大,具体的工具链路径、`-DCMAKE_TOOLCHAIN_FILE` 配置方式请参考对应芯片平台 SDK 包内的 README 说明。
54
+ >
55
+
56
+ ### 获取 SDK
57
+
58
+ 前往 SDK & Demo 页面下载 SDK 包并解压。解压后得到以下内容:
59
+ ```
60
+ tc_iot_sdk/
61
+ ├── include/ # 全量 public API 头文件(tc_iot.h 等)
62
+ └── lib/
63
+ └── libtc_iot_sdk.a # SDK 静态库
64
+ ```
65
+
66
+ ## 创建项目
67
+ 1. 新建项目目录,并将上一步下载解压得到的 `tc_iot_sdk/` 目录拷贝到项目根目录下。
68
+
69
+ ``` bash
70
+ mkdir -p my_iot_project && cd my_iot_project
71
+ cp -r /path/to/tc_iot_sdk .
72
+ ```
73
+ 2. 项目目录结构如下:
74
+
75
+ ```
76
+ my_iot_project/
77
+ ├── CMakeLists.txt
78
+ ├── main.c
79
+ └── tc_iot_sdk/
80
+ ├── include/
81
+ └── lib/libtc_iot_sdk.a
82
+ ```
83
+
84
+ ## 集成并引入 SDK
85
+
86
+ ### 步骤 1:配置 CMakeLists.txt
87
+
88
+ 在项目根目录创建 `CMakeLists.txt`,添加头文件搜索路径与静态库链接:
89
+
90
+ 【CMakeLists.txt】
91
+ ``` cmake
92
+ cmake_minimum_required(VERSION 3.10)
93
+ project(iot_quickstart_demo C)
94
+
95
+ set(CMAKE_C_STANDARD 99)
96
+
97
+ set(SDK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tc_iot_sdk)
98
+
99
+ add_executable(iot_quickstart_demo main.c)
100
+
101
+ target_include_directories(iot_quickstart_demo PRIVATE
102
+ ${SDK_DIR}/include)
103
+
104
+ target_link_libraries(iot_quickstart_demo PRIVATE
105
+ -Wl,--start-group ${SDK_DIR}/lib/libtc_iot_sdk.a -Wl,--end-group
106
+ pthread m dl z)
107
+ ```
108
+
109
+ ### 步骤 2:引入头文件
110
+
111
+ 在 `main.c` 中引入设备端登录相关头文件:
112
+ ``` c
113
+ #include "tc_iot.h" // 初始化 / 登录 / 登出
114
+ ```
115
+
116
+ ## 接入步骤
117
+
118
+ 本节介绍如何调用 SDK 完成**登录**。
119
+
120
+ ### 步骤 1:初始化 SDK
121
+
122
+ 调用 `tc_iot_init` 完成 SDK 全局初始化:
123
+ | 参数 | 类型 | 说明 |
124
+ | --- | --- | --- |
125
+ | <code>storage_path</code> | <code>const char *</code> | 本地存储位置。 |
126
+ | <code>log_level</code> | <code>tc_iot_log_level_e</code> | 日志级别。 |
127
+ | <code>on_log</code> | <code>void (*)(tc_iot_log_level_e level,</code><br><code>const char *log)</code> | 日志回调。 |
128
+ | <code>on_device_event</code> | <code>void (*)(tc_iot_device_event_type_e</code><br><code>event_type, const void *event_data)</code> | 事件回调(在线、离线、重连)。 |
129
+ | <code>region</code> | <code>const char *</code> | - 国内站:<code>""</code><br>- 海外站:<code>"us-east"</code>/<code>"europe"</code>/<code>"ap-bangkok"</code> |
130
+
131
+ ``` c
132
+ #include <string.h>
133
+ #include "tc_iot.h"
134
+
135
+ tc_iot_config_s config;
136
+ memset(&config, 0, sizeof(config));
137
+ config.storage_path = "./";
138
+ config.log_level = TC_IOT_LOG_LEVEL_INFO;
139
+ config.on_log = NULL;
140
+ config.on_device_event = NULL;
141
+
142
+ tc_iot_error_e rc = tc_iot_init(&config);
143
+ if (rc != TC_IOT_ERR_SUCCESS) {
144
+ printf("tc_iot_init failed: %d\n", rc);
145
+ return -1;
146
+ }
147
+ ```
148
+
149
+ ### 步骤 2:登录
150
+
151
+ 调用 `tc_iot_login` 使用设备三元组完成登录鉴权,登录结果通过回调异步返回:
152
+
153
+ |参数|类型|说明|
154
+ |---------|---------|---------|
155
+ |`product_id`|`const char *`|产品 ID。|
156
+ |`device_id`|`const char *`|设备名称。|
157
+ |`device_secret`|`const char *`|设备密钥。|
158
+
159
+ ``` c
160
+ static void on_login(tc_iot_error_e error_code, const char *error_message) {
161
+ if (error_code == TC_IOT_ERR_SUCCESS) {
162
+ printf("[demo] login success\n");
163
+ } else {
164
+ printf("[demo] login failed: %d, msg=%s\n", error_code,
165
+ error_message ? error_message : "");
166
+ }
167
+ }
168
+
169
+ tc_iot_device_info_s device_info;
170
+ device_info.product_id = "YOUR_PRODUCT_ID";
171
+ device_info.device_id = "YOUR_DEVICE_NAME";
172
+ device_info.device_secret = "YOUR_DEVICE_SECRET";
173
+
174
+ rc = tc_iot_login(&device_info, on_login);
175
+ if (rc != TC_IOT_ERR_SUCCESS) {
176
+ printf("tc_iot_login call failed: %d\n", rc);
177
+ }
178
+ ```
179
+
180
+ ## 完整示例代码
181
+ ``` c
182
+ #include <stdio.h>
183
+ #include <string.h>
184
+ #include <unistd.h>
185
+ #include "tc_iot.h"
186
+
187
+ static volatile int s_login_done = 0;
188
+ static tc_iot_error_e s_login_rc = TC_IOT_ERR_SUCCESS;
189
+
190
+ static void on_login(tc_iot_error_e error_code, const char *error_message) {
191
+ s_login_rc = error_code;
192
+ s_login_done = 1;
193
+ if (error_code != TC_IOT_ERR_SUCCESS) {
194
+ printf("[demo] login failed: %d, msg=%s\n", error_code,
195
+ error_message ? error_message : "");
196
+ } else {
197
+ printf("[demo] login success\n");
198
+ }
199
+ }
200
+
201
+ int main(int argc, char **argv) {
202
+ if (argc < 7) {
203
+ printf("Usage: %s -p <product_id> -d <device_id> -s <device_secret>\n", argv[0]);
204
+ return 0;
205
+ }
206
+
207
+ const char *product_id = NULL;
208
+ const char *device_id = NULL;
209
+ const char *device_secret = NULL;
210
+ for (int i = 1; i < argc; i++) {
211
+ if (strcmp(argv[i], "-p") == 0 && i + 1 < argc) {
212
+ product_id = argv[++i];
213
+ } else if (strcmp(argv[i], "-d") == 0 && i + 1 < argc) {
214
+ device_id = argv[++i];
215
+ } else if (strcmp(argv[i], "-s") == 0 && i + 1 < argc) {
216
+ device_secret = argv[++i];
217
+ }
218
+ }
219
+ if (!product_id || !device_id || !device_secret) {
220
+ printf("device info error\n");
221
+ return 1;
222
+ }
223
+
224
+ // 1. 初始化 SDK
225
+ tc_iot_config_s config;
226
+ memset(&config, 0, sizeof(config));
227
+ config.storage_path = "./";
228
+ config.log_level = TC_IOT_LOG_LEVEL_INFO;
229
+
230
+ tc_iot_error_e rc = tc_iot_init(&config);
231
+ if (rc != TC_IOT_ERR_SUCCESS) {
232
+ printf("tc_iot_init failed: %d\n", rc);
233
+ return 1;
234
+ }
235
+
236
+ // 2. 登录
237
+ tc_iot_device_info_s device_info;
238
+ device_info.product_id = product_id;
239
+ device_info.device_id = device_id;
240
+ device_info.device_secret = device_secret;
241
+
242
+ rc = tc_iot_login(&device_info, on_login);
243
+ if (rc != TC_IOT_ERR_SUCCESS) {
244
+ printf("tc_iot_login call failed: %d\n", rc);
245
+ tc_iot_deinit();
246
+ return 1;
247
+ }
248
+
249
+ int waited_ms = 0;
250
+ while (!s_login_done && waited_ms < 5000) {
251
+ usleep(100 * 1000);
252
+ waited_ms += 100;
253
+ }
254
+ if (!s_login_done || s_login_rc != TC_IOT_ERR_SUCCESS) {
255
+ printf("login timeout or failed\n");
256
+ tc_iot_deinit();
257
+ return 1;
258
+ }
259
+
260
+ // 3. 释放资源
261
+ tc_iot_logout();
262
+ tc_iot_deinit();
263
+ printf("[demo] main exit\n");
264
+ return 0;
265
+ }
266
+ ```
267
+
268
+ ## 编译并运行
269
+ 1. 在项目根目录执行 CMake 编译。
270
+
271
+ ``` bash
272
+ cmake -B build
273
+ cmake --build build -j
274
+ ```
275
+ 2. 运行可执行文件,传入设备三元组。
276
+
277
+ ``` bash
278
+ ./build/iot_quickstart_demo -p YOUR_PRODUCT_ID -d YOUR_DEVICE_NAME -s 'YOUR_DEVICE_SECRET'
279
+ ```
280
+ 3. 观察日志输出,出现以下内容代表登录成功。
281
+
282
+ 您可以进入 [物联网开发平台控制台](https://console.cloud.tencent.com/iotexplorer),在实例下的设备详情页面查看设备状态。
283
+
284
+ ## 常见问题
285
+
286
+ |现象|排查建议|
287
+ |---------|---------|
288
+ |`tc_iot_login` 长时间无回调 / 超时|检查设备三元组是否正确、网络是否可达、本机系统时间是否准确。|
289
+ |编译报错找不到头文件|确认 `CMakeLists.txt` 中 `target_include_directories` 正确指向 `tc_iot_sdk/include`。|
290
+ |链接报错找不到符号|确认链接顺序使用了 `-Wl,--start-group ... -Wl,--end-group` 包裹静态库,且补齐了 `pthread m dl z` 系统库。|
291
+
@@ -0,0 +1,237 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - android
5
+ types:
6
+ - feature
7
+ retrievable_scope: always
8
+ feature_domain: device
9
+ ---
10
+
11
+ 本文将介绍设备如何在 Android 平台实现响应 APP 发起的**监控请求**、**采集并推送音视频画面**、**切换清晰度**,帮助您快速了解实时监控的功能。
12
+
13
+ ## 前提条件
14
+
15
+ 在开始之前,请您先完成 登录与注册 文档中跑通 login 登录功能。如果您已经完成,可以跳过该操作。
16
+
17
+ > **说明:**
18
+ > 监控推流依赖摄像头与麦克风采集,请确保已在 `AndroidManifest.xml` 中声明 `android.permission.CAMERA`、`android.permission.RECORD_AUDIO` 权限,并在运行时向用户申请授权。
19
+ >
20
+
21
+ ## 接入步骤
22
+
23
+ ### 步骤 1:注册监控事件回调
24
+
25
+ 登录成功后,通过 `TXIoTMonitorSession.getInstance().addListener` 注册 TXIoTMonitorSession.Listener,实时监控相关的回调如下:
26
+
27
+ |回调|说明|
28
+ |---------|---------|
29
+ |`onMonitorBegin`|APP 发起监控查看请求时触发,携带 option(清晰度等)与 `customData`(自定义数据)。|
30
+ |`onMonitorEnd`|对端结束监控查看时触发。|
31
+ |`onMonitorSwitch`|APP 在监控查看期间切换清晰度时触发,携带切换后的 quality(可选实现。|
32
+ |`onPTZCommandReceived`|APP 下发云台控制指令时触发,携带 `command`(方向/变焦等)与 `speed`(速度),仅支持云台的设备需实现。|
33
+
34
+ ``` java
35
+ import com.tencent.liteav.iot.TXIoTMonitorSession;
36
+
37
+ TXIoTMonitorSession monitorSession = TXIoTMonitorSession.getInstance();
38
+
39
+ TXIoTMonitorSession.Listener listener = new TXIoTMonitorSession.Listener() {
40
+ @Override
41
+ public void onMonitorBegin(TXIoTMonitorSession.Option option, String customData) {
42
+ // APP 发起监控,开启摄像头/麦克风采集推流(详见步骤 2、步骤 3)
43
+ }
44
+
45
+ @Override
46
+ public void onMonitorEnd() {
47
+ // APP 结束监控,关闭采集推流(详见步骤 5)
48
+ }
49
+
50
+ @Override
51
+ public void onMonitorSwitch(TXIoTMonitorSession.VideoQuality quality) {
52
+ // APP 切换清晰度(详见步骤 4)
53
+ }
54
+
55
+ @Override
56
+ public void onPTZCommandReceived(TXIoTMonitorSession.PTZCommand command, int speed) {
57
+ // 云台控制指令(可选实现)
58
+ }
59
+ };
60
+
61
+ monitorSession.addListener(listener);
62
+ ```
63
+
64
+ ### 步骤 2:响应 onMonitorBegin,开启摄像头推流
65
+
66
+ 在 `onMonitorBegin` 回调中,**必须**调用 openCamera 开启摄像头采集并推流,只需传入 `Option` 与用于本地预览的 `TXCloudVideoView` 即可:
67
+
68
+ |接口|说明|
69
+ |---------|---------|
70
+ |`openCamera(Option option, TXCloudVideoView view)`|开启摄像头采集并推流,`option` 指定视频清晰度(可复用回调传入的 `option`);`view` 为本地预览渲染控件,若无需本地预览可传 `null,`返回 `0`(`TXIoTError.SUCCESS`)表示调用成功。|
71
+ |`closeCamera`|关闭摄像头采集与推流(。|
72
+
73
+ ``` java
74
+ private TXCloudVideoView mVideoView; // 在布局中放置 <com.tencent.rtmp.ui.TXCloudVideoView/> 并获取实例
75
+
76
+ @Override
77
+ public void onMonitorBegin(TXIoTMonitorSession.Option option, String customData) {
78
+ // 开启摄像头采集并推流,同时在 mVideoView 上本地预览
79
+ int ret = TXIoTMonitorSession.getInstance().openCamera(option, mVideoView);
80
+ if (ret != TXIoTError.SUCCESS) {
81
+ Log.e(TAG, "openCamera failed: " + ret);
82
+ }
83
+
84
+ // 若需要音频,继续开启麦克风推流(详见步骤 3)
85
+ TXIoTMonitorSession.getInstance().openMicrophone();
86
+ }
87
+ ```
88
+
89
+ ### 步骤 3:开启麦克风推流
90
+
91
+ 若监控需要音频,调用 openMicrophone 开启麦克风就可实现音频采集并推流。
92
+
93
+ |接口|说明|
94
+ |---------|---------|
95
+ |`openMicrophone()`|开启麦克风采集并推流。|
96
+ |`closeMicrophone`|关闭麦克风采集与推流(。|
97
+
98
+ > **注意:**
99
+ > 开启摄像头与麦克风前,请确保已获得 `CAMERA` 与 `RECORD_AUDIO` 运行时权限,否则采集会失败导致对端无画面或无声音。
100
+ >
101
+
102
+ ``` java
103
+ int ret = TXIoTMonitorSession.getInstance().openMicrophone();
104
+ if (ret != TXIoTError.SUCCESS) {
105
+ Log.e(TAG, "openMicrophone failed: " + ret);
106
+ }
107
+ ```
108
+
109
+ ### 步骤 4:响应 onMonitorSwitch,切换视频清晰度(可选)
110
+
111
+ APP 端在监控查看期间切换清晰度时,设备端会通过 `onMonitorSwitch` 回调收到通知,携带切换后的 `quality`,在 `onMonitorSwitch` 回调中调用 switchVideoQuality 传入新的清晰度即可完成清晰度切换。`quality` 的可选取值(`TXIoTMonitorSession.VideoQuality`)如下:
112
+
113
+ |取值|说明|
114
+ |---------|---------|
115
+ |`VideoQuality.UNKNOWN`|未知/未设置。|
116
+ |`VideoQuality.LD`|流畅(低清晰度)。|
117
+ |`VideoQuality.SD`|标清。|
118
+ |`VideoQuality.HD`|高清。|
119
+ |`VideoQuality.FHD`|超清(全高清)。|
120
+
121
+ ``` java
122
+ @Override
123
+ public void onMonitorSwitch(TXIoTMonitorSession.VideoQuality quality) {
124
+ int ret = TXIoTMonitorSession.getInstance().switchVideoQuality(quality);
125
+ if (ret != TXIoTError.SUCCESS) {
126
+ Log.e(TAG, "switchVideoQuality failed: " + ret);
127
+ }
128
+ }
129
+ ```
130
+
131
+ ### 步骤 5:响应 onMonitorEnd,关闭采集推流
132
+
133
+ 对端结束监控查看时触发 `onMonitorEnd`,此时应关闭摄像头与麦克风,停止采集推流:
134
+ ``` java
135
+ @Override
136
+ public void onMonitorEnd() {
137
+ TXIoTMonitorSession.getInstance().closeCamera();
138
+ TXIoTMonitorSession.getInstance().closeMicrophone();
139
+ }
140
+ ```
141
+
142
+ ## 示例代码
143
+
144
+ 以下示例展示在一个 Activity 中完成监听注册与监控推流的完整流程,设备登录与初始化。
145
+ ``` java
146
+ package com.example.iotdemo;
147
+
148
+ import android.os.Bundle;
149
+ import android.util.Log;
150
+ import androidx.annotation.Nullable;
151
+ import androidx.appcompat.app.AppCompatActivity;
152
+
153
+ import com.tencent.liteav.iot.TXIoTError;
154
+ import com.tencent.liteav.iot.TXIoTMonitorSession;
155
+ import com.tencent.rtmp.ui.TXCloudVideoView;
156
+
157
+ public class MonitorActivity extends AppCompatActivity {
158
+
159
+ private static final String TAG = "MonitorActivity";
160
+
161
+ private TXIoTMonitorSession mMonitorSession;
162
+ private TXCloudVideoView mVideoView;
163
+
164
+ private final TXIoTMonitorSession.Listener mListener = new TXIoTMonitorSession.Listener() {
165
+ @Override
166
+ public void onMonitorBegin(TXIoTMonitorSession.Option option, String customData) {
167
+ Log.i(TAG, "onMonitorBegin, customData=" + customData);
168
+ // 开启摄像头采集并推流,同时本地预览
169
+ int ret = mMonitorSession.openCamera(option, mVideoView);
170
+ if (ret != TXIoTError.SUCCESS) {
171
+ Log.e(TAG, "openCamera failed: " + ret);
172
+ }
173
+ // 开启麦克风采集并推流
174
+ ret = mMonitorSession.openMicrophone();
175
+ if (ret != TXIoTError.SUCCESS) {
176
+ Log.e(TAG, "openMicrophone failed: " + ret);
177
+ }
178
+ }
179
+
180
+ @Override
181
+ public void onMonitorSwitch(TXIoTMonitorSession.VideoQuality quality) {
182
+ Log.i(TAG, "onMonitorSwitch, quality=" + quality);
183
+ int ret = mMonitorSession.switchVideoQuality(quality);
184
+ if (ret != TXIoTError.SUCCESS) {
185
+ Log.e(TAG, "switchVideoQuality failed: " + ret);
186
+ }
187
+ }
188
+
189
+ @Override
190
+ public void onMonitorEnd() {
191
+ Log.i(TAG, "onMonitorEnd");
192
+ mMonitorSession.closeCamera();
193
+ mMonitorSession.closeMicrophone();
194
+ }
195
+
196
+ @Override
197
+ public void onPTZCommandReceived(TXIoTMonitorSession.PTZCommand command, int speed) {
198
+ Log.i(TAG, "onPTZCommandReceived, command=" + command + ", speed=" + speed);
199
+ // 仅支持云台的设备需实现,驱动云台电机执行对应动作
200
+ }
201
+ };
202
+
203
+ @Override
204
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
205
+ super.onCreate(savedInstanceState);
206
+ setContentView(R.layout.activity_monitor);
207
+ mVideoView = findViewById(R.id.video_view);
208
+
209
+ // 前提:SDK 已完成初始化并登录成功(参见「登录与注册」)
210
+ mMonitorSession = TXIoTMonitorSession.getInstance();
211
+ mMonitorSession.addListener(mListener);
212
+
213
+ Log.i(TAG, "monitor session ready, waiting for monitor request from app...");
214
+ }
215
+
216
+ @Override
217
+ protected void onDestroy() {
218
+ // 释放资源
219
+ mMonitorSession.closeCamera();
220
+ mMonitorSession.closeMicrophone();
221
+ mMonitorSession.removeListener(mListener);
222
+ super.onDestroy();
223
+ }
224
+ }
225
+ ```
226
+
227
+ ## 常见问题
228
+
229
+ |现象|排查建议|
230
+ |---------|---------|
231
+ |发起监控查看后,设备端未收到 `onMonitorBegin`|确认设备已成功登录;确认已通过 `addListener` 注册监听器且未在收到回调前被 `removeListener` 移除。|
232
+ |APP 端看不到监控画面|确认已在 `onMonitorBegin` 中调用 `openCamera` 且返回 `TXIoTError.SUCCESS`;确认已获得 `CAMERA` 运行时权限;确认摄像头未被其他应用占用。|
233
+ |APP 端听不到声音|确认已调用 `openMicrophone` 且返回 `TXIoTError.SUCCESS`;确认已获得 `RECORD_AUDIO` 运行时权限。|
234
+ |切换清晰度后,设备端未收到 `onMonitorSwitch`|确认设备已成功登录且监听器已注册;确认监控会话已建立(`onMonitorBegin` 已触发)。|
235
+ |收到 `onMonitorSwitch` 回调但画面清晰度未变化|确认在回调中调用了 `switchVideoQuality` 且返回 `TXIoTError.SUCCESS`;确认传入的 `quality` 与回调携带的值一致。|
236
+ |监控结束后摄像头/麦克风仍被占用|确认在 `onMonitorEnd` 回调及页面销毁(`onDestroy`)时调用了 `closeCamera` 与 `closeMicrophone` 释放采集资源。|
237
+