interface Endpoint
This class is the Client/Server API of that will be exposed to users of this library.
Example:
fun sendMegadump(megadump: ByteArray): Single<IncomingResponse> {
val request = OutgoingRequestBuilder("/sync/response", Method.PUT).body(megadump).build()
return endpoint.responseFor(request)
}
abstract fun addResourceHandler(path: String, handler: ResourceHandler, configuration: CoapEndpointHandlerConfiguration = CoapEndpointHandlerConfiguration()): Completable
Registers a coap handler for a certain path. |
|
abstract fun removeResourceHandler(path: String): Completable
Unregisters the coap handler for a certain path |
|
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 |
|
abstract fun responseFor(request: OutgoingRequest): Single<IncomingResponse>
Call this to send a request and get a response (i.e. be a client). open fun <T> responseFor(request: OutgoingRequest, parser: ByteArrayParser<T>): Single<T>
Convenience method for parsing a Response into a T |
class CoapEndpoint : NativeReference, StackService, Endpoint, DataSinkDataSource
Coap Client/Server API. |