float getTemperature() { //模拟从传感器读取数据 temperature = new Random().nextInt(100); return temperature; }
float getTemperature() { //模拟从传感器读取数据 temperature = new Random().nextInt(100); return temperature; }
closeCallBack) return true } catch (error) { console.log('connect to mqtt broker failed. err ' + error) } return false } function
@Reflect.metadata("Property", { name: "temperature", writeable: false }) private _temperature: number = 10; 定义服务的命令。设备收到平台下发的命令时,SDK会自动调
板”。本示例演示使用的鉴权模板与系统默认鉴权一致。 图2 自定义鉴权-创建鉴权模板 模板整体内容如下: { "template_name": "system-default-auth", "description": "华为云IoTDA系统默认鉴权模板示例", "status":
%s, the payload is %s \n", topicName, message->payload); return 1; //can not return 0 here, otherwise the message won't update or something wrong
does not have the permission"报错。您可以参考如下步骤为IAM用户所在的用户组授予IoTDA FullAccess预置系统策略权限。 操作步骤: 访问统一身份认证服务IAM,单击“立即使用”进入IAM服务控制台。 单击左侧导航栏的“用户组”。在用户组列表单击该IAM用户所在的用户组右侧的“授权”。
var level = dataView.getInt16(0); //从码流中获取temperature值 var temperature = dataView.getInt16(2); //转换为属性上报的JSON格式
Topic说明 设备使用MQTT协议接入时,可通过Topic实现消息的发送和接收。 以$oc开头的topic是IoTDA预置的系统topic。您可以在允许的情况下订阅和发布到这些系统预置的Topic;具体Topic列表和功能说明可参考Topic定义。 您可以创建非$oc 开头的topic进行自定义消息的发送和接收。
/// 创建Connection /// </summary> /// <returns>Connection</returns> static Connection CreateConnection() {
软固件包上传 概述 软件(Software)一般分为系统软件和应用软件,系统软件实现设备最基本的功能,比如编译工具、系统文件管理等;应用软件可以根据设备的特点,提供不同的功能,比如采集数据、数据分析处理等。软件升级又称为SOTA(SoftWare Over The Air),是指
上传的产品模型的压缩文件不是zip格式的。 解决方法 检查产品模型文件的名称是否符合deviceType_manufacturerId_model.zip的格式,并检查“deviceType”、“manufacturerId”、“model”三个字段是否和devicetype-capability.json中的定义一致。
"desired" : { "temperature" : "60" }, "version" : 1 } ] } 删除设备影子预期数据,将设备影子中属性temperature的期望值删除。 PUT https://{endpoint}/v
持的命令,进行功能调试及问题定位,从而方便地实现设备管理及远程运维。下面介绍远程登录的具体使用方法。 前提条件 设备使用的是linux操作系统; 设备上已安装SSH Server 应用; 设备已集成物联网平台官方SDK(IoT Device SDK C v1.1.1及以后版本),请参考(IoT
“temperature”大于80的数据。 您也可以使用模拟器模拟设备订阅Topic: “$oc/devices/{device_id}/sys/properties/report”(其中{deviceId}需要替换成实际设备ID)后,上报“temperature”大于80的数据
this.options = options; } public String getId() { return options.getClientId(); } public void initialize() throws Exception
考创建产品、注册单个设备或批量注册设备。 准备工作 访问Microsoft官网,选择合适系统的版本下载Microsoft Visual Studio。(本文以windows 64-bit系统,Microsoft Visual Studio 2017和.NET Framework 4
必选/可选 类型 参数描述 service_id 必选 String 参数解释: 系统字段。 取值范围: 固定为:"$time_sync"。 event_type 必选 String 参数解释: 系统字段。 取值范围: 固定为:"time_sync_request"。 event_time
Instance-Id: ******** { "shadow" : [ { "desired" : { "temperature" : "60" }, "service_id" : "WaterMeter", "version" : 1
ServiceEvent定义表 字段名 必选/可选 类型 参数描述 service_id 必选 String 参数解释: 系统字段,固定为:"$ota"。 event_type 必选 String 参数解释: 系统字段,固定为:"upgrade_progress_report"。 event_time 可选
您即将访问非华为云网站,请注意账号财产安全