> -----Original Message----- > From: iotivity-dev-bounces at lists.iotivity.org [mailto:iotivity-dev- > bounces at lists.iotivity.org] On Behalf Of Thiago Macieira > Sent: Thursday, November 10, 2016 7:39 AM > To: iotivity-dev at lists.iotivity.org > Subject: Re: [dev] Question BLE server > > On quinta-feira, 10 de novembro de 2016 03:01:45 CST Sen Senthuran wrote: > > I have a BLE sensor, does not run IoTivity. Is it possible to register > > that resource (BLE sensor) with a Ubuntu PC that is running ?simpleserver? > > example through BLE connectivity adaptor? > > If the sensor is not using IoTivity or the OCF protocol, then talking to that > sensor is out-of-scope for OCF. IoTivity has plugins to talk to other devices. > > If your sensor uses a protocol that is not one of those for which IoTivity > has a > plugin, you'll need to write it yourself. IoTivity's CA adaptor for BLE is > not to > be used, you should write your own BLE code.
You may also be interested in how we expose non-IoTivity BLE sensors as OCF servers in our SmartHome-Demo (https://01.org/smarthome). We have a couple of those in the repo: * Environmental sensor (using GATT ESS [1]): https://github.com/01org/SmartHome-Demo/blob/master/ocf-servers/js-servers/environmental_sensor.js * Power Meter (using a BLE custom service): https://github.com/01org/SmartHome-Demo/pull/53 (note: this is the link to the PR that we are reviewing at the moment, as soon as it gets merged, the final version will be in https://github.com/01org/SmartHome-Demo/blob/master/ocf-servers/js-servers/power-uart.js). This may (or may not) help you depending on what you want to achieve. If your objective is to expose your BLE sensor as an OCF server in the network, then this is one (easy) solution. The dependencies to be installed on your Ubuntu PC are: * iotivity (we use 1.1.1 at the moment) * iotivity-node * node.js * noble (BLE module for node.js) I hope this helps, let me know if you have any questions. Geoffroy [1] GATT Environmental Sensing Service: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.environmental_sensing.xml