【问题标题】:BLE112 with Arduino code带有 Arduino 代码的 BLE112
【发布时间】:2014-12-31 10:07:00
【问题描述】:

我正在尝试使用 Arduino 读取传感器,然后通过 BLE112 将信号传输到 iPhone 设备。

我阅读了很多关于此设备的信息,并更新了固件(Gatta 和 hardware.xml 文件)。有一个库可以使用它(BGlib),但我不知道从哪里开始,因为没有足够的 cmets。

我将它与 BLUEGUI 连接。我可以在 iPhone 的 BLE 应用程序中看到它以及我需要使用的服务 (UUID)。我设法使用 API 与它(BLUEGUI)进行通信,但使用 Arduino 我可以连接到它但不能与之通信。我不知道如何处理(Arduino中的硬件连接RX和TX与ble112中的TX和RX)

有人对此有任何想法吗?

【问题讨论】:

  • 这个问题很模糊。你把模块连接到Arduino了吗?与模块通信成功了吗?您打算如何使用 BLE 广告或 BLE 连接与 iPhone 通信?
  • 是的,我确实将它与 BLUEGUI 连接,在 iphone 的 BLE 应用程序中使用我需要使用的服务 (UUID) 来查看它,并且我成功使用 API 与它通信 (BLUEGUI),但使用的是 Arduino我连接它但没有通信或者我不知道如何处理它(arduino 中的硬件连接 RX 和 TX 与 ble112 中的 TX 和 RX)
  • 您可能希望在问题中包含所有这些详细信息。
  • 我已经是,通过帮助您制定一个可以实际回答的问题(由具有相关经验的人);-)
  • 非常感谢

标签: arduino bluetooth-lowenergy bluegiga


【解决方案1】:

请查看我写的一篇关于通过 UART 将设备连接到 BLE112 的博客文章(该设备是 Arduino):http://www.sureshjoshi.com/embedded/ble112-uart-watermarks-example/

这是BLE112需要运行的串口代码

event system_endpoint_watermark_rx(endpoint, size)
  if endpoint = system_endpoint_uart1 then
    in_len = size
    call system_endpoint_set_watermarks(system_endpoint_uart1, 0, $ff) # disable RX watermark
    call system_endpoint_rx(system_endpoint_uart1, in_len)(result, in_len, in(0:in_len)) # read data from UART
    call system_endpoint_set_watermarks(system_endpoint_uart1, 10, $ff) # enable RX watermark
    call attributes_write(xgatt_test, 0, in_len, in(0:in_len)) # Write data to GATT
  end if
end

另外,这里是关于 RX/TX 连接的 sn-p

哦,因为我还没有在网上的示例中看到过它,所以我会 还提到 [usart channel="1 alternate="1" ...] 对应于 P0_4 (TX) 和 P0_5 (RX)(根据版本 1.26 – 2012 年 7 月 BLE112 数据表)

【讨论】:

    猜你喜欢
    • 2013-04-05
    • 2018-12-20
    • 1970-01-01
    • 1970-01-01
    • 2014-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多