⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objectexchangeservicesearcher.cpp

📁 symbian平台蓝牙程序,功能实现:搜索设备,指定时间间隔搜索,对指定的设备发送信息,也可指定时间间隔发送,日志操作,可通过mms,红外,蓝牙发送日志等
💻 CPP
字号:
/* Copyright (c) 2002, Nokia Mobile Phones. All rights reserved */

#include <bt_sock.h>
#include "ObjectExchangeServiceSearcher.h"
#include "BTObjectExchange.pan"
#include "ObjectExchangeProtocolConstants.h"

const TSdpAttributeParser::SSdpAttributeNode gObexProtocolListData[] = 
    {
        { TSdpAttributeParser::ECheckType, ETypeDES },
            { TSdpAttributeParser::ECheckType, ETypeDES },
                { TSdpAttributeParser::ECheckValue, ETypeUUID, KL2CAP },
            { TSdpAttributeParser::ECheckEnd },
            { TSdpAttributeParser::ECheckType, ETypeDES },
                { TSdpAttributeParser::ECheckValue, ETypeUUID, KRFCOMM },
                { TSdpAttributeParser::EReadValue, ETypeUint, KRfcommChannel },
            { TSdpAttributeParser::ECheckEnd },
            { TSdpAttributeParser::ECheckType, ETypeDES },
                { TSdpAttributeParser::ECheckValue, ETypeUUID, KBtProtocolIdOBEX },
            { TSdpAttributeParser::ECheckEnd },
        { TSdpAttributeParser::ECheckEnd },
    { TSdpAttributeParser::EFinished }
    };

const TStaticArrayC<TSdpAttributeParser::SSdpAttributeNode> gObexProtocolList =
CONSTRUCT_STATIC_ARRAY_C(
    gObexProtocolListData
);

CObjectExchangeServiceSearcher* CObjectExchangeServiceSearcher::NewL()//MLog& aLog)
    {
    CObjectExchangeServiceSearcher* self = CObjectExchangeServiceSearcher::NewLC();//aLog);
    CleanupStack::Pop(self);
    return self;
    }
    
CObjectExchangeServiceSearcher* CObjectExchangeServiceSearcher::NewLC()//MLog& aLog)
    {
    CObjectExchangeServiceSearcher* self = new (ELeave) CObjectExchangeServiceSearcher();//aLog);
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

CObjectExchangeServiceSearcher::CObjectExchangeServiceSearcher()//MLog& aLog)
: CBTServiceSearcher(),
  iServiceClass(KServiceClass),
  iPort(-1)
    {
    }

CObjectExchangeServiceSearcher::~CObjectExchangeServiceSearcher()
    {
    }

void CObjectExchangeServiceSearcher::ConstructL()
    {
    // no implementation required
    }

const TUUID& CObjectExchangeServiceSearcher::ServiceClass() const
    {
    return iServiceClass;
    }

const TSdpAttributeParser::TSdpAttributeList& CObjectExchangeServiceSearcher::ProtocolList() const
    {
    return gObexProtocolList;
    }

void CObjectExchangeServiceSearcher::FoundElementL(TInt aKey, CSdpAttrValue& aValue)
    {
    __ASSERT_ALWAYS(aKey == static_cast<TInt>(KRfcommChannel), Panic(EBTObjectExchangeProtocolRead));
    iPort = aValue.Uint();
    }

TInt CObjectExchangeServiceSearcher::Port()
    {
    return iPort;
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -