自动化BLE服务器将数据发送到BLE Central

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
vishnuatdialog
Offline
最后一次露面:8 months 2 weeks ago
加入:2017-07-25 07:44
自动化BLE服务器将数据发送到BLE Central

Hello Dialog,
我们已将IMU传感器集成在I2C上的DA14585,这是成功的。之后,我们为IMU传感器(ACC,GYRO,TEMP)创建了新的特性,并通过使用控制点特性(0x01)发送触发来读取NRF连接应用上的所有传感器特性值。对于开发此应用程序,我们使用了BLE_PERIALIAL示例。
Now we want to read the same data using BLE central device, this we want to do without the sending any trigger. Like, when the BLE central connected to the BLE server it should send sensor data automatically without any external trigger. Is this possible with the available stack if so tell us what modification we should perform in the ble_peripherial example?

Thank you
D.Vishnu.

Keywords:
Device:
mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi vishnuatdialog,

Hi vishnuatdialog,

So you would like to create a central application based on the 585 device and as soon as the device is connected to a central it should start reading data from the peripheral or the peripheral notifying the central device with the updated values ? If that is the case then the project that you request is quite more than a simple mod for the ble_app_peripheral. In order to implement that you will have to take a empty project configure the stack as a central, issue a scanning command and upon receiving the proper advertising string you can issue a connection requet. After the connection is estblished you will have to discover all the characteristics available on the peripheral side. That means that you will have to create a central profile that will perform a discovery procedure that will support the custom profile on the peripheral side and as soon as the discovery procedure is completed (and the central is aware of all the characteristics supported on that specific peripheral) start issuing reading commands (in case you would like the central to read data from the peripheral) or you should write to the CCC descriptors of the peripheral (in case the characteristics are notifyable) so that the peripheral would start sending data to the central. For implementing a custom central profile there is no document or tutorial or a simple example, but you can take the DSPS demo as a reference (the host side) in order to implement something quite similar, a device that will perform a discovery and start communicating with a central.

谢谢mt_dialog.

vishnuatdialog
Offline
最后一次露面:8 months 2 weeks ago
加入:2017-07-25 07:44
Hello Dialog,

Hello Dialog,
以上,上面解释的是(客户端和服务器)的情况下基于DA14585。
But, In my case
BLE Server(peripheral) is (DA14585 + IMU sensor)
BLE Client(Central) is (CC2650 ) not DA14585 based.
As of above case, I don't want to implement a triggering in BLE client. Whenever the BLE client is connected to the BLE server without triggering I want to read the data. For this, I want to make changes in the BLE_peripheral code automated, not in the BLE client code.
Is it possible to read the data from BLE server(peripheral) without writing 0x01 to control point(triggering)?

Thank you
D.Vishnu.

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi vishnuatdialog,

Hi vishnuatdialog,

读取过程是一个命令,只有中央可以启动而不是外围设备,在BLE中,外围设备启动数据传输的唯一方法是通过通知来启动数据传输,这意味着您必须使您的特性通知。同样为了使中央从外设获取通知,它必须对通知特性执行写入请求,以便启用通知。因此,它不强制写入控制点,即BLE_APP_PERITWAL具有(控制点只是启用将触发通知的发送的计时器),但必须启用CCC在您想要发送其值的特征上。例如,当使用ble_app_peripheral时需要执行两个写入,以便从外围设备开始获取数据,一个是控制点,另一个写入是启用ADC特性的CCC,稍后是客户端的强制性获取您可以在相应回调的连接时启动触发的通知。

谢谢mt_dialog.

vishnuatdialog
Offline
最后一次露面:8 months 2 weeks ago
加入:2017-07-25 07:44
Hello Dialog,

Hello Dialog,
But, when I have used the nRFconnect app as a BLEcentral I wrote only to the control point(0x01) and then press the notification enabled arrow followed by pressing read arrow to receive the peripheral data. I didn't write any external command to enable CCC from the app to read the ADC Value.
我如何启用CCC的特点s this performed by code or should we do this by using BLE Central?
最后有可能接收外围数据而不从BLE Central写入任何命令?

Thank you
D.Vishnu.

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi vishnuatdialog,

Hi vishnuatdialog,

When you are pressing the notification enable button, this is what the central does, it writes to the CCC of the characteristic in order to enable the notifications of the specified characteristic.

If you dont write to the CCC characteristic (i.e. enable the notifications) the central wont be able to receive anything from that particual characteristic.

谢谢mt_dialog.

vishnuatdialog
Offline
最后一次露面:8 months 2 weeks ago
加入:2017-07-25 07:44
Hello Dialog,

Hello Dialog,
If I don't want to write to control point how can I trigger the timer automatically?

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi vishnuatdialog,

Hi vishnuatdialog,

You can either set a timer to issue a small delay after connecting with the device, and send a notification in the callback of that timer, or you can use the write indication when the central writes to the CCC (in order to enable the notification) and either start a timer from there or send the notification directly. For the later all you have to do is to have this implementation in the user_catch_rest_hndl() function when you receive a CUSTS1_VAL_WRITE_IND.

谢谢mt_dialog.