SDK3.5
This document shows Ameba SDK 3.5 APIs
Functions
sn_coap_protocol.h File Reference

CoAP C-library User protocol interface header file. More...

Functions

struct coap_s * sn_coap_protocol_init (void *(*used_malloc_func_ptr)(uint16_t), void(*used_free_func_ptr)(void *), uint8_t(*used_tx_callback_ptr)(uint8_t *, uint16_t, sn_nsdl_addr_s *, void *), int8_t(*used_rx_callback_ptr)(sn_coap_hdr_s *, sn_nsdl_addr_s *, void *))
 Initializes CoAP Protocol part. When using libNsdl, sn_nsdl_init() calls this function. More...
 
int8_t sn_coap_protocol_destroy (struct coap_s *handle)
 Frees all memory from CoAP protocol part. More...
 
int16_t sn_coap_protocol_build (struct coap_s *handle, sn_nsdl_addr_s *dst_addr_ptr, uint8_t *dst_packet_data_ptr, sn_coap_hdr_s *src_coap_msg_ptr, void *param)
 Builds Packet data from given CoAP header structure to be sent. More...
 
sn_coap_hdr_ssn_coap_protocol_parse (struct coap_s *handle, sn_nsdl_addr_s *src_addr_ptr, uint16_t packet_data_len, uint8_t *packet_data_ptr, void *param)
 Parses received CoAP message from given Packet data. More...
 
int8_t sn_coap_protocol_exec (struct coap_s *handle, uint32_t current_time)
 Sends CoAP messages from re-sending queue, if there is any. Cleans also old messages from the duplication list and from block receiving list. More...
 
int8_t sn_coap_protocol_set_block_size (struct coap_s *handle, uint16_t block_size)
 If block transfer is enabled, this function changes the block size. More...
 
int8_t sn_coap_protocol_set_duplicate_buffer_size (struct coap_s *handle, uint8_t message_count)
 If dublicate message detection is enabled, this function changes buffer size. More...
 
int8_t sn_coap_protocol_set_retransmission_parameters (struct coap_s *handle, uint8_t resending_count, uint8_t resending_interval)
 If re-transmissions are enabled, this function changes resending count and interval. More...
 
int8_t sn_coap_protocol_set_retransmission_buffer (struct coap_s *handle, uint8_t buffer_size_messages, uint16_t buffer_size_bytes)
 If re-transmissions are enabled, this function changes message retransmission queue size. Set size to '0' to disable feature. If both are set to '0', then re-sendings are disabled. More...
 
void sn_coap_protocol_clear_retransmission_buffer (struct coap_s *handle)
 If re-transmissions are enabled, this function removes all messages from the retransmission queue. More...
 
void sn_coap_protocol_block_remove (struct coap_s *handle, sn_nsdl_addr_s *source_address, uint16_t payload_length, void *payload)
 Remove saved block data. Can be used to remove the data from RAM to enable storing it to other place. More...
 
int8_t sn_coap_protocol_delete_retransmission (struct coap_s *handle, uint16_t msg_id)
 If re-transmissions are enabled, this function removes message from retransmission buffer. More...
 

Detailed Description

CoAP C-library User protocol interface header file.