GoldenGateBindings / com.fitbit.goldengate.bindings.stack / Stack

Stack

class Stack : NativeReference, DataSinkDataSource, Closeable

A Kotlin representation of a Golden Gate stack. The data sink and data source exposed through getAsDataSinkPointer and getAsDataSourcePointer are the data sink/source on the "top" of the stack.

Appropriate things to attach to those are StackService like CoapEndpoint and Blaster

Parameters

nodeKey - node identifier this stack is attached to

transportSinkPtr - Bottom of stack sink (data will be transmitted on this sink reference)

transportSourcePtr - Bottom of stack (data will be received from this source reference)

stackConfig - configuration in which this stack should be created (Default is DtlsSocketNetifGattlink)

isNode - if stack should be configured as Node or Hub (default is false)

Constructors

<init>

Stack(nodeKey: NodeKey<*>, transportSinkPtr: Long, transportSourcePtr: Long, stackConfig: StackConfig = DtlsSocketNetifGattlink(), isNode: Boolean = false)

A Kotlin representation of a Golden Gate stack. The data sink and data source exposed through getAsDataSinkPointer and getAsDataSourcePointer are the data sink/source on the "top" of the stack.

Properties

dtlsEventObservable

val dtlsEventObservable: Observable<DtlsProtocolStatus>

Observable on which DTLS event changes are available. This observable is only applicable when stack is configured with DTLS

stackEventObservable

val stackEventObservable: Observable<StackEvent>

thisPointer

val thisPointer: Long

Pointer to native jni reference for this object

Functions

close

fun close(): Unit

getAsDataSinkPointer

fun getAsDataSinkPointer(): Long

getAsDataSourcePointer

fun getAsDataSourcePointer(): Long

onDtlsStatusChange

fun onDtlsStatusChange(tlsState: Int, tlsLastError: Int, pskIdentity: ByteArray): Unit

onStackEvent

fun onStackEvent(eventId: Int, data: Int): Unit

start

fun start(): Unit

Start the stack must be called as soon as Node is connected

updateMtu

fun updateMtu(mtu: Int): Boolean

Update MTU for this stack