CSensrvChannel Class Reference

class CSensrvChannel : public CBase

Implements channel related handling.

Since
S60 5.0

Inherits from

Public Member Functions
~CSensrvChannel()
CSensrvChannelBuffer *Buffer()
voidChannelClosed()
TSensrvResourceChannelInfo::TSensrvChannelGroup ChannelGroup()
voidChannelOpened(TInt, MSsyChannelDataProvider *, MSsyPropertyProvider *)
voidCompleteTransaction(CSensrvTransaction *)
CSensrvConditionEvaluator *ConditionEvaluatorL()
CSensrvTransaction *DataAvailableTransaction()
TInt DataItemSize()
MSsyChannelDataProvider *DataProvider()
voidDispatchMessage(CSensrvMessage &)
voidForceBufferFilled()
CSensrvTransaction *ForceBufferFilledTransaction()
CSensrvTransaction *ForceChannelCloseTransaction()
voidGetAffectedClients(RArray< TInt > &, TSecureId)
TInt GetHighestListenerPriority(TInt &)
CSensrvChannelListener *GetListener(CSensrvSession *)
voidHandleSsyNotifyFailure()
TSensrvChannelId Id()
TInt ListenerCount()
TInt MaxBufferingCount()
CSensrvChannel *NewL(const TSensrvResourceChannelInfo &, CSensrvPluginProxy &)
CSensrvTransaction *PropertyChangedTransaction()
MSsyPropertyProvider *PropertyProvider()
CSensrvPluginProxy &Proxy()
TInt RecalculateBufferingCount()
voidSessionTerminated(CSensrvSession *)
TSensrvChannelState State()
TBool StoreChangedProperty(const TSensrvProperty &, const CSensrvSession *)
voidTakePropertySetControl(CSensrvChannelListener *)
CSensrvChannelListener *TakenPropertySetControl()
Private Member Functions
CSensrvChannel(const TSensrvChannelInfo &, CSensrvPluginProxy &)
voidCloseIfNeeded()
voidConstructL()
voidDeleteListener(CSensrvSession *)
CSensrvChannelListener *FindListener(CSensrvSession *)
RSensrvChannelList *GetAffectedChannels()
RSensrvChannelList *GetAvailabilityAffectedChannels(TSensrvAvailability)
TInt GetHighestChannelPriority(const RSensrvChannelList *, TSensrvChannelId &)
TInt GetHighestListenerPriorityOfAffectedChannels(TInt &)
TInt GetLowestChannelPriority(const RSensrvChannelList *, TSensrvChannelId &)
voidHandleAvailabilityChange(const TSensrvProperty &)
voidHandleAvailabilityChange(const TSensrvAvailability &)
voidHandleDependencyOnClose(const TInt &)
voidHandleDependencyOnOpen()
voidHandleNextTransaction()
voidHandleSetPropertySuccessIndOnCreateOrDelete()
voidHandleSetPropertySuccessIndOnPropertyChange()
TInt HandleStartListeningTransaction(CSensrvTransaction &)
TInt HandleStopListeningTransaction(CSensrvTransaction &, TBool &)
TSensrvResourceChannelInfo::TSensrvChannelGroup ReadChannelGroup()
TInt SetAvailability(TSensrvChannelId, TSensrvProperty &, TSensrvAvailability, const TSecurityInfo &)
TInt SetChannelAvailability(TSensrvChannelId, TSensrvChannelId, TSensrvProperty &)
TInt SetChannelAvailability(TSensrvChannelId, TSensrvProperty &, TSensrvAvailability)
voidSetChannelAvailable()
voidSetChannelUnavailable()
voidUpdateSetPropertySuccessIndToChannelListeners(CSensrvChannel &, TInt, TInt)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTSensrvChannelState { EChannelStateClosed, EChannelStateOpen, EChannelStateListening }
Private Attributes
CSensrvChannelBuffer *iChannelBuffer
TSensrvResourceChannelInfo iChannelInfo
CSensrvTransactionQueue *iChannelQueue
CSensrvConditionEvaluator *iConditionEvaluator
CSensrvChannelListener *iCurrentSetPropertyControl
CSensrvTransaction *iDataAvailableTransaction
MSsyChannelDataProvider *iDataProvider
CSensrvTransaction *iForceBufferFilledTransaction
CSensrvTransaction *iForceChannelCloseTransaction
TBool iForcingBufferFilled
TInt iHighestListenerPriority
TInt iHighestListenerPriorityMultiples
TSensrvChannelId iId
RPointerArray< CSensrvChannelListener >iListenerList
TInt iMaxBufferingCount
CSensrvTransaction *iPropertyChangedTransaction
MSsyPropertyProvider *iPropertyProvider
CSensrvPluginProxy &iProxy
TSensrvChannelState iState

