当前位置: 首页>>代码示例>>C++>>正文


C++ DBG_BUFFER函数代码示例

本文整理汇总了C++中DBG_BUFFER函数的典型用法代码示例。如果您正苦于以下问题:C++ DBG_BUFFER函数的具体用法?C++ DBG_BUFFER怎么用?C++ DBG_BUFFER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DBG_BUFFER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SimpBleClient_CtlPntWrite

/**
  * @brief  Used internal, to send write request to peer server's V5 Control Point Characteristic.
  * @param  ctl_pnt_ptr: pointer of control point data to write.
  * @retval TRUE--send request to upper stack success.
  *         FALSE--send request to upper stack failed.
  */
static bool SimpBleClient_CtlPntWrite( uint8_t *ctl_pnt_ptr )
{
    TWriteReq writeReq;
    bool hdl_valid = FALSE;
    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "SimpBleClient_CtlPntWrite", 0);

    if(SimpHdlCache[HDL_SIMBLE_V5_CTL_PNT])
    {
        writeReq.wHandle = SimpHdlCache[HDL_SIMBLE_V5_CTL_PNT];
        writeReq.wType = blueAPI_GATTWriteTypeRequest;
        writeReq.wLength = 3;
        writeReq.pData = ctl_pnt_ptr;
        hdl_valid = TRUE;
    }

    if(hdl_valid)
    {
        if(clientAPI_AttribWrite( SimpClient_ClientID, &writeReq ) == ProfileResult_Success)
        {
            return TRUE;
        }
    }
    
    DBG_BUFFER(MODULE_PROFILE, LEVEL_WARN, "SimpBleClient_CtlPntWrite: Request fail! Please check!", 0);
    return FALSE;
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:32,代码来源:simple_ble_client.c

示例2: SimpBleClient_V5CtlPntIndicateCmd

/**
  * @brief  Used by application, to enable or disable the indication of peer server's V5 Control Point Characteristic.
  * @param  command: 0--disable the indication, 1--enable the indication.
  * @retval TRUE--send request to upper stack success.
  *         FALSE--send request to upper stack failed.
  */
bool SimpBleClient_V5CtlPntIndicateCmd( bool command )
{
    TWriteReq writeReq;
    uint16_t wCCCDBits;
    bool hdl_valid = FALSE;

    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "SimpBleClient_V5CtlPntIndicateCmd: command = %d", 1, command);

    wCCCDBits = command ? 2 : 0;

    if(SimpHdlCache[HDL_SIMBLE_V5_CTL_PNT_CCCD])
    {
        writeReq.wHandle = SimpHdlCache[HDL_SIMBLE_V5_CTL_PNT_CCCD];
        writeReq.wType = blueAPI_GATTWriteTypeRequest;
        writeReq.wLength = sizeof(uint16_t);
        writeReq.pData = (uint8_t *)&wCCCDBits;
        hdl_valid = TRUE;
    }

    if(hdl_valid)
    {
        if(clientAPI_AttribWrite( SimpClient_ClientID, &writeReq ) == ProfileResult_Success)
        {
            return TRUE;
        }
    }
    
    DBG_BUFFER(MODULE_PROFILE, LEVEL_WARN, "SimpBleClient_V5CtlPntIndicateCmd: Request fail! Please check!", 0);
    return FALSE;
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:36,代码来源:simple_ble_client.c

示例3: profileHandle_GATTCCCDInfo

/**
 * @brief handle blueAPI_Event_GATTCCCDInfo.
 *
 * @param pGATTCCCDInfo      upstream message from upper stack.
 * @return release buffer or not.
 * @retval TRUE 1
 * @retval FALSE 0
*/
bool profileHandle_GATTCCCDInfo(PBlueAPI_GATTCCCDInfo pGATTCCCDInfo )
{
    PGATTDService pService;

    pService = profileServiceFind(pGATTCCCDInfo->serviceHandle );

#ifdef PROFILE_DEBUG
    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "<-- profileHandle_GATTCCCDInfo:  count=%d ServiceID=%d",
               2, pGATTCCCDInfo->count, pService->ServiceIDx);
