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


C++ UINT8_TO_STREAM函数代码示例

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


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

示例1: nci_snd_nfcee_mode_set

/*******************************************************************************
**
** Function         nci_snd_nfcee_mode_set
**
** Description      compose and send NFCEE Management NFCEE MODE SET command
**                  to command queue
**
** Returns          status
**
*******************************************************************************/
UINT8 nci_snd_nfcee_mode_set (UINT8 nfcee_id, UINT8 nfcee_mode)
{
    BT_HDR *p;
    UINT8 *pp;

    if ((p = NCI_GET_CMD_BUF (NCI_CORE_PARAM_SIZE_NFCEE_MODE_SET)) == NULL)
        return (NCI_STATUS_FAILED);

    p->event            = BT_EVT_TO_NFC_NCI;
    p->len              = NCI_MSG_HDR_SIZE + NCI_CORE_PARAM_SIZE_NFCEE_MODE_SET;
    p->offset           = NCI_MSG_OFFSET_SIZE;
    p->layer_specific   = 0;
    pp                  = (UINT8 *) (p + 1) + p->offset;

    NCI_MSG_BLD_HDR0 (pp, NCI_MT_CMD, NCI_GID_EE_MANAGE);
    NCI_MSG_BLD_HDR1 (pp, NCI_MSG_NFCEE_MODE_SET);
    UINT8_TO_STREAM (pp, NCI_CORE_PARAM_SIZE_NFCEE_MODE_SET);
    UINT8_TO_STREAM (pp, nfcee_id);
    UINT8_TO_STREAM (pp, nfcee_mode);

    nfc_ncif_send_cmd (p);
    return (NCI_STATUS_OK);
}
开发者ID:NXPNFCLinux,项目名称:linux_libnfc-nci,代码行数:33,代码来源:nci_hmsgs.c

示例2: nci_snd_t3t_polling

/*******************************************************************************
**
** Function         nci_snd_t3t_polling
**
** Description      compose and send RF Management T3T POLLING command
**                  to command queue
**
** Returns          status
**
*******************************************************************************/
UINT8 nci_snd_t3t_polling (UINT16 system_code, UINT8 rc, UINT8 tsn)
{
    BT_HDR *p;
    UINT8 *pp;

    if ((p = NCI_GET_CMD_BUF (NCI_RF_PARAM_SIZE_T3T_POLLING)) == NULL)
        return (NCI_STATUS_FAILED);

    p->event            = BT_EVT_TO_NFC_NCI;
    p->len              = NCI_MSG_HDR_SIZE + NCI_RF_PARAM_SIZE_T3T_POLLING;
    p->offset           = NCI_MSG_OFFSET_SIZE;
    p->layer_specific   = 0;
    pp                  = (UINT8 *) (p + 1) + p->offset;

    NCI_MSG_BLD_HDR0 (pp, NCI_MT_CMD, NCI_GID_RF_MANAGE);
    NCI_MSG_BLD_HDR1 (pp, NCI_MSG_RF_T3T_POLLING);
    UINT8_TO_STREAM (pp, NCI_RF_PARAM_SIZE_T3T_POLLING);
    UINT16_TO_BE_STREAM (pp, system_code);
    UINT8_TO_STREAM (pp, rc);
    UINT8_TO_STREAM (pp, tsn);

    nfc_ncif_send_cmd (p);
    return (NCI_STATUS_OK);
}
开发者ID:NXPNFCLinux,项目名称:linux_libnfc-nci,代码行数:34,代码来源:nci_hmsgs.c

示例3: nci_snd_deactivate_cmd

