📄 btcommtransport.cpp
字号:
// Copyright (c) 2004 - 2007, Symbian Software Ltd. All rights reserved.
#include "btcommtransport.h"
CBtCommTransport* CBtCommTransport::NewL(TAny* aTransportCreateInfo)
/**
Factory function opens a comm port on BTCOMM::0.
@param aTransportCreateInfo Pointer to an instance of
TTransportCreateInfo, which contains the
data required to allocate the transport.
The address field is not used.
@return New, initialized COMM connection.
*/
{
_LIT(KBtCommCsyName, "BTCOMM");
_LIT(KBtCommPortName, "BTCOMM::0");
const TTransportInterfaceCreateInfo& tci =
*reinterpret_cast<TTransportInterfaceCreateInfo*>(aTransportCreateInfo);
CBtCommTransport* self = new(ELeave) CBtCommTransport(tci.iObserver);
CleanupStack::PushL(self);
self->ConstructL(KBtCommCsyName, KBtCommPortName, tci.iInitListen);
CleanupStack::Pop(self);
return self;
}
CBtCommTransport::CBtCommTransport(MTransportObserver& aObserver)
/**
This c'tor is defined to pass the supplied observer to the superclass.
@param aObserver Observer to notify about transport events.
This is managed by the CTransport superclass.
*/
: CRs232Transport(aObserver)
{
// empty.
}
CBtCommTransport::~CBtCommTransport()
/**
This d'tor is defined here to ensure that only one
instance is generated.
*/
{
// resources are freed in the CRs232Transport d'tor.
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -