⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
12个帖子/ 0新
最后一篇
Ruchi Patel
离线
Last seen:2 years 6 months ago
加入:2017-03-29 10:50
用户数据

hello dialog_support,

1.We are configuring DA14580 MCU as abroadcastermode. So we need to dynamically change用户数据string to send dynamically changed data. But this USER_ADVERTISE_DATA is defined in user_config.h file so we can not modify it. Is there any provision so we can modify USER_ADVERTISE_DATA in our user defined function?

2.我们可以定义多个user_advertise_data吗?
for example
#define user_advertise_data(“\ x03”\
ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\
ADV_UUID_DEVICE_INFORMATION_SERVICE\
"\x11"\
ADV_TYPE_COMPLETE_LIST_128BIT_SERVICE_IDS\
"\x2F\x2A\x93\xA6\xBD\xD8\x41\x52\xAC\x03\x00\x0F\xCA\xEA\x80\x7F")

#define USER_ADVERTISE_DATA1 ("\x03"\
ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\
ADV_UUID_DEVICE_INFORMATION_SERVICE\
"\x11"\
ADV_TYPE_COMPLETE_LIST_128BIT_SERVICE_IDS\
"\x2F\x2A\x93\xA6\xBD\xD8\x41\x52\xAC\x03\x00\x0F\xCA\xEA\x80\x00")

The above mention code snippet is possible or not?

3.如果我们要发送超过1个具有不同有效载荷的广告数据包,那么您有任何示例代码吗?

4. How to change advertisement packet transmission rate?

Device:
PM_Dialog
离线
Last seen:1 day 14 hours ago
职员
加入:2018-02-08 11:03
Hi Ruchi Patel

Hi Ruchi Patel

Please check the ble_app_barebone example of the SDK which demonstrates dynamically change of user advertising data. Yes, you can send more than 1 advertisement packets with different payloads. The ble_app_barebone example demonstrates that functionality, too. The advertising string should have a specific format, like . The blocks of code that you have posted have this format, so it is possible to do that. The advertisement packet transmission rate can be customized in the user_undirected_advertise_conf structure of
user_config.h file. The advertising packets are transmitted in specific advertising intervals which can be changed in that structure

Thanks PM_dialog

Ruchi Patel
离线
Last seen:2 years 6 months ago
加入:2017-03-29 10:50
Hello PM_Dialog,

Hello PM_Dialog,

Thank you for your prompt reply. It was helpful.
I have few more questions are there.
1.I have checked ble_app_barebone example. In that, only manufacturing advertising data are changing. If we want to modify other bytes of advertising data in user files then how we can modify? Do you have any example program for this?
2.我没有在ble_app_barebone示例中找到user_undircated_advertise_conf结构,所以你可以告诉我在哪个例子中定义了这个结构?
3. I want to configure one broadcaster which transmits advertising packets. This advertising packet we can modify. We should able to modify more than 1 bytes of advertising data. So can you guide me how to start this?

Thanks and Regards,
Ruchi Patel

PM_Dialog
离线
Last seen:1 day 14 hours ago
职员
加入:2018-02-08 11:03
Hi Ruchi Patel,

Hi Ruchi Patel,

You can configure the advertisement packet transmission rate by changing the .intv_min or .intv_max menbers of user_adv_conf structure, which is defined in user_config.h. In this way, you can define the minimum and maximum intervals for advertising. Regarding the advertising data, you are able to modify not only the manufacturing advertising data. Also you able to modify more than 1 bytes of advertising data. The ble_app_barebone example of the SDK changes the propriety data of the advertising string dynamically. The propriety data have 2 bytes length in the specific example, but the length of them can be changed. In the advertising string you can append your specific data and update them from your application. The advertising message is created in app_easy_gap_undirected_advertise_start_create_msg() function and then is saved in the cmd structure when the app_easy_gap_undirected_advertise_get_active() function is invoked. The cmd pointer will have a full message that you can send to the stack including some default adv data taken from the USER_ADVERTISE_DATA, so what you can do is after the app_easy_gap_undirected_advertise_get_active() returns, target the array in the cmd pointer that holds the advertising data (cmd->info.host.adv_data) and change them as you like – your data will have to be according to the BLE specification.

Thanks PM_dialog

Ruchi Patel
离线
Last seen:2 years 6 months ago
加入:2017-03-29 10:50
你好pm_dialog,

你好pm_dialog,

感谢您的答复。现在我能够在user_advertise_data中发送超过1个字节的字节。接下来我想在观察者和广播公司之间进行角色交换机。我有两个个人申请:作为广播公司和其他人作为观亚博国际官网平台网址察者。以前我在外围和中心之间做过角色。所以我试图配置这个,但我的应用程序进入NMI_Handler,因为我运行应用程序。您能否建议我需要额外的更改?