/*******************************************************************************
**
** Function         nci_snd_deactivate_cmd
**
** Description      compose and send RF Management DEACTIVATE command
**                  to command queue
**
** Returns          status
**
*******************************************************************************/
UINT8 nci_snd_deactivate_cmd (UINT8 de_act_type )
{
    BT_HDR *p;
    UINT8 *pp;

    nfc_cb.reassembly = TRUE;

    if ((p = NCI_GET_CMD_BUF (NCI_DISCOVER_PARAM_SIZE_DEACT)) == NULL)
        return (NCI_STATUS_FAILED);

    p->event            = BT_EVT_TO_NFC_NCI;
    p->len              = NCI_MSG_HDR_SIZE + NCI_DISCOVER_PARAM_SIZE_DEACT;
    p->offset           = NCI_MSG_OFFSET_SIZE;
    p->layer_specific   = 0;
    pp                  = (UINT8 *) (p + 1) + p->offset;

    NCI_MSG_BLD_HDR0 (pp, NCI_MT_CMD, NCI_GID_RF_MANAGE);
    NCI_MSG_BLD_HDR1 (pp, NCI_MSG_RF_DEACTIVATE);
    UINT8_TO_STREAM (pp, NCI_DISCOVER_PARAM_SIZE_DEACT);
    UINT8_TO_STREAM (pp, de_act_type);

    nfc_ncif_send_cmd (p);
    return (NCI_STATUS_OK);
}
开发者ID:NXPNFCLinux,项目名称:linux_libnfc-nci,代码行数:34,代码来源:nci_hmsgs.c

示例4: nci_snd_discover_select_cmd

/*******************************************************************************
**
** Function         nci_snd_discover_select_cmd
**
** Description      compose and send RF Management DISCOVER SELECT command
**                  to command queue
**
** Returns          status
**
*******************************************************************************/
UINT8 nci_snd_discover_select_cmd (UINT8 rf_disc_id, UINT8 protocol, UINT8 rf_interface)
{
    BT_HDR *p;
    UINT8 *pp;

    if ((p = NCI_GET_CMD_BUF (NCI_DISCOVER_PARAM_SIZE_SELECT)) == NULL)
        return (NCI_STATUS_FAILED);

    p->event            = BT_EVT_TO_NFC_NCI;
    p->len              = NCI_MSG_HDR_SIZE + NCI_DISCOVER_PARAM_SIZE_SELECT;
    p->offset           = NCI_MSG_OFFSET_SIZE;
    p->layer_specific   = 0;
    pp                  = (UINT8 *) (p + 1) + p->offset;

    NCI_MSG_BLD_HDR0 (pp, NCI_MT_CMD, NCI_GID_RF_MANAGE);
    NCI_MSG_BLD_HDR1 (pp, NCI_MSG_RF_DISCOVER_SELECT);
    UINT8_TO_STREAM (pp, NCI_DISCOVER_PARAM_SIZE_SELECT);
    UINT8_TO_STREAM (pp, rf_disc_id);
    UINT8_TO_STREAM (pp, protocol);
    UINT8_TO_STREAM (pp, rf_interface);

    nfc_ncif_send_cmd (p);
    return (NCI_STATUS_OK);
}
开发者ID:NXPNFCLinux,项目名称:linux_libnfc-nci,代码行数:34,代码来源:nci_hmsgs.c

示例5: btsnd_hcic_reject_conn

BOOLEAN btsnd_hcic_reject_conn (BD_ADDR dest, UINT8 reason)
{
    BT_HDR *p;
    UINT8 *pp;

    if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_REJECT_CONN)) == NULL)
        return (FALSE);

    pp = (UINT8 *)(p + 1);

    p->len    = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_REJECT_CONN;
    p->offset = 0;

    UINT16_TO_STREAM (pp, HCI_REJECT_CONNECTION_REQUEST);
    UINT8_TO_STREAM  (pp, HCIC_PARAM_SIZE_REJECT_CONN);

    BDADDR_TO_STREAM (pp, dest);
    UINT8_TO_STREAM (pp, reason);

    counter_add("hci.conn.reject", 1);

    btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
    return (TRUE);
}
开发者ID:morrey,项目名称:bt_bcm,代码行数:24,代码来源:hcicmds.c

示例6: SimpleLink_Init_Start

