[英]How do I add my own service to a BLE application?
I am currently working on an Android BLE app with which I want to connect to a Nucleo IDB05A1. 我目前正在开发一个Android BLE应用程序,我想连接到Nucleo IDB05A1。 I looked into the examples given for both sides, meaning the Bluetooth Le Gatt example app and some example code for the Nucleo. 我查看了双方给出的示例,这意味着蓝牙Le Gatt示例应用程序和Nucleo的一些示例代码。 Discovering and connecting to the device works fine, I played a little bit with the code and can read as well as write the given characteristics on the Nucleo. 发现并连接到设备工作正常,我玩了一些代码,可以读取以及在Nucleo上写出给定的特征。
My problem now is that I want to add a custom service to (for example) write text on my phone, write it to a custom characteristic of this service so that I can put it on UART with the Nucleo board. 我现在的问题是,我想添加一个自定义服务(例如)在手机上写文本,将其写入此服务的自定义特征,以便我可以将其放在带有Nucleo板的UART上。 Unfortunately, I could not find a proper explanation on how to develop an own BLE service. 不幸的是,我找不到关于如何开发自己的BLE服务的正确解释。
I would really appreciate some help on both the Android code and the code for my uC (Nucleo F401RE with Nucleo IDB05A1 BLE module). 我非常感谢Android代码和我的uC代码(Nucleo F401RE与Nucleo IDB05A1 BLE模块)的一些帮助。
Best approach for that should be to determine what exact BLE stack is used for Nucleo (I don't know details for ST since I've been working mostly with TI or Nordic). 最好的办法应该是确定Nucleo使用了哪些精确的BLE堆栈(我不知道ST的详细信息,因为我主要使用TI或Nordic)。 After that, you should try to find documentation for exact BLE stack and start to analyse your working example. 之后,您应该尝试查找精确BLE堆栈的文档并开始分析您的工作示例。
Point that you have to check are: 你要检查的要点是:
After you understand mentioned above, I would suggest you to start from Advertisement data changing and go further into development of custom service. 在您了解上述内容后,我建议您从广告数据更改开始,进一步开发自定义服务。
Hope it helps... 希望能帮助到你...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.