/******************************************************************************
* Send_Notification
*发送notify给主机
*参数:connectionhandle 哪一个从机;pvalue,要发送的数据,len,长度
****************************************************************************/
void Send_Notification( uint8 connhandle, uint8 *pValue, uint8 len )
{
attHandleValueNoti_t noti;
uint16 whether_enable_notify;
whether_enable_notify=GATTServApp_ReadCharCfg( connhandle,simpleProfileChar1Config );
if(whether_enable_notify & GATT_CLIENT_CFG_NOTIFY)
{
noti.handle=simpleProfileAttrTbl[notify_value_Idex].handle;
noti.len=len;
osal_memcpy( noti.value,pValue,len );
GATT_Notification(connhandle,¬i,FALSE);
}
* Send_Notification
*发送notify给主机
*参数:connectionhandle 哪一个从机;pvalue,要发送的数据,len,长度
****************************************************************************/
void Send_Notification( uint8 connhandle, uint8 *pValue, uint8 len )
{
attHandleValueNoti_t noti;
uint16 whether_enable_notify;
whether_enable_notify=GATTServApp_ReadCharCfg( connhandle,simpleProfileChar1Config );
if(whether_enable_notify & GATT_CLIENT_CFG_NOTIFY)
{
noti.handle=simpleProfileAttrTbl[notify_value_Idex].handle;
noti.len=len;
osal_memcpy( noti.value,pValue,len );
GATT_Notification(connhandle,¬i,FALSE);
}
}
//传给APP
uint16 handle;
uint8 gepstate;
GAPRole_GetParameter( GAPROLE_STATE, &gepstate);
if( gepstate==GAPROLE_CONNECTED )
{
GAPRole_GetParameter( GAPROLE_CONNHANDLE, &handle);
Send_Notification( handle ,T_BUF,len );//完全透传
}