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

VFS NanoCoAP helper functions. More...

Detailed Description

VFS NanoCoAP helper functions.

VFS NanoCoAP 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 nanocoap_vfs.h.

+ Include dependency graph for nanocoap_vfs.h:

Go to the source code of this file.

int nanocoap_vfs_get_url (const char *url, const char *dst)
 Downloads the resource behind url via blockwise GET and stores it in the file dst.
 
int nanocoap_vfs_get (nanocoap_sock_t *sock, const char *path, const char *dst)
 Downloads the resource behind path via blockwise GET and stores it in the file dst.
 
int nanocoap_vfs_put_url (const char *url, const char *src, void *work_buf, size_t work_buf_len)
 Uploads the file to url via blockwise PUT.
 
int nanocoap_vfs_put (nanocoap_sock_t *sock, const char *path, const char *src, void *work_buf, size_t work_buf_len)
 Uploads the file to path via blockwise PUT.
 

Function Documentation

◆ nanocoap_vfs_get()

int nanocoap_vfs_get ( nanocoap_sock_t sock,
const char *  path,
const char *  dst 
)

Downloads the resource behind path via blockwise GET and stores it in the file dst.

Parameters
[in]sockConnection to the server
[in]pathRemote query path to the resource
[in]dstLocal path to the destination file
Returns
0 on success
<0 on error

◆ nanocoap_vfs_get_url()

int nanocoap_vfs_get_url ( const char *  url,
const char *  dst 
)

Downloads the resource behind url via blockwise GET and stores it in the file dst.

Parameters
[in]urlURL to the resource
[in]dstPath to the destination file
Returns
0 on success
<0 on error

◆ nanocoap_vfs_put()

int nanocoap_vfs_put ( nanocoap_sock_t sock,
const char *  path,
const char *  src,
void *  work_buf,
size_t  work_buf_len 
)

Uploads the file to path via blockwise PUT.

Parameters
[in]sockConnection to the server
[in]pathRemote query path to the resource
[in]srcPath to the source file
[in]work_bufBuffer to read file blocks into
[in]work_buf_lenSize of the buffer. Should be 1 byte more than the desired CoAP blocksize.
Returns
0 on success
<0 on error

◆ nanocoap_vfs_put_url()

int nanocoap_vfs_put_url ( const char *  url,
const char *  src,
void *  work_buf,
size_t  work_buf_len 
)

Uploads the file to url via blockwise PUT.

Parameters
[in]urlURL to the resource
[in]srcPath to the source file
[in]work_bufBuffer to read file blocks into
[in]work_buf_lenSize of the buffer. Should be 1 byte more than the desired CoAP blocksize.
Returns
0 on success
<0 on error