功能介绍 用户可以通过该接口创建隧道(WebSocket协议),应用服务器和设备可以通过该隧道进行数据传输。 该API接口在基础版不支持。 该API调用后平台会向对应的MQTT/MQTTS设备下发隧道地址及密钥,同时给应用服务器也返回隧道地址及密钥,设备可以通过该地址及密钥创建WebSocket协议连接。
withDaysOfWeek("2"); DailyTimerType dailyTimerConditionConditions = new DailyTimerType(); dailyTimerConditionConditions.withTime("19:00")
String。 可能原因 AKSK签名算法与对应集群支持的签名算法不匹配导致 解决方法 访问IoTDA北京四基础版接入地址时,使用的是通用的AKSK签名算法。 访问IoTDA标准版或者企业版的接入地址时,使用的是衍生的AKSK签名算法,需要明确指定使用衍生算法,详情可参考集成应用侧SDK的注释说明。
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
修改设备属性 功能介绍 设备的产品模型中定义了物联网平台可向设备下发的属性,应用服务器可调用此接口向指定设备下发属性。平台负责将属性以同步方式发送给设备,并将设备执行属性结果同步返回,如果设备没有响应,平台会返回给应用服务器超时,平台超时时间是20秒。 注意:此接口适用于MQTT设备,暂不支持NB-IoT设备。
设备的产品模型中定义了物联网平台可向设备下发的命令,应用服务器可调用此接口向指定设备下发命令,以实现对设备的同步控制。平台负责将命令以同步方式发送给设备,并将设备执行命令结果同步返回, 如果设备没有响应,平台会返回给应用服务器超时,平台超时时间是20秒。如果命令下发需要超过20秒,建议采用消息下发。
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
修改调用函数时传递的环境变量,配置环境变量“NA_MOCK_SERVER_ADDRESS”传入函数要推送的HttpServer地址,注意示例中服务器地址非真实服务器地址,请替换成您真实的http服务器地址,填写完成后,单击“保存”,保存配置信息。 图7 配置函数调用环境变量 添加事件源
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
设备的产品模型中定义了平台可向设备设置的属性,平台/应用服务器可通过属性设置的方式修改指定设备的属性值。 平台查询设备属性 平台/应用服务器通过属性查询的方式,实时查询指定设备的属性数据。 平台命令下发 平台/应用服务器按产品模型中定义的命令格式下发控制命令给设备。 平台事件下发 平台/应用服务器按产品模型中定义的事件格式下发事件给设备。
数据转发至Kafka存储 场景说明 对于设备上报的数据,可以选择让平台将设备上报数据推送给应用服务器,由应用服务器进行保存;还可以选择让平台将设备上报数据转发给分布式消息服务(Kafka),由Kafka进行存储。 本示例为将所有设备上报的数据转发至Kafka存储。 购买Kafka实例
0X3RpbWUiOiAiMjAyNDA2MDFUMDAwMDAwWiIsCiAgICAiZXZlbnRfdGltZV9tcyI6ICIyMDI0LTA2LTAxVDAwOjAwOjAwLjAwMFoiLAogICAgInJlcXVlc3RfaWQiOiAiMjEzMWQwNDg
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
status String 消息状态,包含PENDING,DELIVERED,FAILED和TIMEOUT,PENDING指设备不在线,消息被缓存起来,等设备上线之后下发; DELIVERED指消息发送成功;FAILED消息发送失败;TIMEOUT指消息在平台默认时间内(1天)还没有下发
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
您即将访问非华为云网站,请注意账号财产安全