你好 am using the proximity reporter application .I want to add a scanned data(eg number) which will increment for each advertising event .is it possible in DA14580 ?
And also why the adv & scan_resp data is in such a format ?? #define APP_SCNRSP_DATA "\x09\xFF\x00\x60\x52\x57\x2D\x42\x4C\x45" ?? is there any service data field in addition to manufacture specific data field ?if there how to access it ?
你好hrg,最简单的方法来实现一个计数器would be to implement a counter.
例如:如果您想要测量具有广告间隔的4个广告活动,则设置为700毫秒。
- You will have to set the timer to a 2152 ms (13ms *4 + 700ms *3). Note: 1 advertising takes about 13ms + 1 advertising interval which is for example 700 ms.
你好JE_Dialog thankyou for your reply .Even if we use timer ,how can we change the scan data since it is defined as macro ,will it can be changed during runtime ??
The advertising an scan response data is set in the function app_adv_func() of most of our sample projects (template_fh is a good example of this). This function is run once before advertisement starts and the content loaded into scan response and advertisement data will be used in all future advertisements until you stop advertising. the function can be found in app_template_proj.c.
So the trick is to stop advertising, rebuild the advertising data using the app_adv_func() with your updated data (counter or whatever) and restart advertising. Stopping advertising can be done with a timer or with one of the sleep hooks if you use one of the two sleep modes. The latter method is recommended.
Manufacturer specific data uses the adv_data type 0xFF. You can use the defined value GAP_AD_TYPE_MANU_SPECIFIC_DATA instead of 0xFF. Let's say you want to add the counter value of 0xAA to your scan esponse string. You would have to provide first the total length of your data (including the type). This is one byte for the type and one byte for the data, or 0x02. Next, you should provide the type 0xFF and finally your one byte data of 0xAA. The entire string would be \0x02\0xFF\0xAA
I hope this makes sense and addresses your request.
I can change the adv data as you wrote memcpy(&cmd-> info.host.addata和数据[0],cmd-> info.host.adv_data_len); 所以我可以关闭nvds_support, and what dose NVDS disigned to do?
why the dev name and adv data from nvds is ok, but NVDS_TAG_APP_BLE_SCAN_RESP_DATA not ok (如果(nvds_get(nvds_tag_app_ble_scan_resp_data,&cmd-> info.host.scan_rsp_data_len, &cmd-> info.host.scan_rsp_data [0])!= nvds_ok)) the scan response data length in nvds.c is right, any other reason?
The NVDS is a special area in the SYSRAM with a specific structure which can be populated either by the OTP header or by using the specified code in program. If the procedure reading data from NVDS is succeeded it gets the adv data from the NVDS else it gets the data from the default values.
非常感谢您的回复, the adv data is from nvds,but the scan response data is always from the default macro, .NVDS_TAG_APP_BLE_SCAN_RESP_DATA = "\x09\xFF\x00\x60\x52\x57\x2D\x42\x4C\x45", .SCAN_RESP_DATA_TAG_LEN = 10, // SCAN_RESP_DATA 那么可能导致nvds_get失败了什么?
还有一个疑问醒来up from deep sleep is an interrupt like push buttton (as of in proximity_reporter_fh) mandatory ? is there anyway to wake from sleep after some confined period ??
I modified the proximity application to advertise dynamic manufacture data in advertising field and it was working fine in debugging mode in SRAM. The app will advertise once and goes to sleep and when i press the button K1 it will advertise again with incremented data once and goes to sleep.This was working fine in debugging mode. Now i burned the same program in OTP.The problem arised !! 它是广告良好的。但是制造数据在K1的唤醒时不会递增!!那么这里的问题是什么!?? Could you please asap explain why such problem arise ???
hrg, what sleep mode do you use ? note that if you use Deep Sleep, all SRAM contents are lost : so anything you keep as a counter in SRAM will be disapear. SRAM is re-loaded from OTP on wake from deep sleep.
谢谢你的回复je_dialog。 You are right !! i used deep sleep mode (by default in proximity reporter_fh it was deep sleep mode).! I burned the otp too ! during OTP header i have enabled Jtag.So is can we change it to extended sleep mode through Spota or any other way ??
When you are in development mode and your project is configured in deep sleep the 580 doesn't actually turns off its sysram so, even if you haven't saved your values in a retention memory area you should be able to see your values changing over the scan response string, if you are actually changing them. The scan response data is loaded through the NVDS in most of the 580 examples using the below command:
app_easy_gap_adv_read_from_NVDS (&cmd->info.host.scan_rsp_data_len,&cmd->info.host.scan_rsp_data[0], SCAN_RSP_DATA_LEN, SCAN_RSP_DATA_LEN+1, NVDS_TAG_APP_BLE_SCAN_RESP_DATA); in the app_easy_gap_undirected_advertise_start_create_msg() function. Please have a look at this function and replace the command with your string manipulation function.
有人能帮忙吗? !
你好HRG,我会检查一下。请耐心等待几天。
BR JE_Dialog
And also why the adv & scan_resp data is in such a format ?? #define APP_SCNRSP_DATA "\x09\xFF\x00\x60\x52\x57\x2D\x42\x4C\x45" ??
is there any service data field in addition to manufacture specific data field ?if there how to access it ?
你好Dialog team we are eagerly waiting for the response asap .
Thankyou
你好hrg,最简单的方法来实现一个计数器would be to implement a counter.
例如:如果您想要测量具有广告间隔的4个广告活动,则设置为700毫秒。
- You will have to set the timer to a 2152 ms (13ms *4 + 700ms *3).
Note: 1 advertising takes about 13ms + 1 advertising interval which is for example 700 ms.
这可能在很长一段时间内不准确:你想要做什么准确的?
BR JE_Dialog
你好JE_Dialog thankyou for your reply .Even if we use timer ,how can we change the scan data since it is defined as macro ,will it can be changed during runtime ??
- 即可在广告期间,我需要更新每个广告活动的扫描响应字段。
- 例如 - 在扫描数据上的电源期间,对于13ms的每个adv事件,我需要将扫描数据递增01,02 ...所以扫描响应数据字段将在广告期间宣传动态数据,直到它进入睡觉。
Hope you understood my question.
嗨HRG,
The advertising an scan response data is set in the function app_adv_func() of most of our sample projects (template_fh is a good example of this). This function is run once before advertisement starts and the content loaded into scan response and advertisement data will be used in all future advertisements until you stop advertising. the function can be found in app_template_proj.c.
So the trick is to stop advertising, rebuild the advertising data using the app_adv_func() with your updated data (counter or whatever) and restart advertising. Stopping advertising can be done with a timer or with one of the sleep hooks if you use one of the two sleep modes. The latter method is recommended.
Manufacturer specific data uses the adv_data type 0xFF. You can use the defined value GAP_AD_TYPE_MANU_SPECIFIC_DATA instead of 0xFF. Let's say you want to add the counter value of 0xAA to your scan esponse string. You would have to provide first the total length of your data (including the type). This is one byte for the type and one byte for the data, or 0x02. Next, you should provide the type 0xFF and finally your one byte data of 0xAA. The entire string would be \0x02\0xFF\0xAA
I hope this makes sense and addresses your request.
Thankyou mhvid_dialog for the detailed reply .
是否有任何main(),如adv_start,adv_stop等所有这些函数都被调用??因为存在恰好广告顺序操作的混淆!
而且您所说的值0xAA应该自动增量。但是由于它是一种宏定义的格式,如何在运行时更改值??!
嗨HRG,
app_adv_start()在app.c.中定义。它使用app_adv_func()来构建它最终发送到GAP堆栈的广告命令。app_adv_start()称为几个位置。它在设备配置完成后第一次调用(app_set_dev_config_complete_func())。当中央断开设备时也调用它。
0xAA doesn't increment austomatically. Your application would have to that.
以下是在App_adv_func()函数中动态更改广告内容的示例。我用ibeacon为例,我正在加载在广告数据字符串中定义的次要密钥:
////////////代码片段开始
///////////Code Snippet end
你好MHv_dialog,
I can change the adv data as you wrote
memcpy(&cmd-> info.host.addata和数据[0],cmd-> info.host.adv_data_len);
所以我可以关闭nvds_support,
and what dose NVDS disigned to do?
谢谢,
Anthony
你好MHv_dialog,
why the dev name and adv data from nvds is ok,
but NVDS_TAG_APP_BLE_SCAN_RESP_DATA not ok
(如果(nvds_get(nvds_tag_app_ble_scan_resp_data,&cmd-> info.host.scan_rsp_data_len,
&cmd-> info.host.scan_rsp_data [0])!= nvds_ok))
the scan response data length in nvds.c is right, any other reason?
谢谢,
Anthony
你好Antony42,
The NVDS is a special area in the SYSRAM with a specific structure which can be populated either by the OTP header or by using the specified code in program. If the procedure reading data from NVDS is succeeded it gets the adv data from the NVDS else it gets the data from the default values.
if(nvds_get(NVDS_TAG_APP_BLE_ADV_DATA, &cmd->info.host.adv_data_len,
&cmd->info.host.adv_data[0]) != NVDS_OK)
Thanks MT_dialog
你好MT_dialog,
非常感谢您的回复,
the adv data is from nvds,but the scan response data is always from the default macro,
.NVDS_TAG_APP_BLE_SCAN_RESP_DATA = "\x09\xFF\x00\x60\x52\x57\x2D\x42\x4C\x45",
.SCAN_RESP_DATA_TAG_LEN = 10, // SCAN_RESP_DATA
那么可能导致nvds_get失败了什么?
谢谢,
安东尼。
嗨Antony42,
我们会看看,并在我们有新闻时立即通知您。
Thanks MT_dialog
嗨Antony42,
It seems that there is a bug in the procedure for fetching the scan response data from the nvds, this will be fixed in the future release of the SDK.
Thanks MT_dialog
还有一个疑问醒来up from deep sleep is an interrupt like push buttton (as of in proximity_reporter_fh) mandatory ? is there anyway to wake from sleep after some confined period ??
你好HRG,有两个好documents here that will tell you how to use the sleep mode in synchronous (ble timer) and asynchronous (ext interrupt) mode.
Sleep mode configuration
http://support.dialog-seminile.com/system/files/restricted/um-b-006.pdf.
http://support.dialog-seminiondiondiondiond.com/resource/b-026-external-wake-mechanisms.
BR JE_Dialog
谢谢你je_dialog !!
also please respond to these questions also
是否有任何main(),如adv_start,adv_stop等所有这些函数都被调用??因为存在恰好广告顺序操作的混淆!
而且您所说的值0xAA应该自动增量。但是由于它是一种宏定义的格式,如何在运行时更改值??!
Thankyou
嗨HRG,
请看我上面的回复。
谢谢你mhv_dialog !!
你好Dialog team
I modified the proximity application to advertise dynamic manufacture data in advertising field and it was working fine in debugging mode in SRAM. The app will advertise once and goes to sleep and when i press the button K1 it will advertise again with incremented data once and goes to sleep.This was working fine in debugging mode. Now i burned the same program in OTP.The problem arised !!
它是广告良好的。但是制造数据在K1的唤醒时不会递增!!那么这里的问题是什么!??
Could you please asap explain why such problem arise ???
对话团队为什么到目前为止没有回复!?
hrg, what sleep mode do you use ? note that if you use Deep Sleep, all SRAM contents are lost : so anything you keep as a counter in SRAM will be disapear. SRAM is re-loaded from OTP on wake from deep sleep.
如果使用延长睡眠,SRAM保持活力。
BR JE_Dialog
谢谢你的回复je_dialog。
You are right !! i used deep sleep mode (by default in proximity reporter_fh it was deep sleep mode).! I burned the otp too ! during OTP header i have enabled Jtag.So is can we change it to extended sleep mode through Spota or any other way ??
你好HRG,那不是那么直的......之后实施Spota是不可能的,因为需要包括在项目构建和你的Arleady Burnt OTP中。最快的方法将与另一个设备(在电路板上交换)交换,我建议将所有内容保存在开发模式中,直到您完全确定您需要您需要的功能。或者,您可以使用闪存板上的基本开发套件,您可以使用闪存,永久使用闪存(并且只为OTP刻录Bootlader)。
BR JE_Dialog
Dialog team,
I could use your help on this as well. I would like to do the same thing hrg described, however I am using the latest version of the SDK, V5.0.3.
我也在使用Proximity Reporter应用程序。
我无法在深睡眠中更新制造商的特定数据,也不是调试模式。我每一次获得默认制造商特定数据'dlg-ble'。
将极大地欣赏到这一点的更新。
你好jd@exp-eng,
When you are in development mode and your project is configured in deep sleep the 580 doesn't actually turns off its sysram so, even if you haven't saved your values in a retention memory area you should be able to see your values changing over the scan response string, if you are actually changing them. The scan response data is loaded through the NVDS in most of the 580 examples using the below command:
app_easy_gap_adv_read_from_NVDS (&cmd->info.host.scan_rsp_data_len,&cmd->info.host.scan_rsp_data[0], SCAN_RSP_DATA_LEN, SCAN_RSP_DATA_LEN+1,
NVDS_TAG_APP_BLE_SCAN_RESP_DATA); in the app_easy_gap_undirected_advertise_start_create_msg() function. Please have a look at this function and replace the command
with your string manipulation function.
Thanks MT_dialog