简体   繁体   English

乐山支持ObjLink吗?

[英]Does Leshan support ObjLink?

I am trying to create my composite LWM2M object by using objlink type.我正在尝试使用 objlink 类型创建我的复合 LWM2M 对象。

For Leshan , the only source on how to write the spec file in JSON seems to be the official oma-objects-spec.json , which does not contain examples of objlinks.对于乐山,关于如何在 JSON 中编写规范文件的唯一来源似乎是官方的oma-objects-spec.json ,其中不包含 objlink 的示例。

Can anyone provide an example on how to create an objlink object?任何人都可以提供有关如何创建 objlink 对象的示例吗? If it is not possible in Leshan, have anyone tried other implementations?如果在乐山不可能,有没有人尝试过其他实现?

Hope it's not too late.希望现在还不算太晚。

As of now there is no support of OBJLNK in Leshan API.目前乐山 API 不支持 OBJLNK。 I was also needed OBJLNK support in Leshan so i have modified and created a pull request for supporting OBJLNK.我在乐山也需要 OBJLNK 支持,所以我修改并创建了一个 pull request 来支持 OBJLNK。 If you want to have objlnk support can use my branch which is forked from Leshan.如果你想要objlnk支持可以使用我的乐山分叉分支。 https://github.com/DevendraKurre/leshan https://github.com/DevendraKurre/leshan

Leshan has added support to this feature.乐山增加了对该功能的支持。 I have tested it with version 0.1.11-M14.我已经用 0.1.11-M14 版本对其进行了测试。

Reading can be done as usual, and writing is done as follows.阅读可以照常进行,写作如下进行。

WriteRequest writeReq = new WriteRequest(
                          WriteRequest.Mode.UPDATE,
                          9, 0,
                          LwM2mSingleResource.newObjectLinkResource(
                            13, 
                            new ObjectLink(5566, 7788)
                          )
                        );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM