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.

作为service端 怎么知道自己提供的char 所对应的handle的值?



比如在ti的simpleperipheral 和 simplecentral中, simpleperipheral 作为service 发送数据给作为 client的 simplecentral  ,调用GATT_Notification()来通知client

那怎么知道GATT_Notification 函数参数第二个中的handle的值呢?

  • 看你设置了哪个属性支持nodify,可以直接读取handle

    // Set the handle

    pInd->handle = simpleProfileAttrTbl[11].handle;//Characteristic Value 4

    也可以调用

    // See if Notification has been enabled
    GATTServApp_ProcessCharCfg( simpleProfileChar4Config, simpleProfileChar4, FALSE,
    simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
    INVALID_TASK_ID );

    实现nodify

  • GATTServApp_ProcessCharCfg( simpleProfileChar4Config, simpleProfileChar4, FALSE,
    simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
    INVALID_TASK_ID );

    调用这个函数向client端发送数据的话,如果我利用就是char4 的nodify属性。那要实现一次发送多字节的数据。需要对char4进行怎样的配置,或者还有其它什么地方需要做相应的修改。