BlueGiga的BLE112模块的BGAPI中的读/写错误 [英] Read / Write error in BGAPI for BLE112 modules by BlueGiga

查看:245
本文介绍了BlueGiga的BLE112模块的BGAPI中的读/写错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现 BLE112 板和 BLE112智能加密狗,由 BlueGiga .

这两个都支持AT命令集.
我设法通过BLEGUI工具在这两者之间进行配对,如下面的屏幕快照所示.

对于读取"操作,控制台显示以下内容:

ble_cmd_attclient_read_by_handle connection: 0 chrhandle: 3
TX: 00030404000300

ble_rsp_attclient_read_by_handle connection: 0 result: 0 ['No Error']
RX: 00030404000000

ble_evt_attclient_attribute_value connection: 0 atthandle: 3 type: 0 value:426c75656769676120554152542044656d6f
RX: 801704050003000012426c75656769676120554152542044656d6f

上面的行表示客户端(BLED112 USB加密狗)能够读取存储在服务器(BLE112板)中的第三个属性值.自从我收到此值以来,它就一直存在.

现在下面的部分说明我试图读取设备上不存在的第7个属性,但我打算创建它. 由于followinf read命令是我直接写到BLEGUI的控制台上的,因此它的显示方式与通过BLEGUI上的按钮发送来的显示方式有所不同.

ble_cmd_attclient_read_by_handle 0 7 
TX: 00030404000700  

ble_rsp_attclient_read_by_handle connection: 0 result: 0 ['No Error']
RX: 00030404000700

ble_evt_attclient_procedure_completed connection: 0 result: 401 ['The attribute handle given was not valid on this server']chrhandle: 7
RX: 800504010001040700

我有以下问题:

  1. 我可以在设备上创建新的(用户定义的)属性吗?
  2. 我可以在设备上写入/更改现有属性吗?
  3. 如果我打算将任何数据存储到设备上,该怎么做?

解决方案

是的,您可以创建自己的固件并将其上传到BLE112板上,并具有您定义的服务和特性. Bluegiga的应用指南开发您的第一个蓝牙智能应用"是一个很好的指导,可以在以下位置找到: BLE112文档和软件

关于存储数据,BLE112具有永久存储,您可以在其中存储(键,值)对.请参阅蓝牙智能软件API参考"文档,了解有关如何访问它的详细信息.也可以在上面的链接下找到该文档.

I am trying to implement a communication between a BLE112 board and a BLE112 Smart Dongle by BlueGiga.

These two support AT command set.
I have managed to perform pairing between these two over the BLEGUI tool as shown in the screenshot below.

For the Read operations the console shows following:

ble_cmd_attclient_read_by_handle connection: 0 chrhandle: 3
TX: 00030404000300

ble_rsp_attclient_read_by_handle connection: 0 result: 0 ['No Error']
RX: 00030404000000

ble_evt_attclient_attribute_value connection: 0 atthandle: 3 type: 0 value:426c75656769676120554152542044656d6f
RX: 801704050003000012426c75656769676120554152542044656d6f

The lines above means that the Client (BLED112 USB Dongle) is able to read the 3rd attrbute value stored in Server(BLE112 board). This value was right there in it ever since I received it.

Now below part shows that I tried to read the 7th attribute, which was not present on the device, but I intend to create. Since the followinf read command was written directly by me onto the console of BLEGUI, it appears in a different way than what would it look had that been sent through the buttons present on BLEGUI.

ble_cmd_attclient_read_by_handle 0 7 
TX: 00030404000700  

ble_rsp_attclient_read_by_handle connection: 0 result: 0 ['No Error']
RX: 00030404000700

ble_evt_attclient_procedure_completed connection: 0 result: 401 ['The attribute handle given was not valid on this server']chrhandle: 7
RX: 800504010001040700

I have the following questions:

  1. Can I create new(user defined) attributes onto the device?
  2. Can I write/change the existing attributes on the device?
  3. If I intend to store any data onto the device, how can this be done?

解决方案

Yes, you can create and upload your own firmware to the BLE112 board, with services and characteristics defined by you. A good guide through the process is Bluegiga's Application Note "Developing your 1st Bluetooth Smart Application" which can be found here: BLE112 Documentation and Software

With regards to storing data, the BLE112 has a persistent store where you can store (key, value) pairs. Have a look at the "Bluetooth Smart Software API Reference" document about details on how to access it. This document can also be found under the above link.

这篇关于BlueGiga的BLE112模块的BGAPI中的读/写错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