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


C++ PDU::channel方法代码示例

本文整理汇总了C++中PDU::channel方法的典型用法代码示例。如果您正苦于以下问题:C++ PDU::channel方法的具体用法?C++ PDU::channel怎么用?C++ PDU::channel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PDU的用法示例。


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

示例1: onPDU

void DecodeCallBack::onPDU ( const PDU& pdu)
{
    switch (pdu.channel())
    {
    case PDU::other:
        break;
    case PDU::le:
        break;    
    case PDU::bccmd:
        onBCCMDResponse(pdu);
        break;
    case PDU::hq:
        onHQRequest(pdu);
        break;
    case PDU::dm:
        break;
    case PDU::hciCommand:
        onHCIEvent(pdu);
        break;
    case PDU::hciACL:
        onHCIACLData(pdu);
        break;
    case PDU::hciSCO:
        onHCISCOData(pdu);
        break;
    case PDU::l2cap:
        break;
    case PDU::rfcomm:
        break;
    case PDU::sdp:
        break;
    case PDU::debug:
        onDebug(pdu);
        break;
    case PDU::upgrade:
        break;
    case PDU::vm:
        onVMData(pdu);
        break;
    case PDU::bcsp_channel_count:
        break;
    case PDU::lmp_debug:
        onLMPdebug(pdu);
        break;
    default:
        break;
    }
}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:48,代码来源:decodecallback.cpp

示例2: sendTunnel

// Send a PDU that requires HCI tunnelling for manufacturer extensions
void BlueCoreTransportImplementation::sendTunnel ( const PDU& aPacket )
{
    if (tunnel)
    {
        uint8 data[HCI_TUNNEL_HEADER_SIZE+HCI_TUNNEL_MAX_PAYLOAD];
        size_t offset = 0;
        while ( offset < aPacket.size() )
        {
			size_t lLength = aPacket.size() - offset;
			while (1)
			{
				// Calculate the payload length and descriptor
				uint8 descriptor = aPacket.channel();
				if (offset == 0)
					descriptor |= HCI_TUNNEL_FIRST;

				if (HCI_TUNNEL_MAX_PAYLOAD < lLength)
					lLength = HCI_TUNNEL_MAX_PAYLOAD;

				if (offset + lLength == aPacket.size())
					descriptor |= HCI_TUNNEL_LAST;

				// Build and send the HCI command for this fragment
				data[0] = uint8(HCI_TUNNEL_COMMAND & 0xff);
				data[1] = uint8(HCI_TUNNEL_COMMAND >> 8);
				data[2] = uint8(lLength + 1);
				data[3] = descriptor;
				memcpy(data + HCI_TUNNEL_HEADER_SIZE, aPacket.data() + offset, lLength);
				PDU p(PDU::hciCommand, data, HCI_TUNNEL_HEADER_SIZE + lLength);
				if (pdu_size_forbidden(p))
				{
					// can't send pdu of this length. try one size smaller.
					--lLength;
				}
				else
				{
					sendpdu(p);
					break;
				}
			}

            offset += lLength;
        }
    }
}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:46,代码来源:transportimplementation.cpp

示例3: ignoresFlowControl

static bool ignoresFlowControl ( const PDU& pdu )
{
    switch ( pdu.channel() )
    {
    case PDU::hciCommand :
        {
        HCICommandPDU cmd ( pdu.data() , pdu.size() );
        switch ( cmd.get_op_code() )
        {
		case HCI_ACCEPT_CONNECTION_REQ:
		case HCI_REJECT_CONNECTION_REQ:
        case HCI_LINK_KEY_REQ_REPLY:
        case HCI_LINK_KEY_REQ_NEG_REPLY:
        case HCI_PIN_CODE_REQ_REPLY:
        case HCI_PIN_CODE_REQ_NEG_REPLY:
		case HCI_ACCEPT_SYNCHRONOUS_CONN_REQ:
		case HCI_REJECT_SYNCHRONOUS_CONN_REQ:
		case HCI_IO_CAPABILITY_RESPONSE:
		case HCI_USER_CONFIRMATION_REQUEST_REPLY:
		case HCI_USER_CONFIRMATION_REQUEST_NEG_REPLY:
		case HCI_USER_PASSKEY_REQUEST_REPLY:
		case HCI_USER_PASSKEY_REQUEST_NEG_REPLY:
		case HCI_REMOTE_OOB_DATA_REQUEST_REPLY:
		case HCI_REMOTE_OOB_DATA_REQUEST_NEG_REPLY:
		case HCI_IO_CAPABILITY_REQUEST_NEG_REPLY:
        case HCI_RESET:
        case HCI_HOST_NUM_COMPLETED_PACKETS:
        case HCI_ULP_LONG_TERM_KEY_REQUESTED_REPLY:
        case HCI_ULP_LONG_TERM_KEY_REQUESTED_NEGATIVE_REPLY:
        case 0xFC00:
            return true;
            break;
        default:
            break;
        }
        break;
        }
    default:
        break;
    };
    return false;
}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:42,代码来源:implementation.cpp

示例4: here

void H4Queues::addNewPacket(const PDU &pdu, uint8 h4HeaderByte, bool needCallback)
{
#ifdef H4_MULTIQUEUE
	int queuenum;
	// Search for an ordered Q of this type, if none is found then 
	// queuenum is left at the last unordered Q.
    for (queuenum = 0; queuenum < H4_NUM_ORDERED_QUEUES; ++queuenum)
		if (queue[queuenum].pktType == pdu.channel())
			break;
#endif

    CriticalSection::Lock here(cs);

#ifdef H4_MULTIQUEUE
	queue[queuenum].list.push(H4_QUEUE::QueueItem(pdu, h4HeaderByte, needCallback));
#else
	queue.list.push(H4_QUEUE::QueueItem(pdu, h4HeaderByte, needCallback));
#endif

	++packetCount;
}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:21,代码来源:h4_queues.cpp

示例5:

/*virtual*/ void BCSPH5Transport::recvOther(const PDU &aPacket)
{
	recvData(aPacket.channel(), aPacket.data(), aPacket.size());
}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:4,代码来源:bcsph5transport.cpp


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