RGavdp Class Reference

class RGavdp

Represents a single GAVDP session to a remote device. If an app wishes to (eg) listen after connecting a GAVDP link it should instantiate another RGavdp.

Note this class uses internal active objects to provide the underlying services. Clients should be careful to allow these objects to run.

One RGavdp represents one remote device. If an inbound connection is made then a new RGavdp must be instantiated to form a stream to another device. Once RGavdp instance may be used to manage more than 1 local SEP. This is useful if the client only ever intends to support one active stream, but wishes to select from >1 codec. Alternatively >1 instance of RGavdp may be created, with a desire to manage each local SEP with each RGavdp instance. This would allow >1 active stream.

Public Member Functions
RGavdp()
IMPORT_C voidAbortStream(TSEID)
IMPORT_C TIntAddSEPCapability(const TAvdtpServiceCapability &)
IMPORT_C TIntBeginConfiguringLocalSEP(TSEID)
IMPORT_C TIntBeginConfiguringRemoteSEP(TSEID, TSEID)
IMPORT_C voidCancel()
IMPORT_C voidClose()
IMPORT_C voidCommitSEPConfiguration()
IMPORT_C voidConnect(const TBTDevAddr &)
IMPORT_C TIntCreateBearerSockets(TSEID, TBool, TBool)
IMPORT_C TIntCreateBearerSockets(TSEID)
IMPORT_C voidDiscoverRemoteSEPs()
IMPORT_C voidGetRemoteSEPCapabilities(TSEID, const TAvdtpServiceCategories &)
IMPORT_C TIntListen()
IMPORT_C TIntMaxSecurityControlLength()
IMPORT_C TIntOpen(MGavdpUser &, RSocketServ &)
IMPORT_C TIntRegisterSEP(TAvdtpSEPInfo &)
IMPORT_C voidSendSecurityControl(TSEID, const TDesC8 &)
IMPORT_C TIntShutdown()
IMPORT_C voidStartStream(TSEID)
IMPORT_C voidSuspendStream(TSEID)
voidUnbindBody()
Private Attributes
CGavdp *iGavdpImp

Constructor & Destructor Documentation

RGavdp()

IMPORT_CRGavdp()

Default Constructor

Member Functions Documentation

AbortStream(TSEID)

IMPORT_C voidAbortStream(TSEIDaSEID)
Abort stream
Note:

that once complete the state of the SEP will be Idle. Thus to restream, the SEP has to be reconfigured, opened and started.

Parameters

TSEID aSEIDthe SEID of the local or remote SEP that requires aborting.

AddSEPCapability(const TAvdtpServiceCapability &)

IMPORT_C TIntAddSEPCapability(const TAvdtpServiceCapability &aCapability)

Add a particular capability into a SEP. When called on a local SEP this equates to adding capabilities into the SEP. When called on a remote SEP this equates to configuring the SEP. TAvdtpServiceCapability

Parameters

const TAvdtpServiceCapability & aCapabilitya capability

BeginConfiguringLocalSEP(TSEID)

IMPORT_C TIntBeginConfiguringLocalSEP(TSEIDaSEID)

Begin configuring (or reconfiguring) a local SEP. Subsequent calls are used to add each configuration required. RGavdp::AddSEPCapability

Parameters

TSEID aSEIDthe ID of the local SEP.

BeginConfiguringRemoteSEP(TSEID, TSEID)

IMPORT_C TIntBeginConfiguringRemoteSEP(TSEIDaRemoteSEID,
TSEIDaLocalSEID
)

Begin configuring (or reconfiguring) a remote SEP. Subsequent calls are used to add each configuration required. RGavdp::AddSEPCapability

Parameters

TSEID aRemoteSEIDthe ID of the remote SEP.
TSEID aLocalSEIDthe ID of the local SEP.

Cancel()

IMPORT_C voidCancel()

Cancel the outstanding client request. As per usual Symbian OS Cancel semantics, this method does not guarantee that the outstanding request was "undone". Therefore to reset each sides' state the client should consider sending an Abort too. RGavdp::AbortStream

Close()

IMPORT_C voidClose()
Closes the GAVDP session and frees all resources associated with it. This function should not be called from within a client's implementation of any MGavdpUser (upcall) method.
Note:

not to be confused with the "Close" primitive in the GAVDP spec. This is merely closing the handle in the Symbian OS sense.

However, if this is Closed when streams are active, the Bluetooth subsystem shall Release all Streams managed by this RGavdp instance.

that the closure of any bearer sockets created remains the responsibility of the client.

CommitSEPConfiguration()

IMPORT_C voidCommitSEPConfiguration()

Finalises the (re)configuration of the SEP

Connect(const TBTDevAddr &)

IMPORT_C voidConnect(const TBTDevAddr &aRemoteAddr)

Connects a GAVDP session - i.e. creates an AVDTP signalling channel to a remote device. The signalling channel may already exist, in which case this session is added as a user of that channel. The necessary multiplexing is implemented in AVDTP, so the client need not be concerned with this.

Parameters

const TBTDevAddr & aRemoteAddrthe Bluetooth device address of the remote GAVDP entity.

CreateBearerSockets(TSEID, TBool, TBool)

