Manual NanoService C Client 1.11-RC2 import
Dependents: Trenton_Doormat_FRDM-KL25Z_ETH
sn_coap_protocol.h@1:14a9b0f4b9d6, 2014-02-18 (annotated)
- Committer:
- zdshelby
- Date:
- Tue Feb 18 01:10:07 2014 +0000
- Revision:
- 1:14a9b0f4b9d6
- Parent:
- 0:aafd54b05111
- Added libnsdl import
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
zdshelby | 0:aafd54b05111 | 1 | /** |
zdshelby | 0:aafd54b05111 | 2 | * \file sn_coap_protocol.h |
zdshelby | 0:aafd54b05111 | 3 | * |
zdshelby | 0:aafd54b05111 | 4 | * \brief CoAP C-library User protocol interface header file |
zdshelby | 0:aafd54b05111 | 5 | * |
zdshelby | 0:aafd54b05111 | 6 | * Created on: Jun 30, 2011 |
zdshelby | 0:aafd54b05111 | 7 | * Author: tero |
zdshelby | 0:aafd54b05111 | 8 | * |
zdshelby | 0:aafd54b05111 | 9 | */ |
zdshelby | 0:aafd54b05111 | 10 | |
zdshelby | 0:aafd54b05111 | 11 | #ifdef __cplusplus |
zdshelby | 0:aafd54b05111 | 12 | extern "C" { |
zdshelby | 0:aafd54b05111 | 13 | #endif |
zdshelby | 0:aafd54b05111 | 14 | |
zdshelby | 0:aafd54b05111 | 15 | #ifndef SN_COAP_PROTOCOL_H_ |
zdshelby | 0:aafd54b05111 | 16 | #define SN_COAP_PROTOCOL_H_ |
zdshelby | 0:aafd54b05111 | 17 | |
zdshelby | 0:aafd54b05111 | 18 | |
zdshelby | 0:aafd54b05111 | 19 | /* * * * * * * * * * * * * * * * * * * * * * */ |
zdshelby | 0:aafd54b05111 | 20 | /* * * * EXTERNAL FUNCTION PROTOTYPES * * * */ |
zdshelby | 0:aafd54b05111 | 21 | /* * * * * * * * * * * * * * * * * * * * * * */ |
zdshelby | 0:aafd54b05111 | 22 | |
zdshelby | 0:aafd54b05111 | 23 | /** |
zdshelby | 0:aafd54b05111 | 24 | * \brief This function sets the memory allocation and deallocation functions and used TX callback function pointer the library will use, and must be called first. |
zdshelby | 0:aafd54b05111 | 25 | */ |
zdshelby | 0:aafd54b05111 | 26 | extern int8_t sn_coap_protocol_init(void* (*used_malloc_func_ptr)(uint16_t), void (*used_free_func_ptr)(void*), |
zdshelby | 0:aafd54b05111 | 27 | uint8_t (*used_tx_callback_ptr)(sn_nsdl_capab_e , uint8_t *, uint16_t, sn_nsdl_addr_s *)); |
zdshelby | 0:aafd54b05111 | 28 | |
zdshelby | 0:aafd54b05111 | 29 | /** |
zdshelby | 0:aafd54b05111 | 30 | * \brief Frees all allocated memory in libCoap protocol part. |
zdshelby | 0:aafd54b05111 | 31 | */ |
zdshelby | 0:aafd54b05111 | 32 | extern int8_t sn_coap_protocol_destroy(void); |
zdshelby | 0:aafd54b05111 | 33 | |
zdshelby | 0:aafd54b05111 | 34 | /** |
zdshelby | 0:aafd54b05111 | 35 | * \brief Use to build an outgoing message buffer from a CoAP header structure. |
zdshelby | 0:aafd54b05111 | 36 | */ |
zdshelby | 0:aafd54b05111 | 37 | extern int16_t sn_coap_protocol_build(sn_nsdl_addr_s *dst_addr_ptr, uint8_t *dst_packet_data_ptr, sn_coap_hdr_s *src_coap_msg_ptr); |
zdshelby | 0:aafd54b05111 | 38 | |
zdshelby | 0:aafd54b05111 | 39 | /** |
zdshelby | 0:aafd54b05111 | 40 | * \brief Use to parse an incoming message buffer to a CoAP header structure. |
zdshelby | 0:aafd54b05111 | 41 | */ |
zdshelby | 0:aafd54b05111 | 42 | extern sn_coap_hdr_s *sn_coap_protocol_parse(sn_nsdl_addr_s *src_addr_ptr, uint16_t packet_data_len, uint8_t *packet_data_ptr); |
zdshelby | 0:aafd54b05111 | 43 | |
zdshelby | 0:aafd54b05111 | 44 | /** |
zdshelby | 0:aafd54b05111 | 45 | * \brief Called periodically to allow the protocol to update retransmission timers and destroy unneeded data. |
zdshelby | 0:aafd54b05111 | 46 | */ |
zdshelby | 0:aafd54b05111 | 47 | extern int8_t sn_coap_protocol_exec(uint32_t current_time); |
zdshelby | 0:aafd54b05111 | 48 | |
zdshelby | 0:aafd54b05111 | 49 | /** |
zdshelby | 0:aafd54b05111 | 50 | * \brief If block transfer is enabled, this function changes the block size. |
zdshelby | 0:aafd54b05111 | 51 | */ |
zdshelby | 0:aafd54b05111 | 52 | extern int8_t sn_coap_protocol_set_block_size(uint16_t block_size); |
zdshelby | 0:aafd54b05111 | 53 | |
zdshelby | 0:aafd54b05111 | 54 | /** |
zdshelby | 0:aafd54b05111 | 55 | * \brief If dublicate message detection is enabled, this function changes buffer size. |
zdshelby | 0:aafd54b05111 | 56 | */ |
zdshelby | 0:aafd54b05111 | 57 | extern int8_t sn_coap_protocol_set_duplicate_buffer_size(uint8_t message_count); |
zdshelby | 0:aafd54b05111 | 58 | |
zdshelby | 0:aafd54b05111 | 59 | /** |
zdshelby | 0:aafd54b05111 | 60 | * \brief If re-transmissions are enabled, this function changes resending count and interval. |
zdshelby | 0:aafd54b05111 | 61 | */ |
zdshelby | 0:aafd54b05111 | 62 | extern int8_t sn_coap_protocol_set_retransmission_parameters(uint8_t resending_count, uint8_t resending_interval); |
zdshelby | 0:aafd54b05111 | 63 | |
zdshelby | 0:aafd54b05111 | 64 | /** |
zdshelby | 0:aafd54b05111 | 65 | * \brief If re-transmissions are enabled, this function changes resending buffer size. |
zdshelby | 0:aafd54b05111 | 66 | */ |
zdshelby | 0:aafd54b05111 | 67 | extern int8_t sn_coap_protocol_set_retransmission_buffer(uint8_t buffer_size_messages, uint16_t buffer_size_bytes); |
zdshelby | 0:aafd54b05111 | 68 | |
zdshelby | 0:aafd54b05111 | 69 | |
zdshelby | 0:aafd54b05111 | 70 | /* NSP manual registration functions */ |
zdshelby | 0:aafd54b05111 | 71 | |
zdshelby | 0:aafd54b05111 | 72 | |
zdshelby | 0:aafd54b05111 | 73 | /** |
zdshelby | 0:aafd54b05111 | 74 | * \brief Create an NSP registration message. |
zdshelby | 0:aafd54b05111 | 75 | */ |
zdshelby | 0:aafd54b05111 | 76 | extern int8_t sn_coap_register(sn_coap_hdr_s *coap_hdr_ptr, registration_info_t *endpoint_info_ptr); |
zdshelby | 0:aafd54b05111 | 77 | |
zdshelby | 0:aafd54b05111 | 78 | /** |
zdshelby | 0:aafd54b05111 | 79 | * \brief Create an NSP update message. |
zdshelby | 0:aafd54b05111 | 80 | */ |
zdshelby | 0:aafd54b05111 | 81 | extern int8_t sn_coap_register_update(sn_coap_hdr_s *coap_hdr_ptr, uint8_t *location, uint8_t length); |
zdshelby | 0:aafd54b05111 | 82 | |
zdshelby | 0:aafd54b05111 | 83 | /** |
zdshelby | 0:aafd54b05111 | 84 | * \brief Create an NSP de-registration message. |
zdshelby | 0:aafd54b05111 | 85 | */ |
zdshelby | 0:aafd54b05111 | 86 | extern int8_t sn_coap_deregister(sn_coap_hdr_s *coap_hdr_ptr, uint8_t *location, uint8_t length); |
zdshelby | 0:aafd54b05111 | 87 | |
zdshelby | 0:aafd54b05111 | 88 | #endif /* SN_COAP_PROTOCOL_H_ */ |
zdshelby | 0:aafd54b05111 | 89 | |
zdshelby | 0:aafd54b05111 | 90 | #ifdef __cplusplus |
zdshelby | 0:aafd54b05111 | 91 | } |
zdshelby | 0:aafd54b05111 | 92 | #endif |
zdshelby | 0:aafd54b05111 | 93 |