Thanks and Regards,
Ruchi

PM_Dialog
离线
Last seen:1 day 14 hours ago
职员
加入:2018-02-08 11:03
Hi Ruchi Patel,

Hi Ruchi Patel,

关于NMI\u处理程序,它独立于您的双角色应用程序。由于看门狗计时器的原因,将发出NMI\ U处理程序。请检查您的应用程序中的监视器。关于广播和观察者模式之间的切换,您不应该做任何额外的更改。在广播的情况下,你是作为一个不可连接的设备广告?如果没有,您可以使用app\u easy\u gap\u non\u connectable\u adversed\u start API为非连接广告创建广告消息。另外,我建议您在广告发布完成时使用.app \u on \u adv \u noncon \u complete回调函数,因为作为不可连接的设备发布广告时会触发此回调。

Thanks PM_dialog

Ruchi Patel
离线
Last seen:2 years 6 months ago
加入:2017-03-29 10:50
hello dialog_support,

hello dialog_support,

Thank you for your reply. Now i am able to switch the role from observer to broadcaster and vice versa.

1.我已经要求在my first post thatCan we define more than one USER_ADVERTISE_DATA?。I am able to define it in user_config.h file. But how to call it? I mean nvds.c file has the nvds_data_struct structure in which USER_ADVERTISE_DATA has been called. But if i want to call USER_ADVERTISE_DATA and USER_ADVERTISE_DATA1 both then where i can call in user space? As nvds.c file is SDK's common file so i can not modify it.

2. I have one broadcasting device in which i am modifying manufacture data which is part of USER_ADVERTISE_DATA and start advertising. At the other end I have another device which is observer. At observer side I am getting USER_ADVERTISE_DATA packets but in that I am not getting manufacture data. I have checked using BLE Scanner App, In that i am getting manufacture data. How to receive this manufacture data at observer device side?

Thanks and Regards,
Ruchi

PM_Dialog
离线
Last seen:1 day 14 hours ago
职员
加入:2018-02-08 11:03
Hi Ruchi Pate,

Hi Ruchi Pate,

当您在帖子中说,#define“user_advertise_data”附加到.nvds_tag_app_ble_adv_data项目的nvds_data_storage结构。您可以定义多个User_Advertise_Data,但由于唯一的.nvds_tag_app_ble_adv_data项,只能在该结构中附加其中一个。如果您想要拥有多个广告数据,您可以使用不同的方式进行。我建议您将user_advertise_data定义为空,然后动态地附加不同的广告数据。当设备启动广告时,执行user_App_Adv_Start(),然后通过app_easy_gap_undirected_advertise_get_active()创建CMD。app_easy_gap_undircated_advertise_get_active()函数返回app_easy_gap_undircated_advertise_start_create_msg()函数,为可连接的无向事件创建广告消息。广告消息包括用户广告配置,广告数据和其他数据。app_easy_gap_adv_read_from_nvds()函数从nvds_data_storage结构中读取user_advertise_data,因此如果您有空的user_advertise_data定义,则您的广告数据将为空。通过这种方式,您可以根据user_app_add_start()函数中的app_add_ad_struct()动态地追加不同的广告数据。

Regarding the manufacturer data, when the device is in observer mode, the .app_on_adv_report_ind ind callback function (in user_callback_config.h file) will executed, so it shouldn’t be NULL and you should define a function to be triggered. When a GAPM_ADV_REPORT_IND is received, the gapm_adv_report_ind_handler() will executed which is executes the .app_on_adv_report_ind ind callback. This handler has input parameter the gapm_adv_report_ind structure, which includes the adv_report structure. The manufacturer data should be at the data[ADV_DATA_LEN] item of the adv_report scucture. So how do you actually check that the manufacturer data are not being received and all the other data received properly?

Thanks PM_dialog

Ruchi Patel
离线
Last seen:2 years 6 months ago
加入:2017-03-29 10:50
Hello PM_Dialog,

Hello PM_Dialog,

1.在user_config.h文件中,我将user_advertise_data保持为空,稍后我将动态添加广告数据。但是是否可以将大量字节(大约16-20字节)添加到单个user_advertise_data中?让我们考虑我能够在观察者方面广播大量字节,我可以收到超过31个字节的数据吗?现在,如果广播公司在user_advertise_data中有大量字节,那么在观察者侧,我无法接收超过31个字节的广告数据。

