Hello,
1)
You have to tell the device to scan. But you can do this while you are advertising. Just look in any of the ble_central examples on how to set up scanning. Scanning window and scanning interval are two keywords you should look up.
2)
Well. a peripheral is the device that is advertising, while the central is scanning. However, as I mentioned, you can act as both in one device. however, if both the devices are identical, you do risk of getting two connections between the same two devices, where both devices has a link where it acts as a peripheral, and another link where it is the central. Maybe it helps to just tell the device that it should not request a connection if it is already in one, but you will have to test this.
If you want to check out the simultaneous scanning and advertising, I suggest you look at the example found in:
SDK\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay
For the big data transfers, you will have to enter a connection (a couple of hundred bytes will take some if you only use advertising.The rest looks like you can do only with advertising.
Best regards,
Edvin
Hello,
1)
You have to tell the device to scan. But you can do this while you are advertising. Just look in any of the ble_central examples on how to set up scanning. Scanning window and scanning interval are two keywords you should look up.
2)
Well. a peripheral is the device that is advertising, while the central is scanning. However, as I mentioned, you can act as both in one device. however, if both the devices are identical, you do risk of getting two connections between the same two devices, where both devices has a link where it acts as a peripheral, and another link where it is the central. Maybe it helps to just tell the device that it should not request a connection if it is already in one, but you will have to test this.
If you want to check out the simultaneous scanning and advertising, I suggest you look at the example found in:
SDK\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay
For the big data transfers, you will have to enter a connection (a couple of hundred bytes will take some if you only use advertising.The rest looks like you can do only with advertising.
Best regards,
Edvin
Great info, Thanks,
I'm curious if there is any clever tricks to save power if i have a continuous scan window. Since the device only needs to transmit when in range of less than 1-2ft but not any further away. unfortunately I can't request user input (e: button presses etc to initiate scanning) it needs to just be scanning constantly.
I see that the receive power is locked to 31ma? there's no way to decrease that?
Unfortunately, scanning is a power consuming task, as it needs to turn on the radio for a significant amount of time, unlike advertising or being in a connection. This is why cellphones or other devices with larger batteries usually acts as the central device.
I don't know how sensitive your devices need to be. If you can afford that the devices don't need to connect immediately, you can have a shorter scanning window. I am not sure whether you have seen this advertising blog post.
As you can see there, the detection of an advertisement requires that you scan while the advertisement is sent. Unfortunately, you can't say that you only want advertisements from devices closer than 2 feet, but you can check the RSSI to get a rough distance. You need to test a bit to see what RSSI values that is equivalent to 2 feet.
I can't say what advertising and scanning intervals you should use, but keep in mind that the more the radio on the scanning device is on, the more battery it uses.
Let us say that you advertise every 1s, then you could scan for 1 second every 10s or so. but I don't know if that is too long of a scan interval, if two devices passes by one another in less than 10s.
BR,
Edvin