Constructor & Destructor Documentation

CSensrvChannel(const TSensrvChannelInfo &, CSensrvPluginProxy &)

CSensrvChannel(const TSensrvChannelInfo &aInfo,
CSensrvPluginProxy &aProxy
)[private]

C++ constructor

Since
S60 5.0

Parameters

const TSensrvChannelInfo & aInfoChannel info.
CSensrvPluginProxy & aProxyCallback proxy.

~CSensrvChannel()

~CSensrvChannel()[virtual]

Destructor.

Member Functions Documentation

Buffer()

CSensrvChannelBuffer *Buffer()[inline]

Gets data buffer pointer. Called from SSY thread.

Since
S60 5.0

ChannelClosed()

voidChannelClosed()

Indicates channel has been closed by SSY Called from SSY thread only.

Since
S60 5.0

ChannelGroup()

TSensrvResourceChannelInfo::TSensrvChannelGroup ChannelGroup()

Gets channel group Called from server thread.

Since
S60 5.0

ChannelOpened(TInt, MSsyChannelDataProvider *, MSsyPropertyProvider *)

voidChannelOpened(TIntaErrorCode,
MSsyChannelDataProvider *aDataProvider,
MSsyPropertyProvider *aSensorPropertyProvider
)

Indicates channel has been opened by SSY Called from SSY thread only.

Since
S60 5.0

Parameters

TInt aErrorCodeIndicates any error that occurred during channel opening.
MSsyChannelDataProvider * aDataProviderPointer to channel data provider instance
MSsyPropertyProvider * aSensorPropertyProviderPointer to sensor property provider instance

CloseIfNeeded()

voidCloseIfNeeded()[private]

Closes the channel to SSY if there are no listeners.

Since
S60 5.0

CompleteTransaction(CSensrvTransaction *)

voidCompleteTransaction(CSensrvTransaction *aTransaction)

Completes transaction after it has been handled by SSY. Only called from server thread.

Since
S60 5.0

Parameters

CSensrvTransaction * aTransactionThe transaction to complete

ConditionEvaluatorL()

CSensrvConditionEvaluator *ConditionEvaluatorL()

Creates a new condition evaluator or returns an existing one.

Since
S60 5.0

ConstructL()

voidConstructL()[private]

2nd phase of construction

Since
S60 5.0

DataAvailableTransaction()

CSensrvTransaction *DataAvailableTransaction()const [inline]

Gets the persistent ETransTypeMediatorNewDataAvailable transaction. Called from SSY thread.

Since
S60 5.0

DataItemSize()

TInt DataItemSize()const [inline]

Gets the data item size Called from server thread.

Since
S60 5.0

DataProvider()

MSsyChannelDataProvider *DataProvider()[inline]

Gets data provider pointer. Called from SSY thread.

Since
S60 5.0

DeleteListener(CSensrvSession *)

voidDeleteListener(CSensrvSession *aSession)[private]

Deletes a listener.

Since
S60 5.0

Parameters

CSensrvSession * aSessionSession for which the listener is deleted.

DispatchMessage(CSensrvMessage &)

voidDispatchMessage(CSensrvMessage &aMessage)

Handles client message. Message completion responsibility transfers. Called only within server thread.

Since
S60 5.0

Parameters

CSensrvMessage & aMessageThe message containing the client request.

FindListener(CSensrvSession *)

CSensrvChannelListener *FindListener(CSensrvSession *aSession)[private]

Finds a listener by session.

Since
S60 5.0

Parameters

CSensrvSession * aSessionSession for which the listener is found.

ForceBufferFilled()

voidForceBufferFilled()

Forces buffer filled at SSY

Since
S60 5.0

ForceBufferFilledTransaction()

CSensrvTransaction *ForceBufferFilledTransaction()const [inline]

Gets the persistent ETransTypeMediatorForceBufferFilled transaction. Called from server thread.

Since
S60 5.0

ForceChannelCloseTransaction()

CSensrvTransaction *ForceChannelCloseTransaction()const [inline]

Gets the persistent ETransTypeMediatorForceChannelClose transaction. Called from SSY thread.

Since
S60 5.0

GetAffectedChannels()

RSensrvChannelList *GetAffectedChannels()const [private]

Gets the affected channel list from SSY