2. I am observing data in user_on_adv_report_ind function. Here i am attaching code snippet of that function.
void user\ on\ u adv\ u report\ u ind(struct gapm\ u adv\ u report\ u ind const*param)
{
volatile static uint8_t param_data[ADV_DATA_LEN];

arch_printf("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n\r",
param->report.adv_addr.addr[5],
param->report.adv_addr.addr[4],
param-> eport.adddr.addr [3],
param->report.adv_addr.addr[2],
param - > report.adv_addr.addr [1],
param->report.adv_addr.addr[0],
param_data[0] = param->report.data[0],
param_data[1] = param->report.data[1],
param_data[2] = param->report.data[2],
param_data [3] = param-> report.data [3],
param_data [4] = param-> report.data [4],
param_data[5] = param->report.data[5],

这样我在读31个字节数据。我不知道the other method to read data. At broadcaster side, after 26 bytes, Manufacture data are attached. If I modify my custom data at manufacture data string and the advertising data length is more then 31 bytes then I am getting 00 at observer side but if I check the same in BLE Scanner App in Raw data section I am getting the same data which I have modified. Can you please explain me why this is happening? And if you have any other method to read USER_ADVERTISE_DATA then please let me know.

Thanks and Regards,
Ruchi

PM_Dialog
离线
Last seen:1 day 14 hours ago
职员
加入:2018-02-08 11:03
Hi Ruchi Patel,

Hi Ruchi Patel,

Depending how you are using the SDK and which example you are using be aware that the SDK will append any extra data that don’t fit in the advertising string in the scan response data, so make sure that the data that you are interested in is in the advertising string and not the scan response data. In the first indication (advertising indication) the advertising data will populate the data member of the adv_report struct, and then in the second indication (scan response indication) the scan response data will populate the struct. In order to catch the scan response data, you should configure your device as GAPM_SCAN_ACTIVE to get a scan response. If you configure your device as GAPM_SCAN_PASSIVE, the observer only receives advertising data and doesn’t send a scan request to receive a scan response, so you will not able to read your scan response data. I’ve also tested this using an observer and the ble_app_barebone, I was able to get the increment in the advertising string or in the scan response data.

Thanks PM_dialog

Ruchi Patel
离线
Last seen:2 years 6 months ago
加入:2017-03-29 10:50
Hello PM_Dialog,

Hello PM_Dialog,

Thank you for the response. I am developing my application by taking reference of ble_app_peripheral and ble_app_barebone example. Now i want to send my custom data into USER_ADVERTISE_DATA but that data don't fit into USER_ADVERTISE_DATA so as i asked in my previous post that can we define multiple USER_ADVERTISE_DATA and broadcast it? But as USER_ADVERTISE_DATA is invoked in nvds.c file which is DSK's common file so I can't modify it. As you have suggested that update USER_ADVERTISE_DATA but i am not able to implement that so can you provide me any code snippet or example code which is doing exactly same.

In short, I want to broadcast 28 bytes to 4 different observers at a time. So If I can send 7 bytes per advertising packet and 4 advertising packets i want to broadcast at a time then what configuration i need to follow? Please help me out.

Thanks and Regards,
Ruchi Patel

PM_Dialog
离线
Last seen:1 day 14 hours ago
职员
加入:2018-02-08 11:03
Hi Ruchi Patel,

Hi Ruchi Patel,

As I have pointed out in a previous post, you are not able to define more than one USER_ADVERTISE_DATA, because the #define “USER_ADVERTISE_DATA” is appended into the .NVDS_TAG_APP_BLE_ADV_DATA item of nvds_data_storage structure. The advertising string has 31 byte length, but 3 bytes of them are reserved from the stack, the advertising filter policy and the advertising data length, so you are able to use up to 28bytes. The data that are appended into the advertising string will be populated by user_app_adv_start with the procedure I have already mentioned in a previous post. In case you want to add your custom data into the advertising string you should copy them into the correct array of the cmd which is into user_app_adv_start() function. The cmd is created by app_easy_gap_undirected_advertise_get_active(). In your application you can have the USER_ADVERTISE_DATA empty and copy your data into the advertising string. The custom data should be valid and should follow the structure of USER_ADVERTISE_DATA, as in order to start advertising correctly. You should have 2bytes as length and flag into your data, so finally you are able to append up to 26bytes into the advertising string. In the following code, I will present you how you can do that.

void user_app_adv_start(void)
{

uint8_t advdata[28] = {0x1B,0xFF,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38};

// Schedule the next advertising data update
app_adv_data_update_timer_used = app_easy_timer(APP_ADV_DATA_UPDATE_TO, adv_data_update_timer_cb);

struct gapm_start_advertise_cmd * cmd;
cmd = app_easy_gap_undirected_advertise_get_active();

memcpy(cmd-> info.host.adv_data,Advdata,28);

// add manufacturer specific data dynamically
// mnf_data_update();
app_add_ad_struct(cmd, &mnf_data, sizeof(struct mnf_specific_data_ad_structure));

app_easy_gap_undirected_advertise_start();
}

If you add 26bytes data into the advertising string and you want to populate additional data, you can append them into scan response data, but in the other side, the observer should be configured as GAPM_SCAN_ACTIVE in order to send the scan request.

Thanks PM_dialog