#endif

    if ( (pService != (PGATTDService)NULL))
    {
        int        i;
        uint16_t   wAttribIndex, wCCCBits;
        uint16_t * pWord;

        pWord = (uint16_t *)&pGATTCCCDInfo->data[pGATTCCCDInfo->gap];
        for ( i = 0; i < pGATTCCCDInfo->count; i++ )
        {
            wAttribIndex = *(pWord++);
            wCCCBits     = *(pWord++);
#ifdef PROFILE_DEBUG
            DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "attribIndex=%d, cccBits=0x%04x",
                       2, wAttribIndex, wCCCBits);
#endif
            profileUpdateCCCDInfo((uint8_t)pService->ServiceIDx, wAttribIndex, wCCCBits);

        }
    }

    return ( true );
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:41,代码来源:hdlmsg.c

示例4: SimpBleClient_WriteV2WriteChar

/**
  * @brief  Used by application, to send write request to peer server's V2 Write Characteristic.
  * @param  v2_write_val: data to write.
  * @retval TRUE--send request to upper stack success.
  *         FALSE--send request to upper stack failed.
  */
bool SimpBleClient_WriteV2WriteChar(uint8_t v2_write_val)
{
    TWriteReq writeReq;
    bool hdl_valid = FALSE;
    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "SimpBleClient_WriteV2WriteChar", 0);

    if(SimpHdlCache[HDL_SIMBLE_V2_WRITE])
    {
        writeReq.wHandle = SimpHdlCache[HDL_SIMBLE_V2_WRITE];
        writeReq.wType = blueAPI_GATTWriteTypeRequest;
        writeReq.wLength = sizeof(v2_write_val);
        writeReq.pData = &v2_write_val;
        hdl_valid = TRUE;
    }

    if(hdl_valid)
    {
        if(clientAPI_AttribWrite( SimpClient_ClientID, &writeReq ) == ProfileResult_Success)
        {
            return TRUE;
        }
    }
    
    DBG_BUFFER(MODULE_PROFILE, LEVEL_WARN, "SimpBleClient_WriteV2WriteChar: Request fail! Please check!", 0);
    return FALSE;
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:32,代码来源:simple_ble_client.c

示例5: profileHandle_GATTAttributeUpdateRsp

/**
 * @brief handle blueAPI_Event_GATTAttributeUpdateRsp.
 *
 * @param pGATTAttributeUpdateRsp        upstream message from upper stack.
 * @return release buffer or not.
 * @retval TRUE 1
 * @retval FALSE 0
*/
bool profileHandle_GATTAttributeUpdateRsp(
    PBlueAPI_GATTAttributeUpdateRsp pGATTAttributeUpdateRsp )
{
    bool  Error = false;
#ifdef PROFILE_DEBUG
    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "<-- GATTAttributeUpdateRsp cause = 0x%x subcause = 0x%x ", 2,
               pGATTAttributeUpdateRsp->cause, pGATTAttributeUpdateRsp->subCause);
