123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- #ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_COAP_H
- #define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_COAP_H
- #include "lightduer_types.h"
- #include "lightduer_lib.h"
- #include "lightduer_network_defs.h"
- #include "lightduer_coap_defs.h"
- #include "lightduer_coap_ep.h"
- #define DUER_COAP_MESSAGE_ID_INVALID (0)
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef void* duer_coap_handler;
- typedef duer_status_t (*duer_coap_result_f)(duer_context ctx,
- duer_coap_handler hdlr,
- const duer_msg_t* msg,
- const duer_addr_t* addr);
- DUER_INT duer_coap_handler duer_coap_acquire(duer_coap_result_f f_result,
- duer_context context,
- duer_transevt_func ctx_context,
- const void *key_info);
- DUER_INT duer_status_t duer_coap_set_tx_callback(duer_coap_handler hdlr, duer_transmit_f tx);
- DUER_INT duer_status_t duer_coap_connect(duer_coap_handler hdlr,
- const duer_addr_t* addr,
- const void* data,
- duer_size_t size);
- DUER_INT duer_status_t duer_coap_disconnect(duer_coap_handler hdlr);
- DUER_INT duer_status_t duer_coap_resource_add(duer_coap_handler hdlr,
- const duer_res_t* res);
- DUER_INT duer_status_t duer_coap_resource_remove(duer_coap_handler coap,
- const char* path);
- DUER_INT duer_status_t duer_coap_register(duer_coap_handler coap,
- const duer_coap_ep_t* ep);
- DUER_INT duer_status_t duer_coap_unregister(duer_coap_handler coap);
- DUER_INT duer_status_t duer_coap_update_registration(duer_coap_handler coap,
- duer_u32_t lifetime);
- DUER_INT duer_status_t duer_coap_send(duer_coap_handler coap, const duer_msg_t* msg);
- DUER_INT duer_status_t duer_coap_send_data(duer_coap_handler hdlr, const void *data, duer_size_t size);
- DUER_INT duer_status_t duer_coap_data_available(duer_coap_handler coap);
- DUER_INT duer_status_t duer_coap_exec(duer_coap_handler hdlr, duer_u32_t timestamp);
- DUER_INT duer_status_t duer_coap_release(duer_coap_handler coap);
- DUER_INT duer_status_t duer_coap_set_read_timeout(duer_coap_handler coap, duer_u32_t timeout);
- #ifdef __cplusplus
- }
- #endif
- #endif
|