Exemple #1
0
/*******************************************************************************
* Function Name: SendErrorCode
********************************************************************************
* Summary:
*        Send Error code at GATT Layer
*
* Parameters:
*  uint8 opCode, 
*  CYBLE_GATT_DB_ATTR_HANDLE_T  attrHandle, 
*  CYBLE_GATT_ERR_CODE_T errorCode
*
* Return:
*  void
*
*******************************************************************************/
void SendErrorCode(uint8 opCode, CYBLE_GATT_DB_ATTR_HANDLE_T  attrHandle, CYBLE_GATT_ERR_CODE_T errorCode)
{
	CYBLE_GATTS_ERR_PARAM_T err_param;
		            
    err_param.opcode = opCode;
    err_param.attrHandle = attrHandle;
    err_param.errorCode = errorCode;

    /* Send Error Response */
    (void)CyBle_GattsErrorRsp(cyBle_connHandle, &err_param);
}
Exemple #2
0
/*******************************************************************************
* Function Name: SendErrorResponse
********************************************************************************
*
* Summary:
*  Sends error code for a particular attribute handle
*
* Parameters:
*  CYBLE_GATT_DB_ATTR_HANDLE_T  :  attribute handle
*  CYBLE_GATT_ERR_CODE_T        :  error code to be send
*
* Return:
*  None
*
*******************************************************************************/
void SendErrorResponse( CYBLE_GATT_DB_ATTR_HANDLE_T attributeHandle,
                        CYBLE_GATT_ERR_CODE_T errorCode)
{
    CYBLE_GATTS_ERR_PARAM_T errorparam;

    errorparam.attrHandle = attributeHandle;
    errorparam.errorCode = errorCode;
    errorparam.opcode = CYBLE_GATT_WRITE_REQ;
    CyBle_GattsErrorRsp(cyBle_connHandle, &errorparam);
    errorSent = true;
}