#endif
    gProfileData.wDsCredits++ ;
    if ( pGATTAttributeUpdateRsp->cause == blueAPI_CauseSuccess )
    {
        profileDataTxComplete(gProfileData.wDsCredits);

    }
    else  if ( pGATTAttributeUpdateRsp->subCause == GATT_ERR_OUT_OF_RESOURCE )
    {
        Error = true;
    }
    else  if ( (pGATTAttributeUpdateRsp->subCause == GATT_ERR_NOTIF_IND_CFG) &&
               (pGATTAttributeUpdateRsp->count > 0)
             )
    {
        /* list of BDs that configured the CCCD for notifications/indications */
        /* is appended */
        PBlueAPI_GATTAttributeUpdateListElement  pElement;
        int   i;
        DBG_BUFFER(MODULE_PROFILE, LEVEL_ERROR, "GATTAttributeUpdateRsp GATT_ERR_NOTIF_IND_CFG.", 0);
        DBG_BUFFER(MODULE_PROFILE, LEVEL_ERROR, "GATTAttributeUpdateRsp GATT_ERR_NOTIF_IND_CFG.", 0);

        pElement = (PBlueAPI_GATTAttributeUpdateListElement)(pGATTAttributeUpdateRsp->list + pGATTAttributeUpdateRsp->gap);
        for ( i = 0; i < pGATTAttributeUpdateRsp->count ; i++ )
        {
            pElement++;
        }
    }
    if (pGATTAttributeUpdateRsp->subCause == GATT_ERR_NOTIF_IND_CFG)
    {
        DBG_BUFFER(MODULE_PROFILE, LEVEL_ERROR, "Check GATT_ERR_NOTIF_IND_CFG.AttribIndex", 1, pGATTAttributeUpdateRsp->attribIndex);
    }
    if ( Error )
    {
        DBG_BUFFER(MODULE_PROFILE, LEVEL_ERROR, "GATTAttributeUpdateRsp Error %d.", 1, Error);
    }
    else
    {
        /* some services need to do some post update (sequence) processing (RACP ..): */
        /*
        if ( (pGATTData->iUpdateCnt == pGATTData->iUpdateConfirmed) ||
             (pGATTAttributeUpdateRsp->cause != blueAPI_CauseSuccess)
           )
        {
          gattdServiceUpdateCallback( pGATTData,
                pGATTAttributeUpdateRsp->subCause, pGATTAttributeUpdateRsp->attribIndex );
        }
        */
    }

    return ( true );
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:67,代码来源:hdlmsg.c

示例6: si4713_send_command

/*
 * si4713_send_command - sends a command to si4713 and waits its response
 * @sdev: si4713_device structure for the device we are communicating
 * @command: command id
 * @args: command arguments we are sending (up to 7)
 * @argn: actual size of @args
 * @response: buffer to place the expected response from the device (up to 15)
 * @respn: actual size of @response
 * @usecs: amount of time to wait before reading the response (in usecs)
 */
