RAvctp Class Reference

class RAvctp

AVCTP service provider

Note that because AVCTP is a connectionless protocol, this class doesn't provide an API to directly control all aspects of whether or not a connection exists to a remote device. It provides an API to force a connection to exist (RAvctp::ConnectRequest()) until either a MaenDisconnectIndicate or MaenDisconnectConfirm event is notified via the MAvctpEventNotify class that clients should derive from.

When using RAvctp clients need to make the distinction between an explicit connection and an actual connection. All this class provides is an API to bring up and in keeping a connection up by allowing explicit connections to be made. However if no explicit connection to a remote device has been made, that does NOT mandate that no such connection to this remote will exist. Instead it means the client doesn't care if there is a connection or not to this remote. Hence a client can receive messages from or send messages to a device they've not explicitly connected to.

Public Member Functions
RAvctp()
IMPORT_C voidClose(TCloseType)
IMPORT_C voidCloseGracefully()
IMPORT_C TIntInstallSecondaryChannel(MAvctpEventNotify &, MAvctpChannel *&)
IMPORT_C TIntOpen(MAvctpEventNotify &, SymbianAvctp::TPid, MAvctpChannel *&)
IMPORT_C voidUninstallSecondaryChannel(TCloseType)
Private Member Functions
RAvctp(const RAvctp &)
Public Member Enumerations
enumTCloseType { ENormal, EImmediate }
Private Attributes
CAvctpBody *iBody

Constructor & Destructor Documentation

RAvctp()

IMPORT_CRAvctp()

Default constructor

RAvctp(const RAvctp &)

RAvctp(const RAvctp &aObjectToCopy)[private]

The copy constructor is made private to help ensure there is only ever one RAvctp object per PID

Parameters

const RAvctp & aObjectToCopy

Member Functions Documentation

Close(TCloseType)

IMPORT_C voidClose(TCloseTypeaImmediacy = ENormal)

Closes the RAvctp session by immediately disconnecting all remote devices it is explicitly connected to, cancelling all outstanding requests and freeing all resources associated with it. This method deregisters aNotify from receiving any more AVCTP event notifications. The client will have to Open() this object before it can be used again.

This function is safe to call at almost any time. The only case when this is not appropriate is if a secondary channel is installed in a different thread AND that thread has it's own heap. For this case the UninstallSecondaryChannel function must be called in the thread running the secondary channel BEFORE this function is called.

RAvctp::UninstallSecondaryChannel

Parameters

TCloseType aImmediacy = ENormalif the default, ENormal, is used then this function will shutdown gracefully. if EImmediate is given then RAvctp will close as quickly as possible which may result in some data not actually being sent that the client had received a successful SendComplete.

CloseGracefully()

IMPORT_C voidCloseGracefully()

This function is not currently supported. Use of it will result in MaenErrorNotify being called with an error of KErrNotSupported.

InstallSecondaryChannel(MAvctpEventNotify &, MAvctpChannel *&)

IMPORT_C TIntInstallSecondaryChannel(MAvctpEventNotify &aSecondChannelObserver,
MAvctpChannel *&aSecondaryChannel
)

Installs the second AVCTP channel.

This is separated out from RAvctp::Open so that the client can choose to run RAvctp in two-thread mode in which the "second channel" Send and receive service provide in AVCTP Services is installed on another thread if the client so chooses.

Parameters

MAvctpEventNotify & aSecondChannelObserver
MAvctpChannel *& aSecondaryChannel

Open(MAvctpEventNotify &, SymbianAvctp::TPid, MAvctpChannel *&)

IMPORT_C TIntOpen(MAvctpEventNotify &aNotify,
SymbianAvctp::TPidaPid,
MAvctpChannel *&aPrimaryChannel
)
Opens a channel to the AVCTP protocol. Only one RAvctp can be registered to receive events on each PID.
panic
if Open() is not called before any other RAvctp method
capability
the SID of the process holding the RAvctp is checked if it is allowed to access aPid.
panic
if the RAvctp object is already open

Parameters

MAvctpEventNotify & aNotifythe MAvctpEventNotify object to notify with all this RAvctp's AVCTP events.
SymbianAvctp::TPid aPidthe PID on which RAvctp will be used
MAvctpChannel *& aPrimaryChannel

UninstallSecondaryChannel(TCloseType)

IMPORT_C voidUninstallSecondaryChannel(TCloseTypeaImmediacy = ENormal)

Uninstalls the second AVCTP channel. This can be used for when the AVCTP second channel is run in a different thread to the primary channel.

Parameters

TCloseType aImmediacy = ENormalif the default, ENormal, is used then this function will shutdown gracefully. if EImmediate is given then the second channel will close as quickly as possible which may result in some data not actually being sent that the client had received a successful SendComplete.

Member Enumerations Documentation

Enum TCloseType

Enumerators

ENormal
EImmediate

Member Data Documentation

CAvctpBody * iBody

CAvctpBody *iBody[private]