Since
S60 5.0

GetAffectedClients(RArray< TInt > &, TSecureId)

voidGetAffectedClients(RArray< TInt > &aAffectedClients,
TSecureIdaCallerSecureId
)

Get clients of this channel. The client identified by aCallerSecureId is not added to the affected clients list.

Since
S60 5.0

Parameters

RArray< TInt > & aAffectedClientsOn return contains client processes priorities for this channel.
TSecureId aCallerSecureIdIdentifies the listener which is filtered away.

GetAvailabilityAffectedChannels(TSensrvAvailability)

RSensrvChannelList *GetAvailabilityAffectedChannels(TSensrvAvailabilityaValue)const [private]

Gets the affected channel list from SSY

Since
S60 5.0

Parameters

TSensrvAvailability aValue

GetHighestChannelPriority(const RSensrvChannelList *, TSensrvChannelId &)

TInt GetHighestChannelPriority(const RSensrvChannelList *aAffectedChannelsList,
TSensrvChannelId &aChannelId
)[private]

Get channel from affected channels list with the highest priority

Since
S60 5.0

Parameters

const RSensrvChannelList * aAffectedChannelsList
TSensrvChannelId & aChannelId

GetHighestListenerPriority(TInt &)

TInt GetHighestListenerPriority(TInt &aHighestPriority)

Gets the highest priority listener and its multiples from this channel.

Since
S60 5.0

Parameters

TInt & aHighestPriorityStores the highest priority.

GetHighestListenerPriorityOfAffectedChannels(TInt &)

TInt GetHighestListenerPriorityOfAffectedChannels(TInt &aHighestPriority)[private]

Gets the highest priority listener and its multiples from all affected channels.

Since
S60 5.0

Parameters

TInt & aHighestPriorityStores the highest priority.

GetListener(CSensrvSession *)

CSensrvChannelListener *GetListener(CSensrvSession *aSession)

Gets listener for session.

Since
S60 5.0

Parameters

CSensrvSession * aSessionSession for which the listener is needed.

GetLowestChannelPriority(const RSensrvChannelList *, TSensrvChannelId &)

TInt GetLowestChannelPriority(const RSensrvChannelList *aAffectedChannelsList,
TSensrvChannelId &aChannelId
)[private]

Get channel from affected channels list with the lowest priority

Since
S60 5.0

Parameters

const RSensrvChannelList * aAffectedChannelsList
TSensrvChannelId & aChannelId

HandleAvailabilityChange(const TSensrvProperty &)

voidHandleAvailabilityChange(const TSensrvProperty &aProperty)[private]

Handles channel availability property change

Since
S60 5.0

Parameters

const TSensrvProperty & aProperty

HandleAvailabilityChange(const TSensrvAvailability &)

voidHandleAvailabilityChange(const TSensrvAvailability &value)[private]

Handles channel availability property change

Since
S60 5.0

Parameters

const TSensrvAvailability & value

HandleDependencyOnClose(const TInt &)

voidHandleDependencyOnClose(const TInt &aPriority)[private]

Handles dependent channels on channel close

Since
S60 5.0

Parameters

const TInt & aPriority

HandleDependencyOnOpen()

voidHandleDependencyOnOpen()[private]

Handles dependent channels on channel open

Since
S60 5.0

HandleNextTransaction()

voidHandleNextTransaction()[private]

Handles next transaction in queue. If first transaction is still executing or the queue is empty, does nothing.

Since
S60 5.0

HandleSetPropertySuccessIndOnCreateOrDelete()

voidHandleSetPropertySuccessIndOnCreateOrDelete()[private]

Handles set property success indications on listener creation or deletion

Since
S60 5.0

HandleSetPropertySuccessIndOnPropertyChange()

voidHandleSetPropertySuccessIndOnPropertyChange()[private]

Handles set property success indications on property change

Since
S60 5.0

HandleSsyNotifyFailure()

voidHandleSsyNotifyFailure()

Handles notify failure at SSY

Since
S60 5.0

HandleStartListeningTransaction(CSensrvTransaction &)

TInt HandleStartListeningTransaction(CSensrvTransaction &aTransaction)[private]

Handles start data and condition listening transactions

Since
S60 5.0

Parameters

CSensrvTransaction & aTransactionReference to the transaction.

HandleStopListeningTransaction(CSensrvTransaction &, TBool &)

TInt HandleStopListeningTransaction(CSensrvTransaction &aTransaction,
TBool &aSsyTransactionNeeded
)[private]

