用的是ble 的peripherial例程,attributr table部分配置如下
// Characteristic 3 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar3Props},
// Characteristic Value 3
{
{ATT_BT_UUID_SIZE, simpleProfilechar3UUID},
GATT_PERMIT_WRITE,
0,
simpleProfileChar3},
// Characteristic 3 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar3UserDesp},
// Characteristic 4 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar4Props},
// Characteristic Value 4
{
{ATT_BT_UUID_SIZE, simpleProfilechar4UUID},
0,
0,
simpleProfileChar4},
// Characteristic 4 configuration
{
{ATT_BT_UUID_SIZE, clientCharCfgUUID},
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,
(uint8_t *)simpleProfileChar4Config},
// Characteristic 4 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar4UserDesp},
这样没有问题,Characteristic 4 的notify功能正常,但如果我把Characteristic 3的 User Description注释掉,Characteristic 4 的notify就不正常了,即
// Characteristic 3 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar3Props},
// Characteristic Value 3
{
{ATT_BT_UUID_SIZE, simpleProfilechar3UUID},
GATT_PERMIT_WRITE,
0,
simpleProfileChar3},
// Characteristic 3 User Description
// {
// {ATT_BT_UUID_SIZE, charUserDescUUID},
// GATT_PERMIT_READ,
// 0,
// simpleProfileChar3UserDesp},
// Characteristic 4 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar4Props},
// Characteristic Value 4
{
{ATT_BT_UUID_SIZE, simpleProfilechar4UUID},
0,
0,
simpleProfileChar4},
// Characteristic 4 configuration
{
{ATT_BT_UUID_SIZE, clientCharCfgUUID},
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,
(uint8_t *)simpleProfileChar4Config},
// Characteristic 4 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar4UserDesp},
这是为什么