-
Notifications
You must be signed in to change notification settings - Fork 28
Lite API: OCF
Gyeonghwan Hong edited this page Dec 21, 2020
·
7 revisions
Parent Document: ANT APIs
OCF API takes charge of supporting OCF (Open Connectivity Foundation) standard-based communication.
The OCF API is composed of OCF-server functions and OCF-client functions.
You need to load OCF API module before you use its API as following.
var ocfAPI = require('ocf');
There is example applications to implement a OCF server or a OCF client.
apps/ocf_client.js
apps/ocf_server.js
apps/ocf_client_multi.js
apps/ocf_server_multi.js
- OCFAdapter OCFAdapter(void)
- Get the singleton OCF adapter. OCF adapter manages the event loop of a OCF client and a OCF server.
-
Return: OCFAdapter
- Resulting OCFAdapter object
- void OCFAdapter.initialize(void)
- Initialize the OCF adapter. It sets the internal data structures managed by OCF thread.
- void OCFAdapter.deinitialize(void)
- Deinitialize the OCF adapter. It resets the internal data structures managed by OCF thread.
- void OCFAdapter.onPrepareEventLoop(Function handler)
- Set the event handler called when the OCF thread's event loop becomes ready.
- void OCFAdapter.start()
- Start the OCF adapter and launch the OCF thread.
- void OCFAdapter.stop()
- Stop the OCF adapter and terminate the OCF thread.
- void OCFAdapter.setPlatform(String mfgName)
- Set this device's platform type
- String OCFAdapter.getPlatform()
- Get this device's platform type
- void OCFAdapter.addDevice(String URI, String resourceType, String name, String specVersion, String dataModelVersion)
- Add a device resource that this OCF adapter serves
- Array OCFAdapter.getDevices()
- Get the device resources that this OCF adapter is or will be serving
- OCFDevice OCFAdapter.getDevice(Integer index)
- Get a specific device resource that this OCF adapter is or will be serving
- Home
- About
- Getting Started
-
ANT APIs
- ANT Classic API
- ANT Lite API
- Getting Involved