class Binding

Defined at line 126 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

Captures the intended target of a Weave communication and associated configuration

information.

A Binding object identifies the intended target of a Weave communication (also known as the

"peer"), along with a set of configuration parameters describing how communication with the

peer should take place. Bindings are independent of the application protocol being spoken

between the two parties. As such, they capture the "who" and the "how" of a communication,

but not the "what."

## Configuration

Applications must configure a Binding with parameters specific to the type of communication

channel desired. Bindings provide support for a range of network transports, including

TCP, UDP, UDP with Weave Reliable Messaging, and Weave over BLE (WoBLE). Applications can

also request the use of specific security mechanisms to protect messages sent between the

parties. These include CASE and PASE sessions, and application group keys. The interface for

configuring a Binding uses a declarative API style that allows applications to state their

requirements for the communication in simple terms.

See the documentation for Binding::Configuration for further details.

## Preparation

Prior to communication taking place, a Binding must be "prepared." The act of preparing a

Binding involves establishing the necessary state for communication to take place. This can

include things such as: resolving the network address of the peer, establishing a network

connection, and negotiating security keys. Once configured by the application, the Binding

takes care of all the steps necessary to prepare for communication, calling back to the

application when the process is complete. In this way, Bindings hide the mechanics of

communication, allowing applications to concentrate on the high-level interactions.

## Communication

Once a Binding has been prepared it becomes ready for use. In this state, applications (or

more commonly, protocol layer code working on behalf of an application) request the Binding

to allocate a Weave exchange context. The resultant exchange context comes pre-configured

for communication, allowing the application to immediately initiate a Weave exchange with

the peer. The application can continue to request exchange contexts from the Binding until

such time as the Binding is closed, or some event, e.g., a network failure, terminates the

underlying communication channel.

## Binding State Changes

Over the course of its use, a Binding will deliver API events to the application informing it

of changes in the Binding's state. For example, when preparation succeeds, the application

will receive an event informing it that the Binding is ready for use. Similarly, if the

underlying communication channel fails, an event is delivered to the application informing

it that the Binding is no longer in the ready state.

API events are delivered to the application via an event callback function supplied when

the Binding is allocated.

## Binding Lifetime

Binding are reference counted to allow shared use across multiple software components.

When a Binding is allocated, a single reference to the binding is created. The application

is responsible for releasing this reference at some point in the future such that the

Binding is free for subsequent reuse.

When an application is done with a Binding it may call Close() on the binding. This

releases the application's reference to the Binding and blocks all further delivery of API

events. When the last reference to a Binding is released, it is automatically closed.

Public Members

void * AppState

Public Methods

void AddRef ()
void Release ()
void Close ()
void Reset ()
Configuration BeginConfiguration ()

Defined at line 607 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

WEAVE_ERROR RequestPrepare ()
State GetState ()

Inline Functions

Documentation for these functions can be found in the .cpp file.

Defined at line 474 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

bool IsPreparing ()

Defined at line 479 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

bool IsReady ()

Defined at line 484 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

bool CanBePrepared ()

Defined at line 489 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

uint16_t GetLogId ()
uint64_t GetPeerNodeId ()

Defined at line 494 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

void GetPeerIPAddress (nl::Inet::IPAddress & address, uint16_t & port, InterfaceId & interfaceId)

Defined at line 499 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

uint32_t GetKeyId ()

Defined at line 506 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

uint8_t GetEncryptionType ()

Defined at line 511 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

uint32_t GetDefaultResponseTimeout ()

Defined at line 516 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

void SetDefaultResponseTimeout (uint32_t msec)

Defined at line 521 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

const WRMPConfig & GetDefaultWRMPConfig ()

Defined at line 528 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

void SetDefaultWRMPConfig (const WRMPConfig & wrmpConfig)

Defined at line 533 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

EventCallback GetEventCallback ()

Defined at line 540 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

void SetEventCallback (EventCallback aEventCallback)

Defined at line 545 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

WeaveConnection * GetConnection ()

Defined at line 562 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

WeaveExchangeManager * GetExchangeManager ()

Defined at line 582 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

bool IsConnectionTransport ()

Defined at line 587 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

bool IsUDPTransport ()

Defined at line 592 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

bool IsWRMTransport ()

Defined at line 597 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

bool IsUnreliableUDPTransport ()

Defined at line 602 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

void GetPeerDescription (char * buf, uint32_t bufSize)
void GetProtocolLayerCallback (EventCallback & callback, void *& state)

Defined at line 550 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

void SetProtocolLayerCallback (EventCallback callback, void * state)

Defined at line 556 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

WEAVE_ERROR NewExchangeContext (ExchangeContext *& appExchangeContext)
WEAVE_ERROR AdjustResponseTimeout (ExchangeContext * apExchangeContext)
bool IsAuthenticMessageFromPeer (const WeaveMessageInfo * msgInfo)
uint32_t GetMaxWeavePayloadSize (const System::PacketBuffer * msgBuf)
void DefaultEventHandler (void * apAppState, EventType aEvent, const InEventParam & aInParam, OutEventParam & aOutParam)
WEAVE_ERROR AllocateRightSizedBuffer (PacketBuffer *& buf, const uint32_t desiredSize, const uint32_t minSize, uint32_t & outMaxPayloadSize)

Enumerations

enum State
Name Value
kState_NotAllocated 0
kState_NotConfigured 1
kState_Configuring 2
kState_Preparing 3
kState_PreparingAddress 4
kState_PreparingAddress_ResolveHostName 5
kState_PreparingTransport 6
kState_PreparingTransport_TCPConnect 7
kState_PreparingSecurity 8
kState_PreparingSecurity_EstablishSession 9
kState_PreparingSecurity_WaitSecurityMgr 10
kState_Ready 11
kState_Resetting 12
kState_Closed 13
kState_Failed 14
kState_MaxState 15

Defined at line 134 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

enum EventType
Name Value
kEvent_ConnectionEstablished 1
kEvent_BindingReady 2
kEvent_PrepareFailed 3
kEvent_BindingFailed 4
kEvent_PrepareRequested 5
kEvent_PASEParametersRequested 6
kEvent_TAKEParametersRequested 7
kEvent_DefaultCheck 100

Defined at line 155 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

enum 
Name Value
kGetPeerDescription_MaxLength nl::Weave::kWeavePeerDescription_MaxLength

Defined at line 207 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveBinding.h

Records

Friends

class WeaveExchangeManager