Giter Club home page Giter Club logo

jetlinks-official-protocol's Introduction

JetLinks 官方设备接入协议

JetLinks官方实现的设备接入协议,可用于参考实现自定义协议开发.

注意: 本协议仅用于参考自定义协议开发,在实际使用中请根据不同的场景进行调整.如认证方式,加密等.

MQTT

查看TOPIC说明

用户名密码可以使用生成工具进行生成

HTTP

HTTP接入时需要使用Bearer 认证,URL和MQTT的接入Topic一致.

POST /{productId}/{deviceId}/properties/report
Authorization: Bearer {产品或者设备中配置的Token}
Content-Type: application/json

{
 "properties":{
   "temp":38.5
 }
}

TCP

报文格式说明:

第0-4字节对应的32位整型值为接下来报文的长度,

后续为报文数据, 具体报文格式见: 二进制格式说明

创建连接后第一个数据包需要发送认证包, 密钥需要在产品-设备接入或者设备详情中进行配置

UDP

报文格式说明:

0字节表示认证类型,目前固定为0x00.

1-n字节为密钥信息,编码使用STRING见: 数据类型定义

密钥需要在产品-设备接入或者设备详情中进行配置

后续为报文数据,具体报文格式见: 二进制格式说明

UDP无需发送认证包,但是需要每个报文中都包含密钥信息.

除了ACK以外,其他平台下发的指令也都会包含认证密钥信息,用于设备侧校验请求.

测试

可以使用模拟器进行模拟测试

jetlinks-official-protocol's People

Contributors

zhou-hao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.