This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] LP-CC2651R3SIPA:CC2651R3SIPA:特征值长度

Guru**** 2587365 points
Other Parts Discussed in Thread: CC2651R3SIPA

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1298014/lp-cc2651r3sipa-cc2651r3sipa-characteristic-value-length

器件型号:LP-CC2651R3SIPA
主题中讨论的其他器件:CC2651R3SIPA

您好!

我正在将 simple_peripheral_LP_CC2651R3SIPA_tirtos7_ticlang 用作启动项目。 在我将特征值 Length 更改成> 22个字节之前、一切都正常。

原始代码(正常工作: IMPLEPROFILE_CHAR5_LEN = 5 , 即< 22)

// Length of Characteristic 5 in bytes
#define SIMPLEPROFILE_CHAR5_LEN           5

// Simple Profile Characteristic 5 Properties
static uint8 simpleProfileChar5Props = GATT_PROP_READ;

// Characteristic 5 Value
static uint8 simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] = { 0, 0, 0, 0, 0 };

// Simple Profile Characteristic 5 User Description
static uint8 simpleProfileChar5UserDesp[17] = "Characteristic 5";

修改后的代码(崩溃:  SIMPLEPROFILE_CHAR5_LEN = 23 , 即>22)

// Length of Characteristic 5 in bytes
#define SIMPLEPROFILE_CHAR5_LEN           23

// Simple Profile Characteristic 5 Properties
static uint8 simpleProfileChar5Props = GATT_PROP_READ;

// Characteristic 5 Value
static uint8 simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] = { 0, 0, 0, 0, 0 };

// Simple Profile Characteristic 5 User Description
static uint8 simpleProfileChar5UserDesp[17] = "Characteristic 5";

是否有过在哪里定义该限制以及如何将其增加到至少64字节的想法?

提前感谢您!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,Simbasoft,

    感谢您的联系。

    您能否提供有关崩溃时遇到的问题的更多详细信息(CCS 错误/警告日志)?

    我猜问题在于 simpleProfileChar5数组的初始化。 size (23)与初始化元素的数量不匹配。

    static uint8 simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] = { 0, 0, 0, 0, 0 };

    Br、

    大卫。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢你,大卫!

    否、初始化不是问题:将数组初始化为小于或等于23个元素(即5 < 23)的若干元素-这不是编译错误。

    崩溃意味着系统故障(停止运行)。 问题可能是在 SDK/BLE Stack 中某处定义的超时或特性值长度限制。  

    SDK:simplelink_cc13xx_cc26xx_sdk_7_10_00_98

    在运行时第629行崩溃,在该函数中-参见下图。

    bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle,
                                        gattAttribute_t *pAttr,
                                        uint8_t *pValue, uint16_t *pLen,
                                        uint16_t offset, uint16_t maxLen,
                                        uint8_t method);

    该函数是回调函数。 调用同一函数的人没有分配足够的存储器"pAttr->pValue"、

    // Simple Profile Service Callbacks
    // Note: When an operation on a characteristic requires authorization and
    // pfnAuthorizeAttrCB is not defined for that characteristic's service, the
    // Stack will report a status of ATT_ERR_UNLIKELY to the client.  When an
    // operation on a characteristic requires authorization the Stack will call
    // pfnAuthorizeAttrCB to check a client's authorization prior to calling
    // pfnReadAttrCB or pfnWriteAttrCB, so no checks for authorization need to be
    // made within these functions.
    CONST gattServiceCBs_t simpleProfileCBs =
    {
      simpleProfile_ReadAttrCB,  // Read callback function pointer
      simpleProfile_WriteAttrCB, // Write callback function pointer
      NULL                       // Authorization callback function pointer
    };
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,Simbasoft,

    只是为了进行完整性检查、您是否可以尝试使用所有元素初始化数组?

    此外、您的项目中的 MAX_PDU_SIZE 是多少?

    您是否使用 Simple Connect 应用程序或其他设备作为中央设备? 特征5用于粘接(密钥传递)。

    Br、

    大卫。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    David、它在 SIMPLEPROFILE_CHAR5_LEN 22时工作、其他一切都相同; 仍然以相同的方式初始化。

    TI 示例代码中存在一个基本问题- Profile_Read str52函数缺少鲁棒性的基础知识。

    // Length of Characteristic 5 in bytes
    #define SIMPLEPROFILE_CHAR5_LEN           22
    
    // Simple Profile Characteristic 5 Properties
    static uint8 simpleProfileChar5Props = GATT_PROP_READ;
    
    // Characteristic 5 Value
    static uint8 simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] = { 0, 0, 0, 0, 0 };
    
    // Simple Profile Characteristic 5 User Description
    static uint8 simpleProfileChar5UserDesp[17] = "Characteristic 5";

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,Simbasoft,

    我在类似的板上复制了这些更改、但没有相同的问题。 我将在和您一样的板子上进行复制。 不过、我想问您是否可以确认您在项目中修改的唯一内容是 SIMPLEPROFILE_CHAR5_LEN、以及 MAX_PDU_SIZE 是什么。

    您能否尝试刷写以下.hex 文件并检查是否出现同样的问题?

    e2e.ti.com/.../simple_5F00_peripheral_5F00_LP_5F00_CC2651R3SIPA_5F00_tirtos7_5F00_ticlang.hex

    Br、

    大卫。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我已经尝试增加 PDU 大小没有帮助。

    "我不是很喜欢你。" 请发送完整的项目源代码以及与之关联的 DSK 版本。

    目前、我正在努力使我们的项目具有22字节限制。 我将在一两周内再谈这个问题。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 David:

    我使我们的应用程序具有22个字节限制、不打算弄清楚导致此类限制的原因。

    您可以关闭此问题-非常感谢您的帮助。

    此致。