//*****************************************************************************
//
//!  SimpleLink_Init_Start
//!
//!  @param  usPatchesAvailableAtHost  flag to indicate if patches available
//!                                    from host or from EEPROM. Due to the 
//!                                    fact the patches are burn to the EEPROM
//!                                    using the patch programmer utility, the 
//!                                    patches will be available from the EEPROM
//!                                    and not from the host.
//!
//!  @return   none
//!
//!  @brief    Send HCI_CMND_SIMPLE_LINK_START to CC3000
//
//*****************************************************************************
static void SimpleLink_Init_Start(UINT16 usPatchesAvailableAtHost)
{
	UINT8 *ptr;
	UINT8 *args;

	ptr = tSLInformation.pucTxCommandBuffer;
	args = (UINT8 *)(ptr + HEADERS_SIZE_CMD);

	UINT8_TO_STREAM(args, ((usPatchesAvailableAtHost) ? SL_PATCHES_REQUEST_FORCE_NONE : SL_PATCHES_REQUEST_DEFAULT));

	// IRQ Line asserted - send HCI_CMND_SIMPLE_LINK_START to CC3000
	hci_command_send(HCI_CMND_SIMPLE_LINK_START, ptr, WLAN_SL_INIT_START_PARAMS_LEN);

	SimpleLinkWaitEvent(HCI_CMND_SIMPLE_LINK_START, 0);
}
开发者ID:pabigot,项目名称:cc3000,代码行数:31,代码来源:wlan.c

示例7: hci_data_send

//*****************************************************************************
//
//!  hci_data_send
//!
//!  @param  usOpcode        command operation code
//!	 @param  ucArgs					 pointer to the command's arguments buffer
//!  @param  usArgsLength    length of the arguments
//!  @param  ucTail          pointer to the data buffer
//!  @param  usTailLength    buffer length
//!
//!  @return none
//!
//!  @brief              Initiate an HCI data write operation
//
//*****************************************************************************
long
hci_data_send(unsigned char ucOpcode, 
							unsigned char *ucArgs,
							unsigned short usArgsLength, 
							unsigned short usDataLength,
							const unsigned char *ucTail,
							unsigned short usTailLength)
{
	(void) ucTail;

	unsigned char *stream;
	
	stream = ((ucArgs) + SPI_HEADER_SIZE);
	
	UINT8_TO_STREAM(stream, HCI_TYPE_DATA);
	UINT8_TO_STREAM(stream, ucOpcode);
	UINT8_TO_STREAM(stream, usArgsLength);
	stream = UINT16_TO_STREAM(stream, usArgsLength + usDataLength + usTailLength);
	
	// Send the packet over the SPI
	SpiWrite(ucArgs, SIMPLE_LINK_HCI_DATA_HEADER_SIZE + usArgsLength + usDataLength + usTailLength);
	
	return(ESUCCESS);
}
开发者ID:Gozhack,项目名称:firmware,代码行数:39,代码来源:hci.c

示例8: SimpleLink_Init_Start

//*****************************************************************************
//
//!  SimpleLink_Init_Start
//!
//!  \param  scan_timeout     ...
//!  \param  num_of_entries   ...
//!
//!  \return         status of operation: ESUCCESS or EFAIL
//!
//!  \brief          Gets the WLAN scan operation result
//
//*****************************************************************************
static void SimpleLink_Init_Start(unsigned short usPatchesAvailableAtHost)
{
    unsigned char *ptr;
	unsigned char *args;

    ptr = tSLInformation.pucTxCommandBuffer;
	args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);

	UINT8_TO_STREAM(args, ((usPatchesAvailableAtHost) ? SL_PATCHES_REQUEST_FORCE_HOST : SL_PATCHES_REQUEST_DEFAULT));
	
	// IRQ Line asserted - start the read buffer size command
	hci_command_send(HCI_CMND_SIMPLE_LINK_START, ptr, WLAN_SL_INIT_START_PARAMS_LEN);
	
	SimpleLinkWaitEvent(HCI_CMND_SIMPLE_LINK_START, 0);
}
开发者ID:aaustin,项目名称:PawlerEngine,代码行数:27,代码来源:wlan.c

示例9: btif_mp_rx_data_ind

static void btif_mp_rx_data_ind(uint8_t evtcode, uint8_t *buf, uint8_t len)
{
    int i;
    uint8_t *pEvtBuf = BaseInterfaceModuleMemory.evtBuffer;
    
    BaseInterfaceModuleMemory.evtLen = sizeof(evtcode) + sizeof(len) + len;

    bt_mp_LogMsg("<-- HCI EVENT event code: 0x%x %d", evtcode, len);

    for( i = 0 ; i < len; i++ )
    {
        bt_mp_LogMsg(" 0x%x",buf[i]);
    }



    UINT8_TO_STREAM(pEvtBuf, evtcode);
    UINT8_TO_STREAM(pEvtBuf, len);
    
    memcpy(pEvtBuf, buf, len);
    

    bt_transport_signal_event(&BaseInterfaceModuleMemory, MP_TRANSPORT_EVENT_RX_HCIEVT);
}
开发者ID:LeMaker,项目名称:android-actions,代码行数:24,代码来源:btif_core.c

