Re: Can't connect while in discovery mode

2016-06-21 Thread will sanfilippo
Hey all: Sorry that I have not followed the entire thread so if I repeat something that has already been discusssed I apologize. I took a look at the controller HCI command processing and there is something that I had forgotten about how it works. There are two “objects” associated with

Re: Can't connect while in discovery mode

2016-06-21 Thread Simon Ratner
I will need to switch over to the nrf52dk to debug, I'll see if I can do that in the next couple of days. In the meantime, I tried increasing hci buffers from 4 to 8 and it has helped somewhat. I am not seeing -1 returns any more, and incoming connections are less flaky, but I still see that 14.

Re: Can't connect while in discovery mode

2016-06-20 Thread will sanfilippo
And btw, just because the controller is supposed to act this way doesnt mean there isnt a bug where something is going wrong. I will take a look over the code to see if there is a way to orphan command buffers when replying to a command (with command complete or command status). > On Jun 20,

Re: Can't connect while in discovery mode

2016-06-20 Thread chris collins
(Btw, sorry if these emails "look annoying"... my main computer is out of commission, so I have been using the gmail web interface for the last few days!) There is no connection between the mbuf settings and the max_hci_bufs setting. I don't have a specific max_hci_buf setting in mind, but 4 or

Re: Can't connect while in discovery mode

2016-06-20 Thread chris collins
Hi Simon, Unfortunately I am not able to reproduce that behavior. However, I think I can answer one of your questions. Hopefully that will lead to a full solution. That -1 return code is generated when the stack runs out of HCI command / event buffers. The actual return code is a bug;

Re: Can't connect while in discovery mode

2016-06-20 Thread Simon Ratner
Thanks Chris, just tried it out and it seems to do the trick -- half of the time. I see two occasional errors: 1. Sometimes, ble_gap_disc_cancel returns (-1); any idea under what circumstances that might happen? 2. Sometimes, ble_gap_disc_cancel returns 0 but ble_gap_conn_initiate immediately

Can't connect while in discovery mode

2016-06-18 Thread Simon Ratner
Hi devs, Having initiated an undirected scan with ble_gap_disc(), I would like to connect to my peripheral as soon as I spot it in the scan callback. However, calling ble_gap_conn_initiate() at this point fails with BLE_HS_EALREADY, as ble_gap_master is still in discovery mode. I need to stash