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.

GATT_WriteLongCharValue 发送数据出错,求解!!!



hi, all; 

我在central端执行GATT_WriteLongCharValue操作, 但是他的返回值为fail 失败的原因为blePending0x16

具体代码如下:

/*这里获取notification事件的charhdl, 有进行跟踪,获取的值是正确的(和server端打印的一致)。 */

slave_block[i].ble_charhdl6= BUILD_UINT16( pMsg->msg.readByTypeRsp.dataList[0], pMsg->msg.readByTypeRsp.dataList[1] );       

     

      /* notification进行enable操作 */

      gattPrepareWriteReq_t req;

      req.handle = slave_block[i].ble_charhdl6 + 1;    /*  找到CCC的句柄 */

      req.len = 2;

      req.pValue[0] = LO_UINT16(SERVER_NOTIFICATION_ENABLE);    /* 0x01 */

      req.pValue[1] = HI_UINT16(SERVER_NOTIFICATION_ENABLE);     /* 0x00 */

      req.offset = 0;

 

      status = GATT_WriteLongCharValue( slave_block[i].ble_connhdl, &req, simpleBLETaskId );   /* 调用LONG函数进行写操作 */

                                                            /*  slave_block[i].ble_connhdl  这玩意也为0,感觉有点诡异,但在前面跟踪的时候确实为0 */

 

      if (status == SUCCESS) {

                 LCD_WRITE_STRING( "write success", HAL_LCD_LINE_3 );

      } else {

        LCD_WRITE_STRING( "write fail", HAL_LCD_LINE_3 );            /*  结局失败,原因码为 0x16 */

        SerialPrintValue("fail reason", status, 16);                           

        SerialPrintString("\r\n");

      }

我在server端的simpleProfile_WriteAttrCB GATT_CLIENT_CHAR_CFG_UUID分支进行打印到LCD检查,发现没进入该条件


请各位大神帮帮忙, Ti的工程师指点下更是万分欣慰

BR

TKS