示例10: btsnd_hcic_create_conn

BOOLEAN btsnd_hcic_create_conn(BD_ADDR dest, UINT16 packet_types,
                               UINT8 page_scan_rep_mode, UINT8 page_scan_mode,
                               UINT16 clock_offset, UINT8 allow_switch)
{
    BT_HDR *p;
    UINT8 *pp;

    if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CREATE_CONN)) == NULL)
        return (FALSE);

    pp = (UINT8 *)(p + 1);

#ifndef BT_10A
    p->len    = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CREATE_CONN;
#else
    p->len    = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CREATE_CONN - 1;
#endif
    p->offset = 0;

    UINT16_TO_STREAM (pp, HCI_CREATE_CONNECTION);
#ifndef BT_10A
    UINT8_TO_STREAM  (pp, HCIC_PARAM_SIZE_CREATE_CONN);
#else
    UINT8_TO_STREAM  (pp, (HCIC_PARAM_SIZE_CREATE_CONN - 1));
#endif
    BDADDR_TO_STREAM (pp, dest);
    UINT16_TO_STREAM (pp, packet_types);
    UINT8_TO_STREAM  (pp, page_scan_rep_mode);
    UINT8_TO_STREAM  (pp, page_scan_mode);
    UINT16_TO_STREAM (pp, clock_offset);
#if !defined (BT_10A)
    UINT8_TO_STREAM  (pp, allow_switch);
#endif
    btm_acl_paging (p, dest);
    return (TRUE);
}
开发者ID:morrey,项目名称:bt_bcm,代码行数:36,代码来源:hcicmds.c

示例11: SimpleLink_Init_Start

//*****************************************************************************
//
//!  SimpleLink_Init_Start
//!
//!  @param  usPatchesAvailableAtHost  flag to indicate if patches available
//!                                    from host or from EEPROM. Due to the
//!                                    fact the patches are burn to the EEPROM
//!                                    using the patch programmer utility, the
//!                                    patches will be available from the EEPROM
//!                                    and not from the host.
//!
//!  @return   none
//!
//!  @brief    Send HCI_CMND_SIMPLE_LINK_START to CC3000
//
//*****************************************************************************
static void SimpleLink_Init_Start(unsigned short usPatchesAvailableAtHost)
{
    unsigned char *ptr;
    unsigned char *args;

    ptr = tSLInformation.pucTxCommandBuffer;
    args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);
    if (usPatchesAvailableAtHost > 2)
        usPatchesAvailableAtHost = 2;

    UINT8_TO_STREAM(args, usPatchesAvailableAtHost);

    // IRQ Line asserted - send HCI_CMND_SIMPLE_LINK_START to CC3000
    hci_command_send(HCI_CMND_SIMPLE_LINK_START, ptr, WLAN_SL_INIT_START_PARAMS_LEN);
    SimpleLinkWaitEvent(HCI_CMND_SIMPLE_LINK_START, 0);
}
开发者ID:abgordon,项目名称:arduino_code,代码行数:32,代码来源:wlan.cpp

示例12: UINT8_TO_STREAM

/*******************************************************************************
**
** Function         attp_build_opcode_cmd
**
** Description      Build a  request/response with opcode only.
**
** Returns          None.
**
*******************************************************************************/
BT_HDR *attp_build_opcode_cmd(UINT8 op_code)
{
    BT_HDR      *p_buf = NULL;
    UINT8       *p;

    if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + 1 + L2CAP_MIN_OFFSET)) != NULL)
    {
        p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET;
        p_buf->offset = L2CAP_MIN_OFFSET;

        UINT8_TO_STREAM (p, op_code);
        p_buf->len  = 1;
    }

    return p_buf;
}
开发者ID:10114395,项目名称:android-5.0.0_r5,代码行数:25,代码来源:att_protocol.c

示例13: smp_concatenate_peer

