DSPS 3.150.2 burst current and beacon content

6 posts / 0 new
Last post
jackiechau
Offline
Last seen:3 years 4 months ago
加入:2016-01-15 01:32
DSPS 3.150.2 burst current and beacon content

Hi,

Refer to Fig. 1, I have configured the beacon interval to 1s, the burst current indicates the BLE broadcast. I enlarged the time scale of oscilloscope, each burst current comprised 3 peak current shown in Fig. 2. Why are there 3 peak current? Is the beacon broadcast 3 times per second? If so, how to configure the number of broadcast times?

Also, I would like to broadcast 1 more byte to indicate a feature in every beacon, should I need to modify the content of APP_DELF_ADV_DATA in app_adv_func()? Thanks.

BR,
Jackie

丙氨酸achment:
Device:
MT_dialog
Offline
Last seen:1 month 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Jackiechau,

Hi Jackiechau,

The BLE spec indicates that a peripheral device should advertise in all three BLE channels, so what you are seeing is the transmition on each channel seperatelly (37, 38, 39) during the one advertising interval. You can configure the device to advertise only to one channel but that will reduce the chance of a master to find your device. You can do that by changing the channel_map member of the gapm_start_advertise_cmd struct and place the channel that you would like to advertise 0x07 enables advertising in all three channels and 0x00, 0x02, 0x04 for channels 37, 38, 39 respectively.

Regarding the advertising string, yes this is the #define that provides the data to the DSPS project, but you need to change the length of the adv data as well and be carefull when placing the additional byte, you have to comply with the advertising string conventions of the BLE spec.

Thanks MT_dialog

jackiechau
Offline
Last seen:3 years 4 months ago
加入:2016-01-15 01:32
Hi MT_dialog,

Hi MT_dialog,

Thanks for you reply. When 3 channels are enable, is it possible for me to increase the advertising interval between each channels? e.g. Add delay after advertising for each channel or any parameter to change this interval. Thanks.

MT_dialog
Offline
Last seen:1 month 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi jackiechau,

Hi jackiechau,

You can manipulate the interval between the advertising channels by changing the BLE_ADVTIM_REG, there is an implementation for that in the beacon example, please check the ble_advtim_set() function. The value of the register is in usec and its a 0-13 bit register.

Thanks MT_dialog

jackiechau
Offline
Last seen:3 years 4 months ago
加入:2016-01-15 01:32
Hi MT_dialog,

Hi MT_dialog,

I added 'include "ble_blecore.h"' and modified the following codes in app_sps_device_project.c but I observed that there was no change on the interval between the advertising channels. Please kindly advise.

#define BLE_ADVTIM_ADDR 0x400000A0
#define BLE_ADVTIM_OFFSET 0x000000A0
#define BLE_ADVTIM_INDEX 0x00000028
#define BLE_ADVTIM_RESET 0x00000000

__INLINE uint32_t ble_advtim_get(void)
{
return REG_BLE_RD(BLE_ADVTIM_ADDR);
}

__INLINE void ble_advtim_set(uint32_t value)
{
REG_BLE_WR(BLE_ADVTIM_ADDR, value);

void app_adv_func(struct gapm_start_advertise_cmd *cmd)
{
// Device Name Length
uint8_t device_name_length;
uint8_t device_name_avail_space;
uint8_t device_name_temp_buf[64];

cmd->op.code = GAPM_ADV_UNDIRECT;
cmd->op.addr_src = GAPM_PUBLIC_ADDR;
cmd->intv_min = APP_ADV_INT_MIN;
cmd->intv_max = APP_ADV_INT_MAX;
cmd->channel_map = APP_ADV_CHMAP;

cmd->info.host.mode = GAP_GEN_DISCOVERABLE;
ble_advtim_set(8192); // <-- add this to increase the interval of advertising channels
/*-----------------------------------------------------------------------------------
* Set the Advertising Data and the Scan Response Data
*---------------------------------------------------------------------------------*/
cmd->info.host.adv_data_len = APP_ADV_DATA_MAX_SIZE;
cmd->info.host.scan_rsp_data_len = APP_SCAN_RESP_DATA_MAX_SIZE;

MT_dialog
Offline
Last seen:1 month 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi jackiechau,

Hi jackiechau,

Check the beacon example, where the function gets called and how its used and try to replicate that in your project, dont just place the function in your advertising function. I ve checked with the beacon project and the value you provided should be ok and you should see a quite long interval between the advertising channels.

Thanks MT_dialog