Hi,
为什么写开发名称和读取ori dev name使用相同的索引?
DIS_IDX_IEEE_CHAR,
dis_idx_ieee_val,
dis_idx_pnp_id_char,
dis_idx_pnp_id_val,
dis_idx_nb,
// PNP ID特征声明
[dis_idx_pnp_id_char] = {att_decl_characterativom,perm(rd,启用),sizeof(dist_pnp_id_char),
sizeof(diss_pnp_id_char), (uint8_t *)&diss_pnp_id_char},
//PnP ID Characteristic Value
[dis_idx_pnp_id_val] = {att_char_pnp_id,perm(rd,启用),dis_pnp_id_len,0,null},
//读写dev name特征声明
[dis_idx_pnp_id_char] = {att_decl_characterativom,perm(rd,启用),sizeof(dist_pnp_id_char),
sizeof(diss_pnp_id_char), (uint8_t *)&diss_pnp_id_char},
//读写dev name特征值
[dis_idx_pnp_id_val] = {att_char_pnp_id,perm(rd,启用),dis_pnp_id_len,0,null},
//Read Ori Dev Name Characteristic Declaration
[dis_idx_pnp_id_char] = {att_decl_characterativom,perm(rd,启用),sizeof(dist_pnp_id_char),
sizeof(diss_pnp_id_char), (uint8_t *)&diss_pnp_id_char},
//读取ori dev name特征值
[dis_idx_pnp_id_val] = {att_char_pnp_id,perm(rd,启用),dis_pnp_id_len,0,null},
- another question: can I add a 128bit characteristic in diss, and how?
为什么?智能手机应用程序需要从128bit uuid中读取写开发名称。
can I change base on the original code, or do I have to rewrite the code like spotar_create_db_req_handler() ?
Thank you!
嗨Antony42,
I guess that you want to change the device's name from smartphone is that correct? You have to change the permmisions to the appropriate characteristics and handle the write commands to the da for the specific IDX, use SAMPLE128 as a reference (gattc_write_cmd_ind_handler). I suppose you can but you are going to change a profile that is defined by the SIG.
谢谢mt_dialog.
嗨,mt_dialog,
绝对正确 !
我需要将这些信息保存到Flash。
你能给我一些建议吗?
非常感谢 !
嗨Antony42,
我建议您不要更改普通的配置文件(您可能对其他设备有兼容性问题),而是可以将其与您的服务一起包含并创建新的自定义配置文件(Sample128教程),其中包含您需要的额外信息。正如我之前提到的那样,幻灯片是从蓝牙SIG定义的服务。您可以使用信标项目来处理您的邮件的广告。
谢谢mt_dialog.
嗨mt_dialog.,
我尝试了,但在初始化数据时,我无法获得正确的句柄索引。
another question:
为什么产品标题以下结构中的不同与AN-B-010 Page10不同?
来自Beacon Ref项目:
#define PRODUCT_HEADER_POSITION 0x1F000
// Suota的产品标题
struct product_header
{
uint8_t signature[2];
UINT8_T版[2];
UINT32_T保留[4];
uint32_t config_offset;
};
struct product_header p_header;
spi_flash_read_data((uint8_t*)&p_header, (unsigned long)PRODUCT_HEADER_POSITION, (unsigned long)sizeof(struct product_header));
app_config_header_offset = p_header.config_offset;
I printf the data, looks like:
0x70 0x52 0x0 0x1 0x0 0x80 0x0 0x0 0x0 0x30 0x1 0x0 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
与AN-B-010相同(签名7052,版本0100,偏移1,偏移2)
但是p_header.config_offset =?
struct config_header也与AN-B-010不同
Thank you!
嗨Antony42
你什么意思是不同的,你不能看到不her fields under the Offset #2 field? Thats because the other fields aren't being used from the Beacon application. You cant read the config_offset because you have to load the header in the SPI in order to read it, you can use the Smart Snippets Proprietary header programmer in order to set the config_offset and the beacon configurations.
谢谢mt_dialog.。
嗨mt_dialog.,
In UM-B-019 (beacon reference) 9.7.1 Memory map:
配置存储使用双映像引导加载程序的存储映射。更具体地说,它使用
如上所述,产品标题中的“保留”字段(Byte Offset 12)的前四个字节
section 6.1 of [6], to define the memory address of the configuration area. The address must point at
SPI Flash扇区的开始,并且没有其他信息必须存储在同一扇区中。
where is section 6.1 of [6]
UM表示使用“保留”字段的前四个字节来存储配置地址,
struct product_header
{
uint8_t signature[2];
UINT8_T版[2];
UINT32_T保留[4];
uint32_t config_offset;
};
now my header file(.txt file) is:
2签名产品标题签名。必须包含0x7052
2 version Product header version
4 LE格式的图像标题#1的offset1内存偏移
4 offset2 Memory offset of image header #2 in LE format
opened with proprietary header programmer and set the right value 7052,0001,00800000,00300100.
Thank you!
嗨Antony42,
产品标题应为辅助引导程序标题的形式。您可以使用12byte offset(bdaddress)或放置一些填充,并使用17byte(保留)偏移量以放置配置标题格式的地址。product_header.config_offset将包含驻留的偏移量,它位于配置标题的地址。您应该在product_header.txt中添加额外的字段,以便放置配置头文件的地址。配置偏移将指向配置标题。配置数据位于字节偏移64中的配置标题下方。
谢谢mt_dialog.
嗨mt_dialog,
I don't fully understand.
//产品标题结构
typedef struct __productHeader {
UINT8签名[2];
UINT8版本[2];
uint32_t offset1;
uint32_t offset2;
S_ProductHeader;
// Suota的产品标题
struct product_header
{
uint8_t signature[2];
UINT8_T版[2];
UINT32_T保留[4];
uint32_t config_offset;//为什么这与上面不同?
};
似乎是一个完整的版本。
在此文件12-31保留
32-37 BD地址......
Thank you!
嗨Antony42
以上2个结构是不同的,因为在信标中,我们没有指定图像偏移,我们只添加一些
填充UINT32_T保留[4]。
1-uint32_t for image offset1, 2-uint32_t for image offset2, 3-4 uint32_t for the dbaddress and some additional
reserved data.
In the beacon application if the CONFIGURATION is enabled you must add an extra field in the product
例如,标题.... configoffset。然后在您制作产品_header.txt之后,您可以从智能播放
片段工具并将值添加到相应的字段。app_read_config_header会找到
Product_Header并读取配置标题的Config_offset ......从App_Read_Config
数据将使用配置数据填充相应的结构。您可以使产品标题
correspond to the stuct like this:
创建一个product_header.txt文件并添加以下字段
2字符串签名产品标题签名(7052)
2字符串版本产品标题版本
16 Integer Reserved Reserved Padding
4 Integer ConfigOffset Config
Yes i suppose you can use a hardcoded address and read the configuration data from there.
谢谢mt_dialog.
嗨mt_dialog,
我在app_connection_func中调用LED_ON(),设置PIN低,
but the led only flash one time, I can not find where the io output was set high?
app_adv_stop();
Switch(app_advertise_mode)
{
case GAPM_ADV_NON_CONN:
app_advertise_mode = GAPM_ADV_UNDIRECT;
break;
案例GAPM_ADV_UNDIRECT:
app_advertise_mode = gapm_adv_non_conn;
break;
}
这将改变广告模式,但它不会调用app_adv_start(),因此当广告模式将改变?
你能解释一下关于app_asynch_trm()的更多信息吗?
此Func还有代码:
Switch(app_advertise_mode)
{
case GAPM_ADV_NON_CONN:
app_advertise_mode = GAPM_ADV_UNDIRECT;
break;
案例GAPM_ADV_UNDIRECT:
app_advertise_mode = gapm_adv_non_conn;
break;
}
我需要添加到按钮来更改广告模式。
the timer was triggered immediately, then I set a flag,
在下文中,工作正常,为什么?
app_adv_undirect_complete.
{
if(标志){
set_timer();
标志= false;
}
and in the timer handler, I clear another timer, not ok,
设置上面的另一个标志,我成功清除了计时器,为什么?
Thanks,
安东尼
Hi antony,
You can define that your device will work in connectable in da14580_config.h check the dev kit you are using and define thecfg_connectable_adv_mode.在那里。如果定义了CFG_CONECTABLE_ADV_MODE,则无需按钮更改为可连接模式,设备将在可连接和不可连接的模式之间旋转。如果未定义,则必须使用按钮以更改ADV模式(有一个定义)。我想你正在使用睡眠,当你的设备唤醒引脚返回句子的句子periph_init()函数命令....如果要保持按钮点亮,则必须放置一个将记住以前状态的变量每当您的da醒来时,LED并设置对应的值。在app_asynch_trm中,如果您定义了cfg_connectable_adv_mode.as i 've mentioned the device cycles between the non and connectable mode. The device starts advertising again because of the app_adv_undirect_complete() which is issued from the app_adv_stop() check the app_task.c case GAPM_ADV_UNDIRECT; case GAPM_ADV_NON_CONN. If you are trying to set a timer from an external interrupt please advice the SmartTag Reference design at the app_button_press_cb() function and check this also FAQhttp://support.dialog-semicondiondiondum/faq-page#n1508.。
谢谢mt_dialog.
嗨mt_dialog.
调用app_timer_set(app_restart_adv_timer,task_app,timer_ticks)重新启动adv,
这是定期宣传的方法吗?
我在这个func中设置了一个断点,似乎这个函数未调用,但app_adv_stop()将要做。
从App_adv_stop()发出,
现在我需要在数组中存储10个不同的adv数据,并宣传阵列[0],然后阵列[1] ...
每个都是32字节。
我认为将代码添加到app_adv_undirect_complete()是一个不错的选择,
I can set the adv interval individually and change adv data in APP_RESTART_ADV_TIMER handler.
so how to let app_adv_undirect_complete() be called after each advertising?
这是可能还是其他更好的解决方案?
Thanks,
安东尼
Hi antony,
app_adv_undirect()在Adv_Stop()完成后执行并将计时器设置为Timer以便再次启动广告,请在IF语句上设置您的断点。是的,您可以在广告停止时更改广告数据。每次停止广告时都会调用app_adv_undirect_complete。
谢谢mt_dialog.
嗨mt_dialog.
在app_restart_adv_timer_handler中:
app_adv_start();
app_adv_stop();//我可以在这里添加它来调用app_adv_undirect_complete吗?
return(ke_msg_consumed);
我应该何时调用app_adv_stop()?
Thanks,
安东尼
嗨Antony42,
当DA靴子您可以启动并启动计时器时,当定时器过去时,您可以调用app_adv_stop(),当广告停止时,app_adv_undirect_complete将执行(此函数在调用app_adv_stop之后执行opp_adv_stop是未连接的广告或不可连接之后)然后你可以调用app_adv_start();如果您喜欢填充广告字符串的位置,您可以在App_adv_Func()中更改广告字符串。
谢谢mt_dialog.
嗨mt_dialog.,
谢谢你的回复,我会尝试一下。
当我打电话给app_adv_start()时,广告开始,而不是一次,它是连续的,
Thanks,
安东尼
Hi Antony,
广告程序是持续的,意思是,如果您不发送取消命令,广告将继续。如果要在3广告字符串之间旋转,您可以在广告功能中制作开关盒检查当前的通告模式并切换到下一个模式(每个模式加载不同的广告字符串)。当设置广告字符串时,将设置指定设备在特定模式中宣传的长度的计时器。当计时器经过时,更改广告模式,调用app_adv_stop.并在获得广告已停止的指示时重新启动广告。
谢谢mt_dialog.
嗨mt_dialog.,
Thank you very much!
it is working now.
在app_adv_undirect_complete()
{
app_set_timer(x,y);
app_adv_start();
}
在Timer Handler()
{
app_adv_stop();
}
I set the timer the same value with adversitng interval (100ms),
从嗅探器中,我可以看到每个adv数据只广告一次!
Thanks,
安东尼
嗨mt_dialog.,
Thank you for yor reply.
现在它可以正常工作,我在button_press_callback()中设置标志,并在app_adv_undirect_complete()中设置/清除计时器。
我也发现了两个旧但有用的主题:
http://support.dialog-semicondiondiondum/ketcerset-not-execute why.
http://support.dialog-semiconductor.com/problem-about-wakeup-timer-inter...
by the way, if I use ext sleep there is no need to use __attribute__((section("retention_mem_area0"),zero_init)
这样对吗?
Thanks,
安东尼
Hi,
那是正确的。在延长睡眠中,保留包含全局变量的RAM中的所有数据。