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.

Notify的使用

Other Parts Discussed in Thread: LAUNCHXL-CC2640R2

工程师们,你们好,

请问下我想对我的notify进行计数,我该怎么做呢?我这边使用的是特征值1

        
ret = GATTServApp_ProcessCharCfg(simpleProfileChar1Config, simpleProfileChar1, FALSE,
                                    simpleProfileAttrTbl, GATT_NUM_ATTRS(simpleProfileAttrTbl),
                                    INVALID_TASK_ID, simpleProfile_ReadAttrCB);

if (simpleProfileChar1Config->value & GATT_CLIENT_CFG_NOTIFY)
{
     // 如果ret是success则加1
     SucSendConuter_Plus(ret);
}

我发现在用此方式进行计数时,数值总是大于我发送的notify值,是因为有其他地方自动调用了吗?我该怎么避免呢?

另外,请问一下我将属性初始化为indicate后,在这里我读到的value仍然是notify,这是为什么(因为之前说indicate后面也是调用notify,但在GATTServApp_ProcessCharCfg中是有对notify和indicate进行区别的)?