4.6.1 Encrypting the Connection
The SimpleGATTProfile contains a fifth characteristic with a UUID of 0xFFF5. Like the second
characteristic, this characteristic has read-only permissions; however this characteristic can only be read if
the link is encrypted.
有下划线的句子的意思是:这个characteristic只能在连接被加密的情况下才能被读取。
但是我在SimpleGATTProfile.c里没有看到对SIMPLEPROFILE_CHAR5的限制,代码里读取时候也没有要求加密。
/*********************************************************************
* @fn SimpleProfile_GetParameter
*
* @brief Get a Simple Profile parameter.
*
* @param param - Profile parameter ID
* @param value - pointer to data to put. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16 will be cast to
* uint16 pointer).
*
* @return bStatus_t
*/
bStatus_t SimpleProfile_GetParameter( uint8 param, void *value )
{
bStatus_t ret = SUCCESS;
switch ( param )
{
case SIMPLEPROFILE_CHAR1:
*((uint8*)value) = simpleProfileChar1;
break;
case SIMPLEPROFILE_CHAR2:
*((uint8*)value) = simpleProfileChar2;
break;
case SIMPLEPROFILE_CHAR3:
*((uint8*)value) = simpleProfileChar3;
break;
case SIMPLEPROFILE_CHAR4:
*((uint8*)value) = simpleProfileChar4;
break;
case SIMPLEPROFILE_CHAR5:
VOID osal_memcpy( value, simpleProfileChar5, SIMPLEPROFILE_CHAR5_LEN );
break;
default:
ret = INVALIDPARAMETER;
break;
}
return ( ret );
}
另外,SIMPLEPROFILE_CHAR5为什么是5bytes呢?其他都是1byte.