GoldenGateBindings / com.fitbit.goldengate.bindings.coap / CoapEndpoint

CoapEndpoint

class CoapEndpoint : NativeReference, StackService, Endpoint, DataSinkDataSource

Coap Client/Server API.

Use CoapEndpointProvider for creating an instance

Types

AddResourceHandlerResult

class AddResourceHandlerResult

Result for CoapEndpoint.addResourceHandler native call

ResponseForResult

class ResponseForResult

Result for CoapEndpoint.responseFor and CoapEndpoint.responseForBlockwise native call

Constructors

<init>

CoapEndpoint()

Coap Client/Server API.

Properties

requestFilter

val requestFilter: CoapGroupRequestFilter

thisPointer

val thisPointer: Long

Pointer to native jni reference for this object

Functions

addResourceHandler

fun addResourceHandler(path: String, handler: ResourceHandler, configuration: CoapEndpointHandlerConfiguration): Completable

Registers a coap handler for a certain path.

attach

fun attach(dataSinkDataSource: DataSinkDataSource): Unit

Attach the source and sink

close

fun close(): Unit

detach

fun detach(): Unit

getAsDataSinkPointer

fun getAsDataSinkPointer(): Long

getAsDataSourcePointer

fun getAsDataSourcePointer(): Long

removeResourceHandler

fun removeResourceHandler(path: String): Completable

Unregisters the coap handler for a certain path

responseFor

fun responseFor(request: OutgoingRequest): Single<IncomingResponse>

Call this to send a request and get a response (i.e. be a client).

setFilterGroup

fun setFilterGroup(group: CoapGroupRequestFilterMode, key: NodeKey<String>): Unit

Update the current filter group used by the CoAP request filter.

Inherited Functions

resource

open fun <T> resource(path: String, parser: ByteArrayParser<T>): Single<T>

Convenience method for making a GET request to path and parsing it into a T

responseFor

open fun <T> responseFor(request: OutgoingRequest, parser: ByteArrayParser<T>): Single<T>

Convenience method for parsing a Response into a T