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.

[参考译文] CC2540:timeAppHdlCache [timeAppEndHdlIdx]= build_uINT16 (p[0]、p[1])-1;

Guru**** 2587365 points


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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/595292/cc2540-timeapphdlcache-timeappendhdlidx-build_uint16-p-0-p-1---1

器件型号:CC2540

 "结束句柄比特征声明的句柄少一个"、这个词的确切含义是什么? 有人能解释更多的细节, 我对此感到非常困惑,我真是个大傻瓜! 感谢您的参与。

该代码摘自 TI 提供的 BloodPressure 、位于.../ble/BloodPressure/Source/timeapp_discovery.c

静态 uint8 TimeAppDiscCurrent Time( uint8状态,gattMsgEvent_t *pMsg )

(笑声)
  案例 DISC_CURR_TIME_CHAR:
(笑声)
  //如果要查找末端手柄
  if ( timeAppEndHdlIdx=0 )
  {
    //结束句柄比特征声明的句柄少一个
    timeAppHdlCache [timeAppEndHdlIdx]= build_uINT16 (p[0]、p[1])-1;

    timeAppEndHdlIdx = 0;

(笑声)

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

    在这种情况下、对特征声明进行了一些假设、这样我们就可以通过减去声明的1来计算结束句柄。

    谢谢、
    Fredrik
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    感谢 Fredrik! 根据您的提示,我终于明白了,程序告诉我们进入函数的下一个转弯,Declare 的句柄将为+1,因此当前转弯将为-1。 简而言之、下一个转弯将关闭前一个转弯