你好,
why Write Dev Name and Read Ori Dev Name use same index ?
DIS\u IDX\u IEEE\u字符,
DIS_IDX_IEEE_VAL,
dis_idx_pnp_id_char,
DIS_IDX_PNP_ID_VAL,
DIS_IDX_NB,
// PnP ID Characteristic Declaration
[DIS_IDX_PNP_ID_CHAR] = {ATT_DECL_CHARACTERISTIC, PERM(RD, ENABLE), sizeof(diss_pnp_id_char),
大小(diss\u pnp\u id\u char),(uint8\u t*)和diss\u pnp\u id\u char},
//PnP ID特征值
[DIS_IDX_PNP_ID_VAL] = {ATT_CHAR_PNP_ID, PERM(RD, ENABLE), DIS_PNP_ID_LEN, 0, NULL},
//读写dev name特征声明
[DIS_IDX_PNP_ID_CHAR] = {ATT_DECL_CHARACTERISTIC, PERM(RD, ENABLE), sizeof(diss_pnp_id_char),
大小(diss\u pnp\u id\u char),(uint8\u t*)和diss\u pnp\u id\u char},
//读写dev name特征值
[DIS_IDX_PNP_ID_VAL] = {ATT_CHAR_PNP_ID, PERM(RD, ENABLE), DIS_PNP_ID_LEN, 0, NULL},
//读取设备名称特征声明
[DIS_IDX_PNP_ID_CHAR] = {ATT_DECL_CHARACTERISTIC, PERM(RD, ENABLE), sizeof(diss_pnp_id_char),
大小(diss\u pnp\u id\u char),(uint8\u t*)和diss\u pnp\u id\u char},
// Read Ori Dev Name Characteristic Value
[DIS_IDX_PNP_ID_VAL] = {ATT_CHAR_PNP_ID, PERM(RD, ENABLE), DIS_PNP_ID_LEN, 0, NULL},
- 另一个问题:我可以在diss中添加128位特征吗?如何添加?
为什么?智能手机应用程序需要从128bit uuid中读取写开发名称。
我可以在原始代码的基础上进行更改,还是必须重写spotar\u create\u db\u req\u handler()之类的代码?
谢谢您!
嗨,安东尼42,
我猜你想把设备的名字从智能手机改过来,对吗?您必须将permmisions更改为适当的特征,并将写入命令处理为特定IDX的da,使用SAMPLE128作为参考(gattc\u write\u cmd\u ind\u handler)。我想你可以,但是你要改变一个由SIG定义的配置文件。
Thanks MT_dialog
嗨,mt_dialog,
absolutely right !
and I need to save these info to flash.
你能给我一些建议吗?
Thanks a lot !
嗨,安东尼42,
I would advise you not to change the DISS profile (you may have compatibility problems with other devices), instead you can include it to your services and create a new custom profile (SAMPLE128 tutorial) with the extra informations you need. As i ve mentioned before the DISS is a service defined from the bluetooth SIG. You can use the Beacon project to handle the advertising of your message.
Thanks MT_dialog
嗨,MT\u dialog,
我尝试了,但在初始化数据时,我无法获得正确的句柄索引。
另一个问题:
为什么产品标题以下结构中的不同与AN-B-010 Page10不同?
from beacon ref project:
#定义产品标题位置0x1F000
// Suota的产品标题
结构产品标题
{
单位签名[2];
uint8_t版本[2];
uint32_t reserved[4];
uint32\u t配置\u偏移量;
};
结构产品标题;
spi\u flash\u read\u data((uint8\u t*)&p\u header,(unsigned long)PRODUCT\u header\u POSITION,(unsigned long)sizeof(struct PRODUCT\u header));
app\u config\u header\u offset=p\u header.config\u offset;
我把数据打印出来,看起来像:
0x70 0x52 0x0 0x1 0x0 0x80 0x0 0x0 0x0 0x0 0x30 0x1 0x0 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
与AN-B-010相同(签名7052,版本0100,偏移1,偏移2)
but p_header.config_offset = ?
struct config_header is also different from AN-B-010
谢谢您!
嗨Antony42
什么意思不同,你看不到偏移量2字段下的其他字段?这是因为Beacon应用程序没有使用其他字段。您不能读取config\u偏移量,因为您必须在SPI中加载头才能读取它,您可以使用Smart Snippets专有头程序员来设置config\u偏移量和信标配置。
谢谢你的对话。
嗨,MT\u dialog,
在UM-B-019(信标参考)9.7.1内存映射中:
Configuration storage uses the memory map of the dual image boot loader. More specifically, it uses
the first four bytes of the ‘Reserved’ field (byte offset 12) in the Product Header, as described in
[6]的第6.1节定义了配置区域的内存地址。地址必须指向
the start of an SPI Flash sector and no other information must be stored in the same sector.
[6]第6.1节在哪里
UM表示使用“保留”字段的前四个字节来存储配置地址,
结构产品标题
{
单位签名[2];
uint8_t版本[2];
uint32_t reserved[4];
uint32\u t配置\u偏移量;
};
现在我的头文件(.txt文件)是:
2 signature Product header signature. Must contain 0x7052
2版本产品标题版本
4 offset1 Memory offset of image header #1 in LE format
4偏移量2 LE格式的图像头#2的内存偏移量
用专用头编程序打开并设置正确的值70520001008000000000300100。
谢谢您!
嗨,安东尼42,
产品标题应为辅助引导程序标题的形式。您可以使用12byte offset(bdaddress)或放置一些填充,并使用17byte(保留)偏移量以放置配置标题格式的地址。product_header.config_offset将包含驻留的偏移量,它位于配置标题的地址。您应该在product_header.txt中添加额外的字段,以便放置配置头文件的地址。配置偏移将指向配置标题。配置数据位于字节偏移64中的配置标题下方。
Thanks MT_dialog
嗨mt_dialog,
我不完全明白。
//产品标题结构
typedef结构\uuu产品标题{
uint8 signature[2];
UINT8版本[2];
uint32\t抵消1;
uint32_t offset2;
}s_productHeader;
// Suota的产品标题
结构产品标题
{
单位签名[2];
uint8_t版本[2];
uint32_t reserved[4];
uint32\u t配置\u偏移量;//为什么这与上面不同?
};
seems a fully version.
在这个文件中12 -31 reserved
32-37 BD地址......
谢谢您!
嗨Antony42
以上2个结构是不同的,因为在信标中,我们没有指定图像偏移,我们只添加一些
填充UINT32_T保留[4]。
1-uint32\t用于图像偏移量1,2-uint32\t用于图像偏移量2,3-4 uint32\t用于数据地址和一些附加的
保留数据。
在信标应用程序中,如果启用了配置,则必须在产品中添加一个额外字段
header....configOffset for instance. Then after you make the product_header.txt you can go from the smart
片段工具并将值添加到相应的字段。app_read_config_header会找到
Product_Header并读取配置标题的Config_offset ......从App_Read_Config
data will populate the corresponding struct with the configuration data. You can make the product header to
对应于这样的结构:
Create a product_header.txt file and add the following fields
2字符串签名产品标题签名(7052)
2 String Version Product Header Version
16整数保留填充
4整数配置偏移配置
是的,我想您可以使用硬编码地址并从那里读取配置数据。
Thanks MT_dialog
嗨mt_dialog,
我在app_connection_func中调用LED_ON(),设置PIN低,
但led只闪烁了一次,我找不到io输出被设置在哪里高?
app_adv_stop();
switch(app_advertise_mode)
{
案例GAPM\ U ADV\ U NON\ U CONN:
app\u advised\u mode=GAPM\u ADV\u UNDIRECT;
中断;
案例GAPM_ADV_UNDIRECT:
app_advertise_mode = gapm_adv_non_conn;
中断;
}
这将改变广告模式,但它不会调用app_adv_start(),因此当广告模式将改变?
can you explain more about app_asynch_trm()
此Func还有代码:
switch(app_advertise_mode)
{
案例GAPM\ U ADV\ U NON\ U CONN:
app\u advised\u mode=GAPM\u ADV\u UNDIRECT;
中断;
案例GAPM_ADV_UNDIRECT:
app_advertise_mode = gapm_adv_non_conn;
中断;
}
I need to add to button to change the advertise mode.
计时器被立即触发,然后我设置了一个标志,
在下文中,工作正常,为什么?
app_adv_undirect_complete
{
if(标志){
设置计时器();
国旗= false;
}
在计时器处理程序中,我清除了另一个计时器,不正常,
设置上面的另一个标志,我成功清除了计时器,为什么?
谢谢,
安东尼
你好,安东尼,
您可以在da14580\u config.h中定义您的设备将在可连接状态下工作检查您正在使用的开发工具包并定义cfg_connectable_adv_mode.in there. You dont need a button to change to connectable mode the device will rotate between connectable and non-connectable mode if the CFG_CONNECTABLE_ADV_MODE is defined. If its not defined then you have to use a button in order to change the adv mode (there is one defined). I suppose that you are using sleep, when your device wakes up the pins return to the state the periph_init() function commands....if you want to keep the button lit you must place a variable that will remember the previous state of your LED and set the coresponding value everytime your da wakes up. In app_asynch_trm if you defined theCFG\u CONNECTABLE\u ADV\u MODE正如我之前提到的,设备在非连接模式和可连接模式之间循环。设备再次开始广告,因为app\u adv\u undirect\u complete()是从app\u adv\u stop()发出的检查app\u task.c case GAPM\u adv\u undirect;case GAPM \u ADV \u NON \u CONN.如果您试图从外部中断设置计时器,请在app \u button \u press \u cb()函数中建议SmartTag参考设计,并检查此常见问题解答http://support.dialog-semicondiondiondum/faq-page#n1508..
Thanks MT_dialog
嗨mt_dialog.
调用app_timer_set(app_restart_adv_timer,task_app,timer_ticks)重新启动adv,
这是定期宣传的方法吗?
I set a breakpoint in this func, seems this function was not called, but app_adv_stop() will do.
从App_adv_stop()发出,
现在我需要在数组中存储10个不同的adv数据,并宣传阵列[0],然后阵列[1] ...
每个都是32字节。
我认为将代码添加到app_adv_undirect_complete()是一个不错的选择,
我可以单独设置adv间隔并在APP\u RESTART\u adv\u TIMER处理程序中更改adv数据。
那么,如何让app\u adv\u undirect\u complete()在每次发布广告后调用呢?
这是可能还是其他更好的解决方案?
谢谢,
安东尼
你好,安东尼,
The app_adv_undirect() is executed right after adv_stop() is finished and sets the timer in order to start advertising again, just tested, please set your breakpoint on the if statement. Yes you can change the advertise data when the advertising stops. The app_adv_undirect_complete is called every time you stop the advertise.
Thanks MT_dialog
嗨mt_dialog.
In the app_restart_adv_timer_handler:
app_adv_start();
app_adv_stop()//我可以在这里添加它来调用app_adv_undirect_complete吗?
return (KE_MSG_CONSUMED);
when should I call app_adv_stop()?
谢谢,
安东尼
嗨,安东尼42,
当DA靴子您可以启动并启动计时器时,当定时器过去时,您可以调用app_adv_stop(),当广告停止时,app_adv_undirect_complete将执行(此函数在调用app_adv_stop之后执行opp_adv_stop是未连接的广告或不可连接之后)然后你可以调用app_adv_start();如果您喜欢填充广告字符串的位置,您可以在App_adv_Func()中更改广告字符串。
Thanks MT_dialog
嗨,MT\u dialog,
谢谢你的回复,我会尝试一下。
when I call app_adv_start(), the advertise start, not once, it is continuously,
谢谢,
安东尼
你好,安东尼,
The advertising procedure is continious, meaning, if you dont send a cancelling command the advertising will continue. If you want to rotate between the 3 advertising strings you can make a switch case in the advertsing function check the current advertising mode and switch to next mode (each mode loads a different advertising string). When the advertsing string is set, a timer that specifies how long the device will advertise in specific mode will be set also. When the timer elapses, change the mode of advertising,调用app_adv_stop.and restart advertising when you get the indication that the advertising has been stopped.
Thanks MT_dialog
嗨,MT\u dialog,
非常感谢你!
它正在工作。
在app_adv_undirect_complete()
{
app_set_timer(x,y);
app_adv_start();
}
在Timer Handler()
{
app_adv_stop();
}
我将计时器设置为相同的值,时间间隔为100ms,
and from the sniffer I can see that each adv data only advertising once!
谢谢,
安东尼
嗨,MT\u dialog,
谢谢你的回复。
现在它可以正常工作,我在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...
顺便说一下,如果我使用ext sleep,就不需要使用uu attribute(section(“retention\u mem\u area0”),zero\u init)
is this correct?
谢谢,
安东尼
你好,
那是正确的。在延长睡眠中,保留包含全局变量的RAM中的所有数据。