Skip to content

Lite API: LWM2M

Gyeonghwan Hong edited this page Dec 21, 2020 · 5 revisions

Parent Document: ANT APIs

LWM2M API takes charge of supporting communications based on LWM2M (LightWeight Machine-To-Machine).

The LWM2M API is composed of LWM2M-client functions and LWM2M-bootstrap-server functions.

Since LWM2M-server is usually used in user devices or server-level devices, ANT framework does not support LWM2M server APIs.

You need to load LWM2M API module before you use its API as following.

var lwm2mAPI = require('lwm2m');

LWM2M Client

LWM2MAPI.createClient()

  • LWM2MClient LWM2MAPI.createClient(void)

LWM2MClient.register()

  • void LWM2MClient.register(String ip, Integer port, Object opts, Function callback)

LWM2MClient.on()

  • void LWM2MClient.on(void)

LWM2M.createSmartObject()

  • SmartObject LWM2M.createSmartObject(void)

SmartObject.init()

  • void SmartObject.init(String oid, String iid, String resrcs, String setup)

LWM2M Bootstrap Server

LWM2MAPI.createBootstrapServer()

  • LWM2MBootstrapServer LWM2MAPI.createBootstrapServer(void)

LWM2MBoostrapServer.on()

  • void LWM2MBootstrapServer.on(String eventType, Function handler)

LWM2MBoostrapServer.configure()

  • void LWM2MBootstrapServer.on(Object serverConfig)

LWM2MBoostrapServer.start()

  • Void LWM2MBootstrapServer.start()