Handles stop data and condition listening transactions

Since
S60 5.0

Parameters

CSensrvTransaction & aTransactionReference to the transaction.
TBool & aSsyTransactionNeededReturns ETrue if SSY transaction is needed.

Id()

TSensrvChannelId Id()[inline]

Returns the channel id

Since
S60 5.0

ListenerCount()

TInt ListenerCount()const [inline]

Gets the listener count. Called from server thread.

Since
S60 5.0

MaxBufferingCount()

TInt MaxBufferingCount()[inline]

Gets maximum allowed buffering count. Called from server thread.

Since
S60 5.0

NewL(const TSensrvResourceChannelInfo &, CSensrvPluginProxy &)

CSensrvChannel *NewL(const TSensrvResourceChannelInfo &aInfo,
CSensrvPluginProxy &aProxy
)[static]

Two phase constructor

Since
S60 5.0
Exceptions
KErrNoMemory

Out of memory

Parameters

const TSensrvResourceChannelInfo & aInfoChannel info.
CSensrvPluginProxy & aProxyCallback proxy.

PropertyChangedTransaction()

CSensrvTransaction *PropertyChangedTransaction()const [inline]

Gets the persistent ETransTypeMediatorPropertyChanged transaction. Called from SSY thread.

Since
S60 5.0

PropertyProvider()

MSsyPropertyProvider *PropertyProvider()[inline]

Gets property provider pointer. Called from SSY thread.

Since
S60 5.0

Proxy()

CSensrvPluginProxy &Proxy()[inline]

Gets parent proxy reference. Called from both threads.

Since
S60 5.0

ReadChannelGroup()

TSensrvResourceChannelInfo::TSensrvChannelGroup ReadChannelGroup()[private]

Reads channel group

Since
S60 5.0

RecalculateBufferingCount()

TInt RecalculateBufferingCount()

Recalculates buffering count, if there is more than one client.

Since
S60 5.0

SessionTerminated(CSensrvSession *)

voidSessionTerminated(CSensrvSession *aSession)

Cleans up session related data.

Since
S60 5.0

Parameters

CSensrvSession * aSessionThe session that was deleted

SetAvailability(TSensrvChannelId, TSensrvProperty &, TSensrvAvailability, const TSecurityInfo &)

TInt SetAvailability(TSensrvChannelIdaChannelId,
TSensrvProperty &aProperty,
TSensrvAvailabilityaValue,
const TSecurityInfo &aSecurityInfo
)[private]

Sets dependent channel availability

Since
S60 5.0

Parameters

TSensrvChannelId aChannelId
TSensrvProperty & aProperty
TSensrvAvailability aValue
const TSecurityInfo & aSecurityInfo

SetChannelAvailability(TSensrvChannelId, TSensrvChannelId, TSensrvProperty &)

TInt SetChannelAvailability(TSensrvChannelIdaChannelIdToEnable,
TSensrvChannelIdaChannelIdToDisable,
TSensrvProperty &aProperty
)[private]

Sets dependent channel availability

Since
S60 5.0

Parameters

TSensrvChannelId aChannelIdToEnable
TSensrvChannelId aChannelIdToDisable
TSensrvProperty & aProperty

SetChannelAvailability(TSensrvChannelId, TSensrvProperty &, TSensrvAvailability)

TInt SetChannelAvailability(TSensrvChannelIdaChannelId,
TSensrvProperty &aProperty,
TSensrvAvailabilityaValue
)[private]

Sets dependent channel availability

Since
S60 5.0

Parameters

TSensrvChannelId aChannelId
TSensrvProperty & aProperty
TSensrvAvailability aValue

SetChannelAvailable()

voidSetChannelAvailable()[private]

Handles channel availability property change to availabe

Since
S60 5.0

SetChannelUnavailable()

voidSetChannelUnavailable()[private]

Handles channel availability property change to unavailabe

Since
S60 5.0

State()

TSensrvChannelState State()const [inline]

Gets channel state. Called from both threads.

Since
S60 5.0

StoreChangedProperty(const TSensrvProperty &, const CSensrvSession *)

TBool StoreChangedProperty(const TSensrvProperty &aProperty,
const CSensrvSession *aIgnoreSession
)

Store a changed property provided by SSY. Called from SSY thread only.

Since
S60 5.0

Parameters

const TSensrvProperty & aPropertyProperty that has changed
const CSensrvSession * aIgnoreSessionDo not store change for this session. Can be NULL.

TakePropertySetControl(CSensrvChannelListener *)

