夏威夷群岛 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.adv\u data,&data[0],cmd->info.host.adv\u data\u len); 所以我可以关闭NVDS\U支持, 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 (if(nvds\u get(nvds\u TAG\u APP\u BLE\u SCAN\u RESP\u DATA,&cmd->info.host.SCAN\u rsp\u DATA\u len, &cmd->info.host.scan\u rsp\u data[0])!=NVDS(正常) 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\u失败呢?
还有一个疑问要唤醒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.
谢谢你回复我的对话。 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 ??
-实际上,我需要在广告期间更新每个广告事件的扫描响应字段。
-例如,在通电期间,扫描数据为00,因此对于每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\u start、adv\u stop等所有函数?因为广告顺序操作发生的位置存在混乱!!
正如您所说的,0xAA值应该自动递增。但是由于它是宏定义的格式,如何在运行时更改值??!
嗨,hrg,
app\u adv\u start()在app.c中定义。它使用app_adv_func()来构建advertisment命令,并最终将该命令发送到GAP堆栈。app\u adv\u start()被称为几个地方。在设备配置完成后第一次调用它(app\u set\u dev\u config\u complete\u func())。当中央设备与设备断开连接时,也称为。
0xAA doesn't increment austomatically. Your application would have to that.
下面是在app\u adv\u func()函数中动态更改广告内容的示例。我以iBeacon为例,将在别处定义的主键和次键加载到广告数据字符串中:
///////////代码段开始
///////////Code Snippet end
您好!MHv_dialog,
I can change the adv data as you wrote
memcpy(&cmd->info.host.adv\u data,&data[0],cmd->info.host.adv\u data\u len);
所以我可以关闭NVDS\U支持,
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
(if(nvds\u get(nvds\u TAG\u APP\u BLE\u SCAN\u RESP\u DATA,&cmd->info.host.SCAN\u rsp\u DATA\u len,
&cmd->info.host.scan\u rsp\u data[0])!=NVDS(正常)
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\u失败呢?
谢谢,
安东尼。
嗨,安东尼42,
我们会看一看,并让你知道,一旦我们有这个消息。
Thanks MT_dialog
嗨,安东尼42,
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-semiconductor.com/system/files/restricted/UM-B-006.pdf
http://support.dialog-semiconductor.com/resource/b-026-external-wake-mechanisms
BR JE_Dialog
谢谢你的对话!!
also please respond to these questions also
是否有main()调用adv\u start、adv\u stop等所有函数?因为广告顺序操作发生的位置存在混乱!!
正如您所说的,0xAA值应该自动递增。但是由于它是宏定义的格式,如何在运行时更改值??!
Thankyou
嗨,HRG,
请看我上面的回答。
谢谢你的对话!!
您好!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
谢谢你回复我的对话。
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是不可能的,因为这需要包含在项目构建中,而且您已经烧掉了OTP。最快的方法将是与另一个设备交换(交换在板上),我建议保持一切在开发模式,直到你完全确定你有你需要的功能。或者,您可以使用基本开发工具包,它在板上有一个闪存,在那里您可以使用闪存,也可以永久使用闪存(例如,仅将引导程序刻录到OTP中)。
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.
我也在使用邻近报告程序。
我无法在深度睡眠或调试模式下更新特定于制造商的数据。我每次都会得到默认的特定于制造商的数据“?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