npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@quec/rn-device-module

v1.9.19

Published

设备桥RN扩展组件

Downloads

4

Readme

QuecRNDeviceModule

设备桥组件

类型|版本|适用平台|负责人 -|-|-|- module|1.9.19|all|[email protected]

1.9.19 Changelog:
none

方法

isWebSocketSubscribe

获取当前设备WS订阅通道状态,订阅状态为true,不代表设备在线,只代表app和云端对当前设备进行了订阅

起始版本|适用平台 -|- 1.8.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"subscribe": true/false }

getDeviceConnectingState

获取设备通道连接中状态

起始版本|适用平台 -|- 1.8.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"connectingState": 0/1/2/3/4/5/6/7}onlineStateMaskWS = 1 << 0,onlineStateMaskWifi = 1 << 1,onlineStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

writeDpsByHttp

writeDpsByHttp

起始版本|适用平台 -|- 1.8.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps 确保code和value不为空 [ {id:0, code:"electric" type:BOOL, value:false} ,{id:1, code:"electric2", type:INT, value:2}] 2|deviceList|Array<object>|– deviceList 设备列表 [{"deviceKey":"", "productKey":""}] 3|type|integer|- 类型 1:透传 2:属性 3:服务 4|extraData|object|– {dataFormat 数据类型 1:Hex 2:Text(当type为透传时,需要指定 dataFormat)cacheTime 缓存时间,单位为秒,缓存时间范围 1-7776000 秒,启用缓存时必须设置缓存时间isCache 是否启用缓存 1:启用 2:不启用,默认不启用isCover 是否覆盖之前发送的相同的命令 1:覆盖 2:不覆盖,默认不覆盖,启用缓存时此参数有效查看接口定义} 5|promise|promisecb|回调 callback

readDpsWithExtraData

read data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|promise|promisecb|回调 callback

readDpsWithExtraDataAndMode

read data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 4|promise|promisecb|回调 callback

writeDpsWithExtraData

write data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|promise|promisecb|回调 callback

writeDpsWithExtraDataAndMode

write data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 4|promise|promisecb|回调 callback

getBleState

获取设备通道状态

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"state": 0/1/2}(0: 未开启, 1: 未授权, 2 : 可用)

getTslAndAttrs

获取物模型以及属性值

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycodeList string 非必填 查询的属性标识符gatewayDk string 网关设备的 Device KeygatewayPk string 网关设备的 Product Key和查询类型配合使用,如果查询多个属性,使用英文逗号分隔type string 非必填 查询类型1 查询设备基础属性2 查询物模型属性3 查询定位信息查询类型可以单选和多选,如果需要查询多个类型的属性值,使用英文逗号分隔 2|promise|promisecb|promise 执行回调

readDps

read data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|promise|promisecb|回调 callback

writeDps

write data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|promise|promisecb|回调 callback

readDpsWithMode

read data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 3|promise|promisecb|回调 callback

writeDpsWithMode

write data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 3|promise|promisecb|回调 callback

getOnlineState

获取设备通道状态

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"onlineState": 0/1/2/3/4/5/6/7}onlineStateMaskWS = 1 << 0,onlineStateMaskWifi = 1 << 1,onlineStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

connectChannel

建立通道,(设备会自动根据设备通道能力capabilitiesBitmask建立通道,此API用于手动切换指定通道)

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|mode|integer|– mode 建立通道模式: 0 auto,1: websocket 2:wifi 3:ble注意:1,建立的通通与已连接通道不同时,已连接通道会断开。2,当设备不具备相应通道,建立其不具备的通道会失败。不会再自动建立其他通道

disconnectChannel

