Using SAMB11 without BLE connection

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a question about using the SAMB11 with BLE enabled but no connection. I want to use the SAMB11 to execute different background processes even without a ble connection.

The problem I have is when I use one of the examples, that in main function there will be an call to function ble_event_task(BLE_EVENT_TIMEOUT) of ble_manager.c.

In this ble_event_task function there will be a call to at_ble_event_get function. What I observed is that after startup the SAMB11, the program waits until a ble event is received. What I want is that when no event is occured the normal main program will continue.

Does someone has experiences with this. For example when I logging the temperature with a sensor connected to the SAMB11 the logging will continue when a ble connection is established, without this the SAMB11 waits at the call at_ble_event_get function. Even when I change the timout value to for example 1.

 

My question is : how to use the SAMB11 as normal controller with BLE functionallity even there's no connection with a central device?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not quite sure I follow all your questions, but the samb11 does work without the BLE connection, and lots of the examples show it.  One thing you might need to do is this:

 

ble_event_task(TIMEOUT_VALUE);

 

...I've noticed most of the examples wait indefinitely.  In my main application, I use a value of 20ms (20) for TIMEOUT_VALUE and it seems to behave properly.  You could also just not call ble_event_task() at all if you're not actually using BLE...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to use the Samb11 to log the data from some sensors. With my smartphone I want to make a ble connection when I am in the neigherhood of the Samb11 and download the data. Both the logging and the ble connection with service and characteristics working well, but not together.

The problem is that when I startup the Samb11 the program without ble connection works for a short moment. In the main loop I call ble_event_task() to check if there are events. In the case of an event one of the registered callback functions will be executed.

In ble_event_task() there is a call to the function at_ble_event_get(&event, ble_event_params, 1) of the at_ble_api.h What I noticed is that short time after startup the program is waiting at this function call. The waiting time takes forever until you make a BLE connection with for example my smartphone. The 1 is the timeout, and that must be 10 ms at the Samb11 I think.

When I use the function call at_ble_event_user_defined_post(ble_event_params) the program works fine also after a startup of the Samb11 but then I cannot make a connection to the device, I think because there are user defined events that will be handled first.

So my question is, how can I let the application work as I want, so the application is not waiting with undefined time to an (for example connection) event.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like the timeout is passed unmodified from ble_event_task() to at_ble_event_get() - perhaps 1ms ("1") just doesn't work well enough?  Try 20 as a value instead of 1, and see if things improve?  Unfortunately, this stuff is poorly documented.  I know that my application works OK without a BLE device connected.