/*******************************************************************************
** Function         smp_concatenate_peer
**                  add pairing command received from peer device into p1.
*******************************************************************************/
void smp_concatenate_peer( tSMP_CB *p_cb, UINT8 **p_data, UINT8 op_code)
{
    UINT8   *p = *p_data;

    SMP_TRACE_DEBUG0 ("smp_concatenate_peer ");
    UINT8_TO_STREAM(p, op_code);
    UINT8_TO_STREAM(p, p_cb->peer_io_caps);
    UINT8_TO_STREAM(p, p_cb->peer_oob_flag);
    UINT8_TO_STREAM(p, p_cb->peer_auth_req);
    UINT8_TO_STREAM(p, p_cb->peer_enc_size);
    UINT8_TO_STREAM(p, p_cb->peer_i_key);
    UINT8_TO_STREAM(p, p_cb->peer_r_key);

    *p_data = p;
}
开发者ID:Android4SAM,项目名称:platform_external_bluetooth_bluedroid,代码行数:19,代码来源:smp_keys.c

示例14: smp_concatenate_local

/*******************************************************************************
** Function         smp_concatenate_peer
**                  add pairing command sent from local device into p1.
*******************************************************************************/
void smp_concatenate_local( tSMP_CB *p_cb, UINT8 **p_data, UINT8 op_code)
{
    UINT8   *p = *p_data;

    SMP_TRACE_DEBUG ("smp_concatenate_local ");
    UINT8_TO_STREAM(p, op_code);
    UINT8_TO_STREAM(p, p_cb->loc_io_caps);
    UINT8_TO_STREAM(p, p_cb->loc_oob_flag);
    UINT8_TO_STREAM(p, p_cb->loc_auth_req);
    UINT8_TO_STREAM(p, p_cb->loc_enc_size);
    UINT8_TO_STREAM(p, p_cb->loc_i_key);
    UINT8_TO_STREAM(p, p_cb->loc_r_key);

    *p_data = p;
}
开发者ID:android-ia,项目名称:wcs_vendor_intel_hardware_bt_wcs_bluedroid,代码行数:19,代码来源:smp_keys.c

示例15: btusb_lite_hci_cmd_cplt_evt_send

/*******************************************************************************
 **
 ** Function        btusb_lite_hci_cmd_cplt_evt_send
 **
 ** Description     Send an HCI VSC Cmd Complete.
 **
 ** Returns         Void
 **
 *******************************************************************************/
static void btusb_lite_hci_cmd_cplt_evt_send(struct btusb *p_dev,
        UINT16 opcode, UINT8 *p_param, UINT8 param_len)
{
    BT_HDR *p_msg;
    UINT16 size = param_len + 5;
    UINT8 *p;

    /* Get a buffer from the pool */
    p_msg = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + size);
    if(unlikely(!p_msg))
    {
        BTUSB_ERR("Unable to get GKI buffer\n");
        return;
    }

    if (unlikely(dbgflags & BTUSB_GKI_CHK_MSG) &&
        unlikely(GKI_buffer_status(p_msg) != BUF_STATUS_UNLINKED))
    {
        BTUSB_ERR("buffer != BUF_STATUS_UNLINKED 0x%p\n", p_msg);
        return;
    }

    p_msg->offset = 0;
    p_msg->event = HCIT_TYPE_EVENT;
    p_msg->len = size;
    p_msg->layer_specific = BTUSB_LS_GKI_BUFFER;

    p = (UINT8 *)(p_msg + 1) + p_msg->offset;

    p = btusb_lite_hci_write_evt_header(p, HCI_COMMAND_COMPLETE_EVT, size - 2);

    UINT8_TO_STREAM(p, BTUSB_LITE_HCI_NUM_CMD);  /* HCI Num Command */
    UINT16_TO_STREAM(p, opcode);  /* HCI OpCode */

    if (p_param)
    {
        ARRAY_TO_STREAM(p, p_param, param_len)
    }

    /* InQ for user-space to read */
    GKI_enqueue(&p_dev->rx_queue, p_msg);

    /* if the process is polling, indicate RX event */
    wake_up_interruptible(&p_dev->rx_wait_q);
}
开发者ID:laotie,项目名称:tina,代码行数:54,代码来源:btusb_lite_hci.c


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