Loading...
Searching...
No Matches
link_format.h File Reference

NanoCoAP Link Format helper functions. More...

Detailed Description

NanoCoAP Link Format helper functions.

NanoCoAP Link Format (RFC 6690) helper functions

Author
Benjamin Valentin benja.nosp@m.min..nosp@m.valen.nosp@m.tin@.nosp@m.ml-pa.nosp@m..com

Definition in file link_format.h.

+ Include dependency graph for link_format.h:

Go to the source code of this file.

typedef int(* coap_link_format_handler_t) (char *entry, void *ctx)
 Callback function called for each resource on the directory.
 
int nanocoap_link_format_get (nanocoap_sock_t *sock, const char *path, coap_link_format_handler_t cb, void *arg)
 Downloads the resource behind path via blockwise GET.
 
int nanocoap_link_format_get_url (const char *url, coap_link_format_handler_t cb, void *arg)
 Downloads the resource behind url via blockwise GET.
 

Typedef Documentation

◆ coap_link_format_handler_t

typedef int(* coap_link_format_handler_t) (char *entry, void *ctx)

Callback function called for each resource on the directory.

Parameters
[in]entryResource entry from the server
[in]ctxOptional function context
Returns
0 on success
<0 on error

Definition at line 39 of file link_format.h.

Function Documentation

◆ nanocoap_link_format_get()

int nanocoap_link_format_get ( nanocoap_sock_t sock,
const char *  path,
coap_link_format_handler_t  cb,
void *  arg 
)

Downloads the resource behind path via blockwise GET.

Parameters
[in]sockConnection to the server
[in]pathpath of the resource
[in]cbCallback to execute for each resource entry
[in]argOptional callback argument
Returns
0 on success
<0 on error

◆ nanocoap_link_format_get_url()

int nanocoap_link_format_get_url ( const char *  url,
coap_link_format_handler_t  cb,
void *  arg 
)

Downloads the resource behind url via blockwise GET.

Parameters
[in]urlURL to the resource
[in]cbCallback to execute for each resource entry
[in]argOptional callback argument
Returns
0 on success
<0 on error