IMPORT_C TIntCreateBearerSockets(TSEIDaSEID,
TBoolaIgnored1,
TBoolaIgnored2
)
Creates bearers (in the form of sockets) for sessions on the stream. The sessions are media + optional reporting + optional recovery. The sockets will be created on the client's Socket Server session. The sockets may then be passed into RTP for its use. If the sockets are passed to RTP the client still has the responsibility of closing them.
  • i.e. neither RTP nor GAVDP will close the sockets. The reporting/recovery config is already known by the stream. All the required bearers will be created.

RGavdp::CreateBearerSockets(TSEID aSEID)

Parameters

TSEID aSEIDThe SEID of the remote SEP for which the sockets are required.
TBool aIgnored1Source compatibility place holder
TBool aIgnored2Source compatibility place holder

CreateBearerSockets(TSEID)

IMPORT_C TIntCreateBearerSockets(TSEIDaSEID)
Creates bearers (in the form of sockets) for sessions on the stream. The sessions are media + optional reporting + optional recovery. The sockets will be created on the client's Socket Server session. The sockets may then be passed into RTP for its use. If the sockets are passed to RTP the client still has the responsibility of closing them.
  • i.e. neither RTP nor GAVDP will close the sockets. The reporting/recovery config is already known by the stream. All the required bearers will be created.

Parameters

TSEID aSEIDThe SEID of the remote SEP for which the sockets are required.

DiscoverRemoteSEPs()

IMPORT_C voidDiscoverRemoteSEPs()
Discover the Stream endpoints (SEPs) on the remote device. Callbacks on MGavdpUser will be called as a result of this call.
Pre-condition
a Signalling channel must have been successfully created
MGavdpUser::GAVDP_SEPDiscovered

GetRemoteSEPCapabilities(TSEID, const TAvdtpServiceCategories &)

IMPORT_C voidGetRemoteSEPCapabilities(TSEIDaSEID,
const TAvdtpServiceCategories &aInterestingCategories
)

Get the capabilities of a remote Stream Endpoint (SEP). Callbacks on MGavdpUser will be called for the intersection of capabilities that the remote supports and that the local GAVDP user is interested in using.

Parameters

TSEID aSEIDthe ID of the remote SEP for which capabilities are to be retrieved.
const TAvdtpServiceCategories & aInterestingCategoriesthe categories the local GAVDP client is interested in.

Listen()

IMPORT_C TIntListen()
Listen for inbound signalling channel connections. This is useful when the signalling channel is lost. Note: This function will not connect the session to any existing connected signalling channels. The session will only be connected upon the next channel being connected. Users should use Connect instead if they intend to connect to existing signalling channels.
Pre-condition
At least SEP shall have been registered
RGavdp::RegisterSEP(TAvdtpSEPInfo& aInfo)
panic
The client thread will be panicked if Listen is called prior to any SEPs being registered.

MaxSecurityControlLength()

IMPORT_C TIntMaxSecurityControlLength()

This function returns the deprecated value KMaxAvdtpSecurityControlInfo so as to ensure that the return value is what partners will expect during the transition period from the use of the old constant to this new API. When the constant is removed from BluetoothAV.h it should be moved to an internal header.

Open(MGavdpUser &, RSocketServ &)

IMPORT_C TIntOpen(MGavdpUser &aServiceUser,
RSocketServ &aSocketServer
)
Open a GAVDP session.
Note:

not to be confused with the "Open" primitive in the GAVDP spec. This is merely opening the handle in the Symbian OS sense.

RegisterSEP

Parameters

MGavdpUser & aServiceUsera reference to a MGavdpUser mixin for GAVDP callback events.
RSocketServ & aSocketServerreference to the client's Socket Server session.

RegisterSEP(TAvdtpSEPInfo &)

IMPORT_C TIntRegisterSEP(TAvdtpSEPInfo &aInfo)

Register an extra local SEP.

Parameters

TAvdtpSEPInfo & aInforeference containing SEP information. Note the SEID assigned by AVDTP will be written back into aInfo.

SendSecurityControl(TSEID, const TDesC8 &)

IMPORT_C voidSendSecurityControl(TSEIDaSEID,
const TDesC8 &aSecurityData
)

Send security control data to remote SEP. The meaning of this is dependent on the configured Content Protection method. TAvdtpContentProtectionCapabilities

Parameters

TSEID aSEIDthe seid of the remote SEP
const TDesC8 & aSecurityDatathe security data

Shutdown()

IMPORT_C TIntShutdown()

Disconnects the RGavdp session from the signalling channel, but does not destroy the local SEPs owned by the signalling channel. Must only be called if the remote SEP has not yet been configured - if the remote SEP has been configured then AbortStream() should be called.

panic
If remote SEP configured

StartStream(TSEID)

IMPORT_C voidStartStream(TSEIDaSEID)

Start stream

Parameters

TSEID aSEIDthe SEID of the local or remote SEP that requires starting

SuspendStream(TSEID)

IMPORT_C voidSuspendStream(TSEIDaSEID)
Suspend stream
Note:

that the remote may not support Suspend, and an AVDTP NOT_SUPPORTED_COMMAND error may result. In this case the client should consider Closing the stream.

Parameters

TSEID aSEIDthe SEID of the local or remote SEP that requires suspending.

UnbindBody()

voidUnbindBody()

Member Data Documentation

CGavdp * iGavdpImp

CGavdp *iGavdpImp[private]