SDK  23.9.2
For IoT System Software Development
Macros | Typedefs | Enumerations | Functions
CoAPResource.hpp File Reference

CoAP API wrapper of libcoap for CoX SDK. More...

#include <typedef.h>

Macros

#define COAP_DEFAULT_PORT   5683
 

Typedefs

typedef void * CoAPContext
 
typedef void * CoAPResource
 
typedef void * CoAPEndPoint
 
typedef void * CoAPAddress
 
typedef void * CoAPPdu
 
typedef void * CoAPToken
 
typedef void(* CoAPMethodHandler) (CoAPContext ctx, CoAPResource resource, const CoAPEndPoint localIf, CoAPAddress peer, CoAPPdu request, CoAPToken token, CoAPPdu response)
 

Enumerations

enum  coap_media_t {
  COAP_MEDIA_TEXT_PLAIN = 0, COAP_MEDIA_APPLICATION_LINK_FORMAT = 40, COAP_MEDIA_APPLICATION_XML = 41, COAP_MEDIA_APPLICATION_OCTET_STREAM = 42,
  COAP_MEDIA_APPLICATION_RDF_XML = 43, COAP_MEDIA_APPLICATION_EXI = 47, COAP_MEDIA_APPLICATION_JSON = 50, COAP_MEDIA_APPLICATION_CBOR = 60,
  COAP_MEDIA_ANY = 255
}
 

Functions

int32_t coapRequestGet (uint8_t ip6Interface, const char *uri, const char *token, uint8_t *responseCode, uint8_t *responseBuf, uint16_t responseLength, uint8_t waitTimeoutSec)
 
int32_t coapRequestPut (uint8_t ip6Interface, const char *uri, const char *token, coap_media_t payloadType, const uint8_t *payload, uint16_t payloadLength, uint8_t *responseCode, uint8_t *responseBuf, uint16_t responseLength, uint8_t waitTimeoutSec)
 
int32_t coapRequestPost (uint8_t ip6Interface, const char *uri, const char *token, coap_media_t payloadType, const uint8_t *payload, uint16_t payloadLength, uint8_t *responseCode, uint8_t *responseBuf, uint16_t responseLength, uint8_t waitTimeoutSec)
 
int32_t coapRequestDelete (uint8_t ip6Interface, const char *uri, const char *token, uint8_t *responseCode, uint8_t *responseBuf, uint16_t responseLength, uint8_t waitTimeoutSec)
 
CoAPContext coapListen (uint16_t port)
 
CoAPResource coapResourceInit (CoAPContext ctx, const char *uri, CoAPMethodHandler getHandler, CoAPMethodHandler putHandler, CoAPMethodHandler postHandler, CoAPMethodHandler deleteHandler)
 
void coapAddAttribute (CoAPResource resource, const char *name, const char *value)
 
void coapSetResponseCode (CoAPPdu response, uint16_t code)
 
bool coapPeerIsSubscriber (CoAPResource resource, const CoAPAddress peer, const CoAPToken token)
 
void coapAddOptionObserve (CoAPPdu response, CoAPContext ctx)
 
void coapAddOptionContentFormat (CoAPPdu response, coap_media_t media)
 
void coapAddOptionMaxAge (CoAPPdu response, uint32_t age)
 
void coapAddData (CoAPPdu response, uint16_t len, const uint8_t *data)
 

Detailed Description

CoAP API wrapper of libcoap for CoX SDK.

Author
Jongsoo Jeong (CoXlab)
Date
2015. 9. 8.