|
Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
|
Infuse COAP API. More...
Typedefs | |
| typedef int(* | infuse_coap_data_cb) (uint32_t offset, const uint8_t *data, uint16_t data_len, void *user_context) |
| COAP data download callback. | |
Functions | |
| int | infuse_coap_download (int socket, const char *resource, size_t file_size, infuse_coap_data_cb data_cb, void *user_context, uint8_t *working_mem, size_t working_size, uint16_t block_size, int timeout_ms) |
| Download a file over COAP from an existing socket. | |
Infuse COAP API.
| typedef int(* infuse_coap_data_cb) (uint32_t offset, const uint8_t *data, uint16_t data_len, void *user_context) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/net/coap.h>
COAP data download callback.
| offset | Offset of data payload from start of data |
| data | Data payload |
| data_len | Length of payload |
| user_context | Arbitrary pointer from user |
| 0 | Continue downloading more data |
| -errno | Terminate download process |
| int infuse_coap_download | ( | int | socket, |
| const char * | resource, | ||
| size_t | file_size, | ||
| infuse_coap_data_cb | data_cb, | ||
| void * | user_context, | ||
| uint8_t * | working_mem, | ||
| size_t | working_size, | ||
| uint16_t | block_size, | ||
| int | timeout_ms ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/net/coap.h>
Download a file over COAP from an existing socket.
| socket | Socket already connected to remote server |
| resource | Resource path URI, for example "path/to/resource" |
| file_size | Size of the file that is being downloaded (0 if unknown) |
| data_cb | Callback run on each data chunk received |
| user_context | Arbitrary user context for data_cb |
| working_mem | Memory buffer for sending/receiving packets with |
| working_size | Size of working_mem in bytes |
| block_size | COAP block size to use (in bytes, 0 == auto) |
| timeout_ms | Timeout waiting for each response from server |
| >=0 | bytes downloaded on success |
| <0 | error code on failure |