nl::Weave::Profiles::ServiceDirectory::WeaveServiceManager::ConnectRequest

#include <src/lib/profiles/service-directory/ServiceDirectory.h>

This class represents a single transaction managed by the service manager.

Summary

Public attributes

mAppState
void *
mAuthMode
WeaveAuthMode
mConnIntf
InterfaceId
the interface over which the connection is to be set up.
mConnectTimeoutMsecs
uint32_t
the timeout for the Connect call to succeed or return an error.
mConnection
A connection to stash here while it's awaiting completion.
mConnectionCompleteHandler
A pointer to a function which would be called when a connection to destination service endpoint has been completed.
mServiceEp
uint64_t
mStatusHandler
A pointer to a function which would be called when a status report is received.

Public functions

finalize(void)
void
This method cleans up internal state, including connection closure.
free(void)
void
This method frees a connection request object, returning it to the pool.
init(WeaveServiceManager *aManager, const uint64_t & aServiceEp, WeaveAuthMode aAuthMode, void *aAppState, StatusHandler aStatusHandler, WeaveConnection::ConnectionCompleteFunct aCompleteHandler, const uint32_t aConnectTimeoutMsecs, const InterfaceId aConnIntf)
This method initializes a ConnectRequest instance with the arguments passed in.
isAllocatedTo(const uint64_t & aServiceEp, void *aAppState)
bool
This function tests if this connect request is currently in use to connect to a particular service endpoint for a particualr application entity.
isFree(void)
bool
This function tests if the connect request is not currently allocated.
onConnectionComplete(WEAVE_ERROR aError)
void
This method is a trampoline to application layer for the connection complete event.

Public attributes

mAppState

void * mAppState

mAuthMode

WeaveAuthMode mAuthMode

mConnIntf

InterfaceId mConnIntf

the interface over which the connection is to be set up.

mConnectTimeoutMsecs

uint32_t mConnectTimeoutMsecs

the timeout for the Connect call to succeed or return an error.

mConnection

WeaveConnection * mConnection

A connection to stash here while it's awaiting completion.

mConnectionCompleteHandler

WeaveConnection::ConnectionCompleteFunct mConnectionCompleteHandler

A pointer to a function which would be called when a connection to destination service endpoint has been completed.

mServiceEp

uint64_t mServiceEp

mStatusHandler

StatusHandler mStatusHandler

A pointer to a function which would be called when a status report is received.

Public functions

finalize

void finalize(
  void
)

This method cleans up internal state, including connection closure.

free

void free(
  void
)

This method frees a connection request object, returning it to the pool.

init

WEAVE_ERROR init(
  WeaveServiceManager *aManager,
  const uint64_t & aServiceEp,
  WeaveAuthMode aAuthMode,
  void *aAppState,
  StatusHandler aStatusHandler,
  WeaveConnection::ConnectionCompleteFunct aCompleteHandler,
  const uint32_t aConnectTimeoutMsecs,
  const InterfaceId aConnIntf
)

This method initializes a ConnectRequest instance with the arguments passed in.

Details
Parameters
[in] aManager
A pointer to the containing service manager.
[in] aServiceEp
An ID to the intended service endpoint for this connect request.
[in] aAuthMode
A descriptor for the authentication method which should be used for this connection.
[in] aAppState
An arbitrary pointer which would be passed back in callbacks.
[in] aStatusHandler
A pointer to callback function which handles a status report in response to service endpoint query.
[in] aCompleteHandler
A pointer to callback function which handles the connection complete event.
[in] aConnectTimeoutMsecs
The timeout for the Connect call to succeed or return an error.
[in] aConnectIntf
The interface over which the connection is to be established.
Returns
WEAVE_NO_ERROR on success; otherwise, a respective error code.

isAllocatedTo

bool isAllocatedTo(
  const uint64_t & aServiceEp,
  void *aAppState
)

This function tests if this connect request is currently in use to connect to a particular service endpoint for a particualr application entity.

Details
Parameters
[in] aServiceEp
A service endpoint ID to be compared with what this connect request holds.
[in] aAppState
A pointer to application state, which is used to compare with what this connect request holds.
Returns
true if the test passes, false otherwise.

isFree

bool isFree(
  void
)

This function tests if the connect request is not currently allocated.

Details
Returns
true if the test passes, false otherwise.

onConnectionComplete

void onConnectionComplete(
  WEAVE_ERROR aError
)

This method is a trampoline to application layer for the connection complete event.

It calls the connection complete handler assigned at lookupAndConnect() .