static int si4713_send_command(struct si4713_device *sdev, const u8 command,
				const u8 args[], const int argn,
				u8 response[], const int respn, const int usecs)
{
	struct i2c_client *client = v4l2_get_subdevdata(&sdev->sd);
	unsigned long until_jiffies;
	u8 data1[MAX_ARGS + 1];
	int err;

	if (!client->adapter)
		return -ENODEV;

	/* First send the command and its arguments */
	data1[0] = command;
	memcpy(data1 + 1, args, argn);
	DBG_BUFFER(&sdev->sd, "Parameters", data1, argn + 1);

	err = i2c_master_send(client, data1, argn + 1);
	if (err != argn + 1) {
		v4l2_err(&sdev->sd, "Error while sending command 0x%02x\n",
			command);
		return err < 0 ? err : -EIO;
	}

	until_jiffies = jiffies + usecs_to_jiffies(usecs) + 1;

	/* Wait response from interrupt */
	if (client->irq) {
		if (!wait_for_completion_timeout(&sdev->work,
				usecs_to_jiffies(usecs) + 1))
			v4l2_warn(&sdev->sd,
				"(%s) Device took too much time to answer.\n",
				__func__);
	}

	do {
		err = i2c_master_recv(client, response, respn);
		if (err != respn) {
			v4l2_err(&sdev->sd,
				"Error %d while reading response for command 0x%02x\n",
				err, command);
			return err < 0 ? err : -EIO;
		}

		DBG_BUFFER(&sdev->sd, "Response", response, respn);
		if (!check_command_failed(response[0]))
			return 0;

		if (client->irq)
			return -EBUSY;
		if (usecs <= 1000)
			usleep_range(usecs, 1000);
		else
			usleep_range(1000, 2000);
	} while (time_is_after_jiffies(until_jiffies));

	return -EBUSY;
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:68,代码来源:si4713.c

示例7: SimpBleClient_ReadByHandle

/**
  * @brief  Used by application, read data from server by using handles.
  * @param  readCharType: one of characteristic that has the readable property.
  * @retval TRUE--send request to upper stack success.
  *         FALSE--send request to upper stack failed.
  */
bool SimpBleClient_ReadByHandle( TSimpClientReadType readCharType )
{
    TReadHandleReq readHandle;
    bool hdl_valid = FALSE;

    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "SimpBleClient_ReadByHandle: charType = %d", 1, readCharType);
    
    switch(readCharType)
    {
        case SIMP_READ_REQ_V1_READ:
            if(SimpHdlCache[HDL_SIMBLE_V1_READ])
            {
                readHandle.wHandle = SimpHdlCache[HDL_SIMBLE_V1_READ];
                hdl_valid = TRUE;
            }
            break;
        case SIMP_READ_REQ_V3_NOTIFY_NOTIF_BIT:
            if(SimpHdlCache[HDL_SIMBLE_V3_NOTIFY_CCCD])
            {
                readHandle.wHandle = SimpHdlCache[HDL_SIMBLE_V3_NOTIFY_CCCD];
                hdl_valid = TRUE;
            }
            break;
        case SIMP_READ_REQ_V4_INDICATE_IND_BIT:
            if(SimpHdlCache[HDL_SIMBLE_V4_INDICATE_CCCD])
            {
                readHandle.wHandle = SimpHdlCache[HDL_SIMBLE_V4_INDICATE_CCCD];
                hdl_valid = TRUE;
            }
            break;
        case SIMP_READ_REQ_V5_CTL_PNT_IND_BIT:
            if(SimpHdlCache[HDL_SIMBLE_V5_CTL_PNT_CCCD])
            {
                readHandle.wHandle = SimpHdlCache[HDL_SIMBLE_V5_CTL_PNT_CCCD];
                hdl_valid = TRUE;
            }
            break;
        default:
            return FALSE;
    }
            
    if(hdl_valid)
    {
        if(clientAPI_AttribRead(SimpClient_ClientID, readHandle) == ProfileResult_Success)
        {
            return TRUE;
        }
    }
    
    DBG_BUFFER(MODULE_PROFILE, LEVEL_WARN, "SimpBleClient_ReadByHandle: Request fail! Please check!", 0);
    return FALSE;
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:58,代码来源:simple_ble_client.c

示例8: DLPS_CheckTestUpperTask

//#ifdef CONFIG_DLPS_EN
BOOL DLPS_CheckTestUpperTask()
{
    if (g_pGattTest->bEnterDlps == true)
    {
    	DBG_BUFFER(MODULE_APP, LEVEL_INFO, "DLPS_CheckTestUpperTask true\n\n", 0);
        return true;
    }
    else
    {
    	DBG_BUFFER(MODULE_APP, LEVEL_INFO, "DLPS_CheckTestUpperTask flase\n\n", 0);
        return false;
    }
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:14,代码来源:test_upperstack_FreeRTOS.c

示例9: profileHandle_GATTAttributeUpdateStatusInd

/**
 * @brief handle blueAPI_Event_GATTAttributeUpdateStatusInd.
 *
 * @param pGATTAttributeUpdateStatusInd      upstream message from upper stack.
 * @return release buffer or not.
 * @retval TRUE 1
 * @retval FALSE 0
*/
bool profileHandle_GATTAttributeUpdateStatusInd(
    PBlueAPI_GATTAttributeUpdateStatusInd pGATTAttributeUpdateStatusInd )
{
    PGATTDService  pService;
    
#ifdef PROFILE_DEBUG
    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "<-- profileHandle_GATTAttributeUpdateStatusInd subCause=0x%x",
               1, pGATTAttributeUpdateStatusInd->subCause);
#endif

    pService = profileServiceFind( pGATTAttributeUpdateStatusInd->serviceHandle );
    
    //notify service
    if(gattSrvInfo[pService->ServiceIDx].cbInfo.pfnUpdateStatusCB)
    {
        gattSrvInfo[pService->ServiceIDx].cbInfo.pfnUpdateStatusCB(
            pService->ServiceIDx, pGATTAttributeUpdateStatusInd->attribIndex);
    }
    
    if ( blueAPI_GATTAttributeUpdateStatusConf(
                pGATTAttributeUpdateStatusInd->serviceHandle,
                pGATTAttributeUpdateStatusInd->requestHandle,
                pGATTAttributeUpdateStatusInd->attribIndex
            )
       )
    {
#ifdef PROFILE_DEBUG    
        DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "<-- --> GATTAttributeUpdateStatusConf", 0);
#endif
    }

    /* check if update sequence should be continued */
    gProfileData.wDsCredits++ ;
    if ( pGATTAttributeUpdateStatusInd->cause == blueAPI_CauseSuccess )
    {
        profileDataTxComplete(gProfileData.wDsCredits);
    }
    else
    {
        //gSrvSequnceCtrl.iUpdateCnt = 0;
    }

    /* Modified for RSC CSC Procedure Already In Progress */
    /* some services need to do some post update (sequence) processing (RSC, CSC): */
    /*  if ( gSrvSequnceCtrl.iUpdateCnt == 0 )
      {
          DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "--> gattdServiceUpdateCallback() executed.", 0);
      }
    */
    return ( true );
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:59,代码来源:hdlmsg.c

示例10: profileHandle_GATTDiscoveryRsp

/**
  * @brief  handle blueAPI_Event_GATTDiscoveryRsp.
  * @param  pGATTDiscoveryRsp: message from upper stack.
  * @retval TRUE: need to release buffer.
  *         FALSE: no need to release buffer.
  */
static bool profileHandle_GATTDiscoveryRsp(PBlueAPI_GATTDiscoveryRsp pGATTDiscoveryRsp)
{
#ifdef ANCS_DEBUG
    DBG_BUFFER(MODULE_PROFILE,LEVEL_INFO,"profileHandle_GATTDiscoveryRsp: subCause=0x%x",1,pGATTDiscoveryRsp->subCause);
#endif
    return( true );
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:13,代码来源:hdlmsg.c

示例11: profileHandle_GATTServiceRegisterRsp

/**
 * @brief handle blueAPI_Event_GATTServiceRegisterRsp.
 *
 * @param pGATTServiceRegisterRsp        upstream message from upper stack.
 * @return release buffer or not.
 * @retval TRUE 1
 * @retval FALSE 0
*/
bool profileHandle_GATTServiceRegisterRsp(
    PBlueAPI_GATTServiceRegisterRsp pGATTServiceRegisterRsp )
{
#ifdef PROFILE_DEBUG
    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "profileHandle_GATTServiceRegisterRsp cause = 0x%x", 1,
               pGATTServiceRegisterRsp->cause);
#endif
    if ( pGATTServiceRegisterRsp->cause == blueAPI_CauseSuccess )
    {
        gattSrvInfo[gProfileData.iServiceCountIndex].Service.pServiceHandle =
            pGATTServiceRegisterRsp->serviceHandle;

        gProfileData.iServiceCountIndex++;
        if ( gProfileData.iServiceCountIndex == gServicesCount )
        {
            // service Register complete, send this to APP.lilly
            profileSrvStartCompleteEvt(0);
            peripheral_Handle_ServiceRegisterCompleteEvt();
        }
        else
        {
            /* register next service */
            profileServiceRegister();
        }
    }
    else
    {
        gattSrvInfo[gProfileData.iServiceCountIndex].Service.Used           = false;
        gattSrvInfo[gProfileData.iServiceCountIndex].Service.pServiceHandle = NULL;
    }

    return ( true );
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:41,代码来源:hdlmsg.c

示例12: dualmode_HandleBtGapEncryptStateChangeEvt

static void dualmode_HandleBtGapEncryptStateChangeEvt(uint8_t new_state)
{
    switch (new_state)
    {
    case GAPBOND_ENCRYPT_STATE_ENABLED:
        DBG_BUFFER(MODULE_APP, LEVEL_INFO, "GAPBOND_ENCRYPT_STATE_ENABLED", 0);
        break;

    case GAPBOND_ENCRYPT_STATE_DISABLED:
        DBG_BUFFER(MODULE_APP, LEVEL_INFO, "GAPBOND_ENCRYPT_STATE_DISABLED", 0);
        break;

    default:
        break;
    }
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:16,代码来源:test_dual_application.c

示例13: SimpBleServiceAttrReadCb

/**
 * @brief read characteristic data from service.
 *
 * @param ServiceId          ServiceID of characteristic data.
 * @param iAttribIndex          Attribute index of getting characteristic data.
 * @param iOffset                Used for Blob Read.
 * @param piLength            length of getting characteristic data.
 * @param ppValue            data got from service.
 * @return Profile procedure result
*/
TProfileResult  SimpBleServiceAttrReadCb( uint8_t ServiceId, uint16_t iAttribIndex, uint16_t iOffset, uint16_t * piLength, uint8_t **ppValue )
{
    TProfileResult  wCause  = ProfileResult_Success;

    switch ( iAttribIndex )
    {
    default:
        DBG_BUFFER(MODULE_PROFILE, LEVEL_ERROR, "<-- SimpBleServiceAttrReadCb, Attr not found, index=%d",
                   1, iAttribIndex);
        wCause  = ProfileResult_AttrNotFound;
        break;
    case SIMPLE_BLE_SERVICE_CHAR_V1_READ_INDEX:
        {
            TSIMP_CALLBACK_DATA callback_data;
            callback_data.msg_type = SERVICE_CALLBACK_TYPE_READ_CHAR_VALUE;
            callback_data.msg_data.read_value_index = SIMP_READ_V1;
            pfnSimpBleServiceCB(ServiceId, (void*)&callback_data);            
            *ppValue    = &simpleCharReadValue;
            *piLength = sizeof(simpleCharReadValue);
        }
        break;
    }

    return ( wCause );
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:35,代码来源:simple_ble_service.c

示例14: BAS_SetParameter

/**
  * @brief  Set service related data from application.
  *
  * @param[in] param_type            parameter type to set: @ref BAS_Application_Parameters
  * @param[in] length                value length to be set.
  * @param[in] value_ptr             value to set.
  * @return parameter set result.
  * @retval 0 FALSE
  * @retval 1 TRUE
  */
bool BAS_SetParameter( uint8_t param_type, uint8_t length, uint8_t *value_ptr )
{
    bool ret = TRUE;

    switch (param_type)
    {
    default:
        {
            ret = FALSE;
            DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "BAS_SetParameter failed\n", 0 );
        }
        break;

    case BAS_PARAM_BATTERY_LEVEL:
        {
            if (length != sizeof(uint8_t))
            {
                ret = FALSE;
            }
            else
            {
                gBatteryLevel = value_ptr[0];
            }
        }
        break;
    }

    return ret;
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:39,代码来源:bas.c

示例15: SimpBleClientWriteResultCb

/**
  * @brief  Called by profile client layer, when write request complete.
  * @param  reqResult: write request send success or not.
  * @retval ProfileResult_Success--procedure OK.
  *         other--procedure exception.
  */
static TProfileResult SimpBleClientWriteResultCb( TClientRequestResult reqResult )
{
    TAppResult appResult = AppResult_Success;
    TSimpClientCB_Data cb_data;
    cb_data.cb_type = SIMP_CLIENT_CB_TYPE_WRITE_RESULT;

    DBG_BUFFER(MODULE_PROFILE, LEVEL_INFO, "SimpBleClientWriteResultCb: result = %d", 1, reqResult);

    /* If write req success, branch to fetch value and send to application. */
    if(reqResult == CLIENT_REQ_SUCCESS)
    {
        cb_data.cb_content.write_result = SIMP_WRITE_RESULT_SUCCESS;
    }
    /* Read req fail, inform application. */
    else
    {
        cb_data.cb_content.write_result = SIMP_WRITE_RESULT_FAIL;
    }
    /* Inform application the write result. */
    if(pfnSimpClientAppCB)
    {
        appResult = (*pfnSimpClientAppCB)(SimpClient_ClientID, &cb_data);
    }

    return (clientAPI_GetProfileResult(appResult));
}
开发者ID:wanghao-xznu,项目名称:BumbleBee1,代码行数:32,代码来源:simple_ble_client.c


注:本文中的DBG_BUFFER函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。