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
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)
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. |
val dtlsEventObservable: Observable<DtlsProtocolStatus>
Observable on which DTLS event changes are available. This observable is only applicable when stack is configured with DTLS |
|
val stackEventObservable: Observable<StackEvent> |
|
val thisPointer: Long
Pointer to native jni reference for this object |
fun close(): Unit |
|
fun getAsDataSinkPointer(): Long |
|
fun getAsDataSourcePointer(): Long |
|
fun onDtlsStatusChange(tlsState: Int, tlsLastError: Int, pskIdentity: ByteArray): Unit |
|
fun onStackEvent(eventId: Int, data: Int): Unit |
|
fun start(): Unit
Start the stack must be called as soon as Node is connected |
|
fun updateMtu(mtu: Int): Boolean
Update MTU for this stack |