断开通道,(

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|type|integer|– type 通道类型,0: 关闭所有通道(关闭wifi和ble), 2:wifi 3:ble

isWebSocketLoginCallback 弃用

获取websocket是否登录成功

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|isLoginCallback|successcb|Func 接受是否登录websocket回调 已登录成功 true 登录失败 false

subscribeDevicesWithList 弃用

订阅设备

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|list|Array<object>|订阅设备列表,订阅结果QuecDeviceServiceWebSocketDelegate返回[{"deviceKey": "1234567890","messageType": ["ONLINE"],"productKey": "p12345"},{"deviceKey": "1234567890","messageType": ["ONLINE","STATUS"],"productKey": "p12345"}]

unSubscribeDevicesWithList 弃用

取消订阅设备

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|list|Array<object>|取消订阅设备列表,取消订阅结果QuecDeviceServiceWebSocketDelegate返回[{"deviceKey": "1234567890","productKey": "p12345"},{"deviceKey": "1234567890","productKey": "p12345"}]

sendDataToDeviceByWebSocketWithDataDict 弃用

获取设备业务属性值

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|发送数据,需要在delegate的websocketDidOpen回调之后才能调用透传{"cmd": "send","data": {"cacheTime": 3600,"dataFormat": "Text","deviceKey": "866123456789015","isCache": true,"productKey": "p12345","raw": "123456","type": "RAW"}}物模型{"cmd": "send","data": {"deviceKey": "1234567890","kv": "[{"id":5,"name":"openapi","type":"BOOL","value":"true"}]","productKey": "p12345","type": "WRITE-ATTR"}}

getDeviceListWithPageNumber 弃用

获取设备列表

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|pageNumber|integer|number 页码 2|pageSize|integer|number 页大小 3|promise|promisecb|promise 执行回调callback {"data": {"list" : [], "total" : 12}}

getProductTSLWithProductKey 弃用

获取设备业务物模型属性值

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycodeList string 非必填 查询的属性标识符gatewayDk string 网关设备的 Device KeygatewayPk string 网关设备的 Product Key和查询类型配合使用,如果查询多个属性,使用英文逗号分隔type string 非必填 查询类型1 查询设备基础属性2 查询物模型属性3 查询定位信息查询类型可以单选和多选,如果需要查询多个类型的属性值,使用英文逗号分隔 2|promise|promisecb|promise 执行回调

getDeviceBusinessAttributesWithProductKey 弃用

获取设备业务属性值

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycodeList string 非必填 查询的属性标识符和查询类型配合使用,如果查询多个属性,使用英文逗号分隔type string 非必填 查询类型1 查询设备基础属性2 查询物模型属性3 查询定位信息查询类型可以单选和多选,如果需要查询多个类型的属性值,使用英文逗号分隔 2|promise|promisecb|promise 执行回调

updateDeviceNameByShareUserWithDeviceName 弃用

更改分享设备名称

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceName|string|string 设备名称 2|shareCode|string|string 分享码 3|promise|promisecb|promise 执行回调

updateDeviceName 弃用

更改分享设备名称

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceName|string|string deviceName 2|productKey|string|string product key 3|deviceKey|string|string deviceKey 4|promise|promisecb|promise 执行回调

getGatewayDeviceChildListWithParams 弃用

查询网关设备下子设备列表

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|deviceKey string 必传 网关设备deviceKeyproductKey string 必传 网关设备productKeypageNumber number 必传 页码pageSize number 必传 页大小 2|promise|promisecb|promise 执行回调callback {"data": {"list" : [], "total" : 12}}

unbindDeviceWithDeviceKey 弃用

设备解绑

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceKey|string|string device key 2|productKey|string|string product key 3|promise|promisecb|promise 执行回调

unShareDeviceByShareUserWithShareCode 弃用

设备解绑

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|shareCode|string|string 分享码 2|promise|promisecb|promise 执行回调

getPropertyChartListWithParams

获取设备属性图表列表

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey 产品keydeviceKey 设备keystartTimestamp 开始时间(毫秒时间戳)endTimestamp 结束时间(毫秒时间戳)attributeCode 物模型属性标识符,查询多个属性时使用英文逗号分隔gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeycountType 聚合类型(默认3):1-最大值 2-最小值 3-平均值 4-差值 5-总值timeGranularity 统计时间粒度(默认2):1-月 2-日 3-小时 4-分钟 5-秒callback {"data": []} 2|promise|promisecb|promise 执行回调

getDeviceShareUserListWithDeviceKey

获取设备分享人列表

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceKey|string|string 设备名称 2|productKey|string|string 产品key 3|promise|promisecb|promise 执行回调

setShareInfoByOwnerWithDeviceKey

分享人设置分享信息

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|deviceKey string 设备keyproductKey string 产品keyacceptingExpireTime number 分享二维码种子失效时间 时间戳(毫秒),表示该分享在此时间戳时间内没有使用,会失效coverMark number 覆盖标志:1 直接覆盖上条有效分享(默认)(覆盖原有的分享码);2 直接添加,允许多条并存;3 只有分享时间延长了,才允许覆盖上条分享isSharingAlwaysValid bool 设备是否永久有效sharingExpireTime number 设备使用到期时间 时间戳(毫秒),表示该分享的设备,被分享人可以使用的时间,isSharingAlwaysValid为YES时该参数无效 2|promise|promisecb|promise 执行回调

unShareDeviceByOwnerWithShareCode

分享人取消分享

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|shareCode|string|string 分享码 2|promise|promisecb|promise 执行回调

getLocationHistoryWithParams

获取设备历史轨迹

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey 产品keydeviceKey 设备keystartTimestamp 开始时间(毫秒时间戳)endTimestamp 结束时间(毫秒时间戳)gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeylocateTypes 定位类型(默认查询所有类型的定位),查询多种定位时使用英文逗号分隔GNSS-全球导航卫星系统GPS-美国导航定位系统GL-俄罗斯格洛纳导航定位系统GA-欧盟伽利略卫星导航系统BD/PQ-中国导航定位系统LBS-基于通信运营商的基站定位系统 2|promise|promisecb|

getDeviceInfoByDeviceKey

获取设备信息

起始版本|适用平台 -|- 1.2.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceKey|string|string 设备key 2|productKey|string|string 产品key 3|promise|promisecb|promise 执行回调

getPropertyDataListWithParams

获取设备属性信息

起始版本|适用平台 -|- 1.2.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey 产品keydeviceKey 设备keystartTimestamp 开始时间(毫秒时间戳)endTimestamp 结束时间(毫秒时间戳)attributeCode 物模型属性标识符,查询多个属性时使用英文逗号分隔gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeypageNumber 当前页,默认为第 1 页pageSize 页大小,默认为 10 条 2|promise|promisecb|promise 执行回调

getPropertyStatisticsWithParams

获取设备属性环比统计数据

起始版本|适用平台 -|- 1.2.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey 产品keydeviceKey 设备keycurrentTimestamp 当前时间(毫秒时间戳attributeCode 物模型属性标识符,查询多个属性时使用英文逗号分隔gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeycountType 聚合类型(默认3):1-最大值 2-最小值 3-平均值 4-差值 5-总值timeGranularities 统计时间粒度,查询多个粒度时使用英文逗号分隔(默认1):1-日 2-周 3-月 4-年callback {"data": []} 2|promise|promisecb|promise 执行回调

getDeviceInfoByShareCode

通过分享码查询设备信息

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|shareCode|string|分享码 2|promise|promisecb|回调

getDeviceListByDeviceName

获取设备列表-根据设备名称搜索

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceName|string|设备名称 2|pageNumber|integer|number 页码 3|pageSize|integer|number 页大小 4|promise|promisecb|回调 callback {"data": {"list" : [], "total" : 12}}

bindDeviceBySerialNumber

通过SN绑定设备

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|serialNumber|string|string 设备SN码 2|productKey|string|string 产品key 3|deviceName|string|string 设备名称 4|promise|promisecb|回调 callback

bindDeviceByAuthCode

通过authCode绑定设备 可用于wifi/wifi+蓝牙设备绑定

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|Map 包含以下属性authCode string 设备authCodeproductKey string 产品keydeviceKey string 设备keydeviceName string 设备名称 2|promise|promisecb|回调 callback

bindDeviceByPSWAuthCode

通过authCode + password绑定设备 可用于蓝牙设备绑定

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|Map 包含以下属性authCode string 设备authCodeproductKey string 产品keydeviceKey string 设备keypassword string 设备passworddeviceName string 设备名称 2|promise|promisecb|回调 callback

getFetchPlanWithProductKey

查询设备升级信息

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|string 产品key 2|deviceKey|string|string 设备key 3|params|object|map 其他信息 非必传batteryLevelLimit number 设备剩余电量百分比mcuVersions array 固件信息 componentNo string 升级组件标识 version string 升级组件版本minSignalIntensity number 设备最小信号量 dbMmoduleVersion string 模组版本upgradeTime number 升级时间时间戳,默认为当前时间戳useSpace number 所需磁盘空间,KB{'batteryLevelLimit':1, 'mcuVersions':[{'componentNo': '', 'version': ''}], 'minSignalIntensity':1, 'moduleVersion':'', 'upgradeTime':1, 'useSpace':1} 4|promise|promisecb|回调 callback

reportDeviceUpgradeStatusWithProductKey

上报设备升级信息

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycomponentNo string 升级固件标识reportStatus number 升级状态 0 - 1 2 2|promise|promisecb|回调 callback

sendDataToDevicesByHttpWithData

设备批量控制

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|Mapdata 遵循tsl格式的json string [{"id":62,"value":99,"type":"INT","name":"温度(temp)"},{"id":63,"value":"true","type":"BOOL","name":"开关机状态(powerstate)"}]deviceList 设备列表 [{"deviceKey":"", "productKey":""}]type number 类型 1:透传 2:属性 3:服务dataFormat number 数据类型 1:Hex 2:Text(当type为透传时,需要指定 dataFormat)cacheTime number 非必传 缓存时间,单位为秒,缓存时间范围 1-7776000 秒,启用缓存时必须设置缓存时间isCache number 非必传 是否启用缓存 1:启用 2:不启用,默认不启用isCover number 非必传 是否覆盖之前发送的相同的命令 1:覆盖 2:不覆盖,默认不覆盖,启用缓存时此参数有效 2|promise|promisecb|回调 callback

addCornJob

创建定时任务

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey – string 必传 产品keydeviceKey – string 必传 设备keytype – string 必传 定时任务类型,once: 执行一次,day-repeat: 每天重复,custom-repeat: 自定义重复,multi-section: 多段执行,random: 随机执行,delay: 延迟执行(倒计时)timers:[{action – string 必传 定时任务执行的命令,格式:物模型的 json 字符串,time – string 非必传 执行时间,格式为 HH:mm:ss, 当 type = once || day-repeat || custom-repeat ||multi-section 时必填,startTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"endTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"delay – number 非必传 延迟执行时间,单位为秒, 当 type = delay 时必填,单位为 s}]enabled – 定时任务状态:false-停止(默认) true-启动dayOfWeek – string 非必传 周几执行:1-周一 2-周二 3-周三 4-周四 5-周五 6-周六 7-周日, 可以多选,传多个值时使用英文逗号分隔, 当 type = custom-repeat || multi-section || random 时必填 2|promise|promisecb|回调 callback {"data": {}}

setCronJob

修改定时任务

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey – string 必传 产品keydeviceKey – string 必传 设备keyruleId – string 必传 规则唯一标识,修改规则实例信息时必填type – string 必传 定时任务类型,once: 执行一次,day-repeat: 每天重复,custom-repeat: 自定义重复,multi-section: 多段执行,random: 随机执行,delay: 延迟执行(倒计时)timers:[{action – string 必传 定时任务执行的命令,格式:物模型的 json 字符串,time – string 非必传 执行时间,格式为 HH:mm:ss, 当 type = once || day-repeat || custom-repeat ||multi-section 时必填,startTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"endTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"delay – number 非必传 延迟执行时间,单位为秒, 当 type = delay 时必填,单位为 s}]enabled – 定时任务状态:false-停止(默认) true-启动dayOfWeek – string 非必传 周几执行:1-周一 2-周二 3-周三 4-周四 5-周五 6-周六 7-周日, 可以多选,传多个值时使用英文逗号分隔, 当 type = custom-repeat || multi-section || random 时必填 2|promise|promisecb|回调 callback {"data": {}}

getCronJobList

查询设备下定时任务列表

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey – string 必传 产品keydeviceKey – string 必传 设备keytype – string 必传 定时任务类型,once: 执行一次,day-repeat: 每天重复,custom-repeat: 自定义重复,multi-section: 多段执行,random: 随机执行,delay: 延迟执行(倒计时)page – number 分页页码,默认: 1pageSize – number 分页大小,默认: 10 2|promise|promisecb|回调 callback {"data": {"list" : [], "total" : 12}}

getCronJobInfo

查询定时任务详情

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|ruleId|string|– string 必传 定时任务ID 2|promise|promisecb|回调 callback {"data": {}}

batchDeleteCronJob

批量删除定时任务

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|– {ruleIdList:[] String[] 必传 定时任务ID} 2|promise|promisecb|回调 callback {"data": {}}

getProductCornJobLimit

查询产品下定时任务限制数

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|– string 必传 产品key 2|promise|promisecb|回调callback {"data": {}}

openWebSocket

打开websocket

起始版本|适用平台 -|- 1.3.0|all

closeWebSocket

关闭websocket

起始版本|适用平台 -|- 1.3.0|all

getProductTSLWithCacheByProductKey

查询产品的tls模型

起始版本|适用平台 -|- 1.5.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|param|object|-{productKey:String } --必传 2|promise|promisecb|-{callback:{data:{}}

listDeviceEvent

门锁事件日志

起始版本|适用平台 -|- 1.9.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|{codeList:["",""],productKey:"",deviceKey:"",startTime:long,endTime:long,pageNumber:1,pageSize:10} 2|promise|promisecb|

unShareDeviceByShareUserWithShareCodeIpc 弃用

设备解绑

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.9.6|all

序号|参数名|参数类型|描述 -|-|-|- 1|pk|string|string 产品id 2|dk|string|string 设备id 3|shareCode|string|string 分享码 4|promise|promisecb|promise 执行回调

事件

onDeviceConnectingState

设备链路连接状态状态通知

起始版本|适用平台 -|- 1.8.0|all

参数类型|描述 -|- object|事件数据 {"connectingState": 0/1/2/3/4/5/6/7}connectingStateMaskWS = 1 << 0,connectingStateMaskWifi = 1 << 1,connectingStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

onDeviceOnlineState

设备在离线状态通知

起始版本|适用平台 -|- 1.4.0|all

参数类型|描述 -|- object|事件数据 {"onlineState": 0/1/2/3/4/5/6/7}onlineStateMaskWS = 1 << 0,onlineStateMaskWifi = 1 << 1,onlineStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

onDeviceDpsUpdate

设备dps更新

起始版本|适用平台 -|- 1.4.0|all

参数类型|描述 -|- object|事件数据 {type: (1:ws 2: wifi 3: ble,)pk: "xxxx",dk: "xxxx","dps": [{id: 0, type:BOOL, value, true/false},{id: 1, type:INT, value, 1}, ...]}

onDeviceInfoUpdate

设备信息更新

起始版本|适用平台 -|- 1.4.0|all

参数类型|描述 -|- object|事件数据

onWebSocketDidOpen

WebSocket 已打开事件

起始版本|适用平台 -|- 1.0.0|all

参数类型|描述 -|- object|事件数据 data = {"code":"this is code", @"message":" this is reason"}reminder.data = {}

onWebSocketDidError

WebSocket 错误事件

起始版本|适用平台 -|- 1.0.0|all

参数类型|描述 -|- object|事件数据 data = {"code":"this is code", @"message":" this is reason"}

onWebSocketDidReceiveMessage

WebSocket 消息事件

起始版本|适用平台 -|- 1.0.0|all

参数类型|描述 -|- object|事件数据object.data = {"cmd": "message","data": {"createdAt": 1609316592000,"data": {"value": 1},"deviceKey": "866123456789015","productKey": "123456","ticket": "5f9924d171977c33bc5ad1b1","type": "ONLINE"}}error{cmd = error;data = {code = 4010;msg = "user not logged in";reqMsg = "";};