0
votes

I'm trying to read a sensor with Arduino, then transmit the signal to an iPhone device by BLE112.

I read a lot about this device, and I updated the firmware (Gatta and hardware.xml files). There is a library to use it (BGlib) but I don't know where to start, since there are not enough comments.

I connected it with BLUEGUI. I can see it in BLE applications in the iPhone with the services (UUID) I need to use. I managed to communicate with it (BLUEGUI) using the API, but with Arduino I can connect to it but not communicate with it. I don't know how to deal with it (hardware connection RX and TX in Arduino with TX and RX in ble112)

Does anyone have any idea about this?

1
The question is very vague. Have you hooked up the module to the Arduino? Have you succeeded in communicating with the module? How are you intending to communicate with the iPhone, using BLE advertisements or a BLE connection?NPE
Yes I did connect it with BLUEGUI , see it in BLE applications in iphone with the services (UUID) I need to use ,and I success to communicate with it (BLUEGUI)using API , but with Arduino I connect it but no communication or I don't know how to deal with it (hardware connection RX and TX in arduino with TX and RX in ble112)Rana
You might want to include all those details in your question.NPE
I already am, by helping you formulate a question that can actually be answered (by someone with relevant experience) ;-)NPE
Thanks alot for thatRana

1 Answers

0
votes

Please take a look at a blog article I wrote about connecting a device to the BLE112 over UART (the device was an Arduino): http://www.sureshjoshi.com/embedded/ble112-uart-watermarks-example/

Here is the serial port code that needs to run off of the 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

Also, here is a snippet about the RX/TX connections

Oh, and just because I’ve never seen it in an example online yet, I’ll also mention that [usart channel="1 alternate="1" ...] corresponds with P0_4 (TX) and P0_5 (RX) (according to the Version 1.26 – July 2012 BLE112 datasheet)