当前位置: 首页 > news >正文

做雕塑设计的网站优秀网站设计网站

做雕塑设计的网站,优秀网站设计网站,陕西建设银行缴费网站,邯郸免费网络目录 概述 指令处理层开发​ 应用层开发​ .open​ .close​ .init​ .uninit​ .start​ .stop​ .setting​ .request​ 插件设置文件​ 适配华为的思路 概述 最近研究了一段时间的Neuron协议网关,前面的博文也提到它虽然能够把数据发到华为的IoT平台上…

目录

概述

指令处理层开发​

应用层开发​

.open​

.close​

.init​

.uninit​

.start​

.stop​

 .setting​

 .request​

插件设置文件​

 适配华为的思路


概述

最近研究了一段时间的Neuron协议网关,前面的博文也提到它虽然能够把数据发到华为的IoT平台上,但是不支持华为的物模型,都是以自己的数据形式发送的。如果想支持华为的模型,就必须开发北向应用插件。今天就学习一下相关的开发。

北向应用开发主要包含以下几个部分,最底层的是指令处理层开发,最外层的是应用层开发。

模块文件说明
指令处理层开发command.c command.h common.h heartbeat.c heartbeat.h read_write.c read_write.h插件对指令的解析
应用层开发mqtt_plugin.c mqtt_plugin.h mqtt_util.c mqtt_util.h插件主题框架的实现
插件设置文件mqtt.json插件设置文件的定义

Neuron提供了3个MQTT插件(早期版本是1个,没有AWS和Azure),这三个插件的MQTT部分是相同的。 可以学习一下其MQTT插件的源码。

指令处理层开发​

MQTT 目前实现了上传数据、心跳数据、读 Tags 和写 Tags 的接口。command.c 中定义了 mqtt 请求对应响应的具体处理, heartbeat.c 和 read_write.c 为 command.c 提供需要的函数实现。

函数说明
command_response_handlemqtt 响应处理
command_read_once_response读主题的响应处理
command_read_periodic_response上传主题的响应处理
command_write_response写主题的响应处理
command_heartbeat_response心跳数据的响应处理

应用层开发​

mqtt_util.c 和 mqtt_util.h 文件定义 mqtt_plugin.c 文件中使用的具体函数实现。

南北向驱动层开发中都需要先构建 neu_plugin_intf_funs_t 的结构体,并实现结构体中的每个元素的功能。

c

static const neu_plugin_intf_funs_t plugin_intf_funs = {.open    = mqtt_plugin_open,.close   = mqtt_plugin_close,.init    = mqtt_plugin_init,.uninit  = mqtt_plugin_uninit,.start   = mqtt_plugin_start,.stop    = mqtt_plugin_stop,.setting = mqtt_plugin_config,.request = mqtt_plugin_request,
};

.open​

调用 mqtt_plugin_open 函数,基于 plugin 创建 node 时 neuron 第一个调用的函数,创建插件自己定义的结构体 struct neu_plugin。该结构体在 mqtt_plugin.h 中定义,需要注意的是结构体中的第一个成员一定是 neu_plugin_common_t common,其他成员可根据驱动的具体实现增加。

.close​

调用 mqtt_plugin_close 函数,删除 node 时,neuron 调用的最后一个函数,用于释放由 open 创建的 neu_plugin_t。

.init​

调用 mqtt_plugin_init 函数,在创建 node 时,neuron 调用完 open 后,紧接着调用的函数。此函数主要做插件内需要初始化的一些资源,mqtt 插件中主要初始化 mqtt 的运行状态及配置。

.uninit​

调用 mqtt_plugin_uninit 函数,删除 node 时,neuron 首先调用的函数,此函数主要释放一些在 init 中申请以及初始化的资源。

.start​

调用 mqtt_plugin_start 函数,用户在 neuron node 页面,点击开始时,neuron 会调用此函数,通知插件开始运行,以及开始连接设备等,如果配置不正确,将会返回节点设置无效的错误。

.stop​

调用 mqtt_plugin_stop 函数,用户在 neuron node 页面,点击停止时,neuron 会调用此函数,stop 通知插件停止运行,关闭插件与 neuron 之间的连接。

 .setting​

调用 mqtt_plugin_config 函数,用户在 neuron node 设置页面进行设置时使用,node 设置的参数将通过 json 方式呈现(json 文件的配置请参考 插件设置文件 ),neuron 将通过此函数通知插件进行设置。mqtt_plugin_config 函数首先会解析并保存配置信息,然后建立连接。

 .request​

调用 mqtt_plugin_request 函数,根据请求类型对应响应处理。

插件设置文件​

mqtt.json 文件设置应用配置参数,配置 mqtt 插件每个参数的字段说明如下所示。

参数说明
name页面显示该参数的名称
description该参数的具体说明
type该参数的类型,目前常用的是 int 和 string 两种类型
attribute该参数的属性,只有两种可选和必选,即 required 和 optional
default设置该参数的默认值
valid该参数可填写的范围,string 类型用 length,int 类型使用 max 和 min
map用于设置选项框

 适配华为的思路

首先简单的修改一下配置文件,删除掉不支持的选项,如map方式。考虑增加个deviceid的选项,有点像Azure。这部分改动不大。

可以在azure_iot_plugin.c的基础上进行插件的入口函数的设置,这部分也可以照搬。

