beacon diss set dev name

21 posts / 0 new
Last post
安东尼42.
离线
Last seen:5年6个月前
Joined:2015-07-17 08:21
beacon diss set dev name

你好,

  • 如何添加写开发名称和读取ori dev name特征
  • why Write Dev Name and Read Ori Dev Name use same index ?

    dis_idx_ieee_char,
    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),
    sizeof(dist_pnp_id_char),(uint8_t *)和diss_pnp_id_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),
    sizeof(dist_pnp_id_char),(uint8_t *)和diss_pnp_id_char},
    //读写dev name特征值
    [DIS_IDX_PNP_ID_VAL] = {ATT_CHAR_PNP_ID, PERM(RD, ENABLE), DIS_PNP_ID_LEN, 0, NULL},

    //读取ori dev name特征声明
    [DIS_IDX_PNP_ID_CHAR] = {ATT_DECL_CHARACTERISTIC, PERM(RD, ENABLE), sizeof(diss_pnp_id_char),
    sizeof(dist_pnp_id_char),(uint8_t *)和diss_pnp_id_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},

    • 另一个问题:我可以在普通中添加128位特征吗?

    为什么?智能手机应用程序需要从128bit uuid中读取写开发名称。
    我可以在原始代码上更改基础,还是我必须重写spotar_create_db_req_handler()等代码?
    谢谢!

    设备:
    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony42,

    嗨Antony42,

    我想你想从智能手机改变设备的名字是正确的吗?您必须将Permmisions更改为适当的特征,并将写命令处理到DA对于特定IDX,使用Sample128作为引用(Gattc_Write_cmd_ind_handler)。我想你可以,但你要改变一个由sig定义的配置文件。

    Thanks MT_dialog

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨,mt_dialog,

    嗨,mt_dialog,
    absolutely right !

  • 实际上我需要从智能手机配置多个参数,包括:dev名称,信标uuid,主要ID,次要ID,测量功率,adv间隔,用户定义
  • and I need to save these info to flash.
    你能给我一些建议吗?
    Thanks a lot !

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony42,

    嗨Antony42,

    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

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog,

    嗨mt_dialog,
    我尝试了,但在初始化数据时,我无法获得正确的句柄索引。
    另一个问题:
    为什么产品标题以下结构中的不同与AN-B-010 Page10不同?
    from beacon ref project:
    #define product_header_position 0x1f000.
    // Suota的产品标题
    struct product_header.
    {
    UINT8_T签名[2];
    uint8_t版本[2];
    uint32_t reserved[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;

    我打印数据,看起来像:
    0x70 0x52 0x0 0x1 0x0 0x80 0x0 0x0 0x0 0x30 0x1 0x0 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

    谢谢!

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony42.

    嗨Antony42.

    你是什​​么意思是不同的,你无法看到偏移量下的其他字段#2字段?这是因为其他字段没有从信标应用程序中使用。您无法读取CONFIG_OFFSET,因为您必须在SPI中加载标题才能读取它,您可以使用SMART SCIPPETS专有头程序员来设置CONFIG_OFFSET和BEACON配置。

    谢谢mt_dialog。

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog,

    嗨mt_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表示使用“保留”字段的前四个字节来存储配置地址,

  • what product_header.config_offset for?
  • 我需要添加到以下标题TXT文件中的哪个字段?
  • struct product_header.
    {
    UINT8_T签名[2];
    uint8_t版本[2];
    uint32_t reserved[4];
    uint32_t config_offset;
    };
    现在我的标题文件(.txt文件)是:
    2 signature Product header signature. Must contain 0x7052
    2版本产品标题版本
    4 offset1 Memory offset of image header #1 in LE format
    4 offset2在Le格式中图像标题#2的内存偏移量
    用专有标题编程器打开,并设置右侧值7052,0001,00800000,00300100。

    谢谢!

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony42,

    嗨Antony42,

    产品标题应为辅助引导程序标题的形式。您可以使用12byte offset(bdaddress)或放置一些填充,并使用17byte(保留)偏移量以放置配置标题格式的地址。product_header.config_offset将包含驻留的偏移量,它位于配置标题的地址。您应该在product_header.txt中添加额外的字段,以便放置配置头文件的地址。配置偏移将指向配置标题。配置数据位于字节偏移64中的配置标题下方。

    Thanks MT_dialog

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog,

    嗨mt_dialog,
    我不完全明白。

    1. 第二个引导加载程序中的标题是:
    2. //产品标题结构
      typedef struct __productheader {
      uint8 signature[2];
      UINT8版本[2];
      UINT32_T OFFSET1;
      uint32_t offset2;
      }s_productHeader;

    3. 在Beacon Ref中是:
    4. // Suota的产品标题
      struct product_header.
      {
      UINT8_T签名[2];
      uint8_t版本[2];
      uint32_t reserved[4];
      uint32_t config_offset;//为什么这与上面不同?
      };

    5. in AN-B-010 page 10:
    6. seems a fully version.
      在这个文件中12 -31 reserved
      32-37 BD地址......

  • 当我尝试在Product_header.txt中添加一个字段时,它会提醒错误,“最多只支持4个参数!”,所以怎么做?
  • can I just use a fixed address in the program, so always read config data from 0x1f000 + sizeof(struct product_header) ?
  • 谢谢!

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony42.

    嗨Antony42.

    以上2个结构是不同的,因为在信标中,我们没有指定图像偏移,我们只添加一些
    填充UINT32_T保留[4]。

    1-uint32_t用于图像offset1,2-uint32_t的图像offset2,3-4 uint32_t为dbaddress和一些额外的
    保留数据。

    在信标应用程序中,如果配置已启用,则必须在产品中添加额外的字段
    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 Integer ConfigOffset配置

    是的,我想你可以使用硬编码地址并从那里读取配置数据。

    Thanks MT_dialog

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog,

    嗨mt_dialog,

    1. 我想将LED添加到信标,当连接的设备然后打开LED时。
      我在app_connection_func中调用LED_ON(),设置PIN低,
      但是LED只有闪烁一次,我找不到IO输出设置得高?
    2. 在app_button_press_callback()

      app_adv_stop();
      switch(app_advertise_mode)
      {
      案例GAPM_ADV_NON_CONN:

      app_advertise_mode = gapm_adv_undirect;
      休息;

      案例GAPM_ADV_UNDIRECT:
      app_advertise_mode = gapm_adv_non_conn;
      休息;
      }
      这将改变广告模式,但它不会调用app_adv_start(),因此当广告模式将改变?

    3. 我什么时候需要定义cfg_connectable_adv_mode?
      can you explain more about app_asynch_trm()

      此Func还有代码:
      switch(app_advertise_mode)
      {
      案例GAPM_ADV_NON_CONN:

      app_advertise_mode = gapm_adv_undirect;
      休息;

      案例GAPM_ADV_UNDIRECT:
      app_advertise_mode = gapm_adv_non_conn;
      休息;
      }
      I need to add to button to change the advertise mode.

    4. when I set a timer(500ms) in app_button_press_callback,
      定时器立即触发,然后我设置了一个标志,
      在下文中,工作正常,为什么?
      app_adv_undirect_complete
      {
      if(标志){
      set_timer();
      国旗= false;
      }
      在计时器处理程序中,我清除了另一个计时器,不行,
      设置上面的另一个标志,我成功清除了计时器,为什么?

    谢谢,
    安东尼

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony,

    嗨Antony,

    您可以定义您的设备将在DA14580_Config中的可连接工作中工作.H检查您正在使用的Dev套件并定义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_CONNECTABLE_ADV_MODE作为我在非可连接模式之间提到的设备周期。由于App_adv_stop()发出的app_adk.c案Gapm_adv_undirect,该设备再次启动广告案例Gapm_adv_non_conn。如果您尝试从外部中断设置计时器,请在App_button_press_cb()函数中建议SmartTag参考设计,并检查此外常见问题解答http://support.dialog-semicondiondiondum/faq-page#n1508.

    Thanks MT_dialog

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog.

    嗨mt_dialog.

    1. 在app_adv_undirect_complete()中:
      调用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.
    2. 如您所提到的,“由于APP_ADV_UNDIRECT_COMPLETE(),该设备再次启动广告
      从App_adv_stop()发出,
      现在我需要存储在数组中10个不同的进阶数据,并通告阵列[0],然后阵列[1] ...
      每个都是32字节。
      我认为将代码添加到app_adv_undirect_complete()是一个不错的选择,
      我可以单独设置adv间隔,并在app_restart_adv_timer处理程序中更改adv数据。
      所以如何在每次广告后调用app_adv_undirect_complete()?
      这是可能还是其他更好的解决方案?

    谢谢,
    安东尼

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony,

    嗨Antony,

    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

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨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);

    • 我需要在X MS之后宣传Adv_Data_Array1,宣传Adv_Data_Array2一次,。。。
    • 我如何知道一个广告已经完成了?
      when should I call app_adv_stop()?

    谢谢,
    安东尼

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony42,

    嗨Antony42,

    当DA靴子您可以启动并启动计时器时,当定时器过去时,您可以调用app_adv_stop(),当广告停止时,app_adv_undirect_complete将执行(此函数在调用app_adv_stop之后执行opp_adv_stop是未连接的广告或不可连接之后)然后你可以调用app_adv_start();如果您喜欢填充广告字符串的位置,您可以在App_adv_Func()中更改广告字符串。

    Thanks MT_dialog

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog,

    嗨mt_dialog,
    谢谢你的回复,我会尝试一下。
    when I call app_adv_start(), the advertise start, not once, it is continuously,

    1. 内核中有一个计时器重启广告,对吗?
    2. 如何保证广告Data1只有一次,那么广告Data2,Data3 ...

    谢谢,
    安东尼

    MT_dialog
    离线
    Last seen:2个月1周前
    Staff
    Joined:2015-06-08 11:34
    嗨Antony,

    嗨Antony,

    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

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog,

    嗨mt_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!

    谢谢,
    安东尼

    安东尼42.
    离线
    Last seen:5年6个月前
    Joined:2015-07-17 08:21
    嗨mt_dialog,

    嗨mt_dialog,

    谢谢你的回复。
    现在它工作正常,我在button_press_callback设置标志()和设置/清零定时器app_adv_undirect_complete()。
    我也发现了两个旧但有用的主题:
    http://support.dialog-semicondiondiondum/ketcerset-not-execute why.
    http://support.dialog-semicondiondiond.com/problem-about-wakeup-timer-inter ...

    顺便说一下,如果我使用ext睡眠,则无需使用__attribute __((部分(“保留_mem_area0”),zero_init)
    is this correct?

    谢谢,
    安东尼

    mhv_dialog
    离线
    Last seen:2个月2天前
    Staff
    Joined:2013-12-06 15:10
    你好,

    你好,

    那是正确的。在延长睡眠中,保留包含全局变量的RAM中的所有数据。

    Topic locked