This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

S110 sticks for Service discovery from iPhone

Hello, Nordic stuff.

I've been working at S110 firmware and coming into a problem of service discovery from a central device(iPhone).

I'm using S110(v6.0), Keil(V4.73) and SKD(V5.2).

S110 supports one custom service which like a SPP profile and it provides a file transfer function as below.

S110 is connected with PC terminal(Tera Term) using UART port. The UART baud rate is 115200bps.

1.S110 starts advertising

2.iPhone(Lightblue) scans and finds S110

3.iPhone connect to S110 and starts service discovery

4.iPhone enables CCCD of S110

5.S110 starts transmitting data from PC with sd_ble_gatts_hvx()

6.iPhone disconnects at the end of transmission.

7.S110 restarts advertising again

8.iPhoen goes back to step 2

This works fine normally.

But when iPhone disconnects before end of transmssion and goes back to step 2, At step 3, As S110 dose not response to the "Read By Group Type Request"(see No. 3255 of sniffer log), re-connection from iPhone is failed.(see No. 4235)

S110 sends data(max. 20 bytes) from PC in the ble event handler using sd_ble_gatts_hvx() as below.

static void on_ble_evt(ble_evt_t * p_ble_evt)

{

....

case BLE_EVT_TX_COMPLETE:

    sd_ble_gatts_hvx(conn_handle, &hvx_params);

    break;

....

}

If S110 sends data in main loop context(not in event handler), it works fine.

I think it is the problem of ATT or GATTS of S110 side, but I cannot explain what's happeing inside and how can I manage this problem.

Please help me.

best regard.

Service_Discovry_by_iPhone(LightBlue)_after_disconnecting_from_iPhone_20160115_1.pcap

Parents
  • Hi, RK.

    Thanks for your reply. I'm handling BLE_GATTS_EVT_SYS_ATTR_MISSING event. But when the phenomenon occurs, BLE_GATTS_EVT_SYS_ATTR_MISSING event is not notified from the softdevice. When the phenomenon occurs and re-connection fails(1st re-connection fails), but 2nd re-connetion succeeds and I can confirm that BLE_GATTS_EVY_SYS_ATTR_MISSSING event is notified from the softdevice. Do you have any ideas what is happening in softdevice inside?

    best regards.

  • that was the only event I could think of. If it was me debugging here I'd add some code to break/crash/something on ANY event which I don't explicitly handle and see if there's another one being sent in the failing case which needs handling. I wrote a huge GATTS event logger which prints details of every event out of Segger RTT, helps out a lot in times like this.

Reply
  • that was the only event I could think of. If it was me debugging here I'd add some code to break/crash/something on ANY event which I don't explicitly handle and see if there's another one being sent in the failing case which needs handling. I wrote a huge GATTS event logger which prints details of every event out of Segger RTT, helps out a lot in times like this.

Children
No Data
Related