voidTakePropertySetControl(CSensrvChannelListener *aListener)

Takes the property set control. Required priority checks must be done by client before using this method.

Since
S60 5.0

Parameters

CSensrvChannelListener * aListenerThe listener that takes control or NULL if control is freed.

TakenPropertySetControl()

CSensrvChannelListener *TakenPropertySetControl()const [inline]

Gets the listener that has taken the property set control.

Since
S60 5.0

UpdateSetPropertySuccessIndToChannelListeners(CSensrvChannel &, TInt, TInt)

voidUpdateSetPropertySuccessIndToChannelListeners(CSensrvChannel &aChannel,
TIntaHighestOfAffectedChannels,
TIntaMultiplesOnAffectedChannels
)[private, static]

Updated set property success indication to channel listeners

Since
S60 5.0

Parameters

CSensrvChannel & aChannelChannel to update
TInt aHighestOfAffectedChannelsHighest priority of affected channels
TInt aMultiplesOnAffectedChannelsMultiples of highest priority listeners

Member Enumerations Documentation

Enum TSensrvChannelState

Channel state.

Enumerators

EChannelStateClosed
EChannelStateOpen
EChannelStateListening

Member Data Documentation

CSensrvChannelBuffer * iChannelBuffer

CSensrvChannelBuffer *iChannelBuffer[private]

Channel buffer. Own.

TSensrvResourceChannelInfo iChannelInfo

TSensrvResourceChannelInfo iChannelInfo[private]

Channel info of this channel.

CSensrvTransactionQueue * iChannelQueue

CSensrvTransactionQueue *iChannelQueue[private]

Transaction queue for transactions targeting this channel. Own. iChannelQueue owns the queued transactions.

CSensrvConditionEvaluator * iConditionEvaluator

CSensrvConditionEvaluator *iConditionEvaluator[private]

Condition evaluator plugin. Own.

CSensrvChannelListener * iCurrentSetPropertyControl

CSensrvChannelListener *iCurrentSetPropertyControl[private]

The channel listener that has taken the property set control. Not own.

CSensrvTransaction * iDataAvailableTransaction

CSensrvTransaction *iDataAvailableTransaction[private]

Transaction for notifying new data from SSY to Server. It is stored and reused to both avoid repeatedly constructing and deleting it and to ensure it always exists, as the transaction is initiated by SSY. Own.

MSsyChannelDataProvider * iDataProvider

MSsyChannelDataProvider *iDataProvider[private]

Data provider residing in SSY thread heap. Can safely be accessed only from SSY thread. Not Own, owned by SSY.

CSensrvTransaction * iForceBufferFilledTransaction

CSensrvTransaction *iForceBufferFilledTransaction[private]

Transaction for notifying buffer filled must be forced. It is stored and reused to avoid repeatedly constructing and deleting it. Own.

CSensrvTransaction * iForceChannelCloseTransaction

CSensrvTransaction *iForceChannelCloseTransaction[private]

Transaction for notifying channel close must be forced. It is stored and reused to ensure it always exists, as the transaction is initiated by SSY. Own.

TBool iForcingBufferFilled

TBool iForcingBufferFilled[private]

Indicates outstanding explicit buffer fill request.

TInt iHighestListenerPriority

TInt iHighestListenerPriority[private]

Highest listener priority of the channel.

TInt iHighestListenerPriorityMultiples

TInt iHighestListenerPriorityMultiples[private]

Multiples of highest listener priority. If there are no listeners on this channel, value is zero. If there is single listener with the highest priority, value is one, etc.

TSensrvChannelId iId

TSensrvChannelId iId[private]

Channel identifier of this channel.

RPointerArray< CSensrvChannelListener > iListenerList

RPointerArray< CSensrvChannelListener >iListenerList[private]

Channel listener array for open clients Listed listeners are owned.

TInt iMaxBufferingCount

TInt iMaxBufferingCount[private]

Indicates maximum buffering count.

CSensrvTransaction * iPropertyChangedTransaction

CSensrvTransaction *iPropertyChangedTransaction[private]

Transaction for notifying property change from SSY to Server Own.

MSsyPropertyProvider * iPropertyProvider

MSsyPropertyProvider *iPropertyProvider[private]

Sensor property provider residing in SSY thread heap. Can safely be accessed only from SSY thread. Not Own, owned by SSY.

CSensrvPluginProxy & iProxy

CSensrvPluginProxy &iProxy[private]

Callback proxy

TSensrvChannelState iState

TSensrvChannelState iState[private]

Current channel state