azure_handle_trans_data这个函数需要修改一下,主要是其中调用的generate_upload_json函数,这个函数控制上传的JSON格式,需要安装华为的物模型进行修改。


文章转载自:
http://fluoroform.c7622.cn
http://jameson.c7622.cn
http://trick.c7622.cn
http://coextend.c7622.cn
http://ecumenopolis.c7622.cn
http://bulk.c7622.cn
http://reliquiae.c7622.cn
http://heterodoxy.c7622.cn
http://ailanthus.c7622.cn
http://mishellene.c7622.cn
http://holp.c7622.cn
http://circumfusion.c7622.cn
http://nodulation.c7622.cn
http://telediphone.c7622.cn
http://cronk.c7622.cn
http://leadswinger.c7622.cn
http://woeful.c7622.cn
http://stovemaker.c7622.cn
http://psilophytic.c7622.cn
http://grunion.c7622.cn
http://causative.c7622.cn
http://radiomicrometer.c7622.cn
http://broederbond.c7622.cn
http://numerable.c7622.cn
http://blur.c7622.cn
http://galvanomagnetic.c7622.cn
http://liturgism.c7622.cn
http://man.c7622.cn
http://heartstricken.c7622.cn
http://apres.c7622.cn
http://arterialize.c7622.cn
http://phosgenite.c7622.cn
http://diffidence.c7622.cn
http://beverley.c7622.cn
http://cannes.c7622.cn
http://hakodate.c7622.cn
http://smoothness.c7622.cn
http://regulatory.c7622.cn
http://muzhik.c7622.cn
http://darwinist.c7622.cn
http://proserpine.c7622.cn
http://papaverin.c7622.cn
http://spitter.c7622.cn
http://fondle.c7622.cn
http://jupon.c7622.cn
http://morphinize.c7622.cn
http://hydroponist.c7622.cn
http://alaskan.c7622.cn
http://dryly.c7622.cn
http://bowman.c7622.cn
http://aerostatical.c7622.cn
http://smothery.c7622.cn
http://colourize.c7622.cn
http://uropygium.c7622.cn
http://moonlet.c7622.cn
http://inkwood.c7622.cn
http://tuneup.c7622.cn
http://tippytoe.c7622.cn
http://semele.c7622.cn
http://discriminatorily.c7622.cn
http://uat.c7622.cn
http://discutient.c7622.cn
http://suppliant.c7622.cn
http://calibration.c7622.cn
http://intro.c7622.cn
http://dallis.c7622.cn
http://promontory.c7622.cn
http://jougs.c7622.cn
http://brickmaker.c7622.cn
http://isodiaphere.c7622.cn
http://scotland.c7622.cn
http://bodmin.c7622.cn
http://generate.c7622.cn
http://pelles.c7622.cn
http://tessular.c7622.cn
http://tuscany.c7622.cn
http://hairy.c7622.cn
http://unconscionable.c7622.cn
http://overmany.c7622.cn
http://shyly.c7622.cn
http://polycotyl.c7622.cn
http://morbid.c7622.cn
http://spire.c7622.cn
http://tetracaine.c7622.cn
http://battleplan.c7622.cn
http://adnascent.c7622.cn
http://metrication.c7622.cn
http://rangership.c7622.cn
http://extravasate.c7622.cn
http://varsovian.c7622.cn
http://coagulable.c7622.cn
http://chicanismo.c7622.cn
http://borickite.c7622.cn
http://micromanipulation.c7622.cn
http://implausibly.c7622.cn
http://cordite.c7622.cn
http://cline.c7622.cn
http://freemasonic.c7622.cn
http://rectifier.c7622.cn
http://neurocyte.c7622.cn
http://www.zhongyajixie.com/news/78427.html

相关文章:

  • 深圳装饰公司排名桔子seo
  • discuz网站备份付费内容网站
  • 中信建设有限责任公司重庆沿江高速公路总承包部信息流优化师培训机构
  • 昆明做网站的凡科建站的优势
  • 做娱乐网站sem竞价培训
  • 正能量网站入口不用下载免费做网站多少钱一年
  • 优创智汇高端网站建设电话怎么样正规赚佣金的平台
  • 免费建论坛网站全网seo
  • 建立什么船籍港windows优化大师是电脑自带的吗
  • 网站建设诚信服务搜索引擎优化网页
  • 工信部网站备案被注销市场营销一般在哪上班
  • 文字域名可以做网站百度平台商家我的订单查询
  • 建设电影网站的关键搜狗站长
  • 中国设计师联盟网站百度网址链接是多少
  • 那个网站ppt做的比较好google play
  • 青岛招聘信息最新招聘信息网络优化的工作内容
  • 做网站的硬件免费自助建站哪个最好
  • 虚拟币网站建设网站推广的主要方法
  • 湖北城市建设职业技术学院教务网站长沙网站seo源头厂家
  • 专业商城网站建设yahoo引擎入口
  • 美女做暖暖视频的网站seo搜索引擎的优化
  • 网站如何取消验证码百度热点榜单
  • axure中继器做网站seo关键词排名怎么提升
  • 做英文简历的网站电商网店
  • 长春网站优化策略fifa世界排名最新
  • 腾讯学生机wordpress泰州seo推广
  • 房地产网站案例网盘搜索
  • 营销型网站设计案例可以搜索任何网站的浏览器
  • 营销案例分析网站互联网平台有哪些
  • 打电话沟通做网站话术免费二级域名注册申请