- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a new Problem with my application:
Sometimes my application (handset) can't receive advertisments from my sensors.
For further tests I set up a second sensor.
But if my handset is connected to one sensor, there is no callback of advertisements of my second sensor, but with a smartphone I can see the second sensor is still advertising.
Anybody a hint what I forgot to call so my handset can connect to more than one sensor?
Solved! Go to Solution.
- Labels:
-
MasterSlave
-
Scanning-Advertising
-
SDK 2.X
- Tags:
- ble scan
- hello-client
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After a lot of playing around I think I found the problem.
If I'm scanning all the time with HIGH_SCAN, the chip looses the ability to scan or to receive advertisements.
But if I change the scanning to LOW_SCAN, I can receive all the advertisements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you taken a look at hello_client? If you search for "num_slaves" you can see all the calls that deal with connecting multiple devices.
-Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi kwang,
My current application uses the hello_client as code-base.
But I compared both everything of "num_slaves" also occures on my applicatio like in the hello_client with just one difference:
on connection_down I decrement num_slaves only if role is also MASTER:
if (sensor.dev_info[con_index].role == SLAVE) { sensor.handle_to_master = 0; // restart scan blecm_setAdvDuringConnEnable(TRUE); } else { blecli_ClientHandleReset(); /*@-unrecog@*/ blecen_connDown(); /*@=unrecog@*/ sensor.num_slaves--; }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have further information about my problem.
I started the handset and the sensor at the same time.
after about 30 seconds the handset crashed?!?
But then I can receive ADVs for about 300 seconds.
It is still possible to see the sensor with the smartphone.
As a next test, I restarted the handset, the sensor is still running,
Now I receive the ADVs again for about 500 seconds.
As a third test, I then restarted the Lamp, the sensor still running and not receiving ADVs from the sensor.
The handset won't receive ADVs from the sensor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After a lot of playing around I think I found the problem.
If I'm scanning all the time with HIGH_SCAN, the chip looses the ability to scan or to receive advertisements.
But if I change the scanning to LOW_SCAN, I can receive all the advertisements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi jaruhl
Thanks for your investigation, because I also observed exactly the same problem.
I have one question about your solution:
When you say "But if I change the scanning to LOW_SCAN, I can receive all the advertisements.", do you mean we should use LOW_SCAN all the time (never use HIGH_SCAN), or do you mean we should only use LOW_SCAN once when the problem occurs then switch back to HIGH_SCAN?
Current I set the same interval and window for HIGH_SCAN and LOW_SCAN. So they have no difference to me, I just don't know whether I should switch between these two scanning modes or stay with LOW_SCAN only to avoid such problem.
Thanks
noalac
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi noalac,
I'm always scannin with LOW_SCAN.
All other devices sending ADVs undirected and directed in HIGH-Mode, so the connection is established fast enough.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks
I tested the solution today, also using LOW_SCAN all the time and never had issue any more.