MakingMusicWorkshop / Mbed 2 deprecated 6_songs-from-the-cloud

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Embed: (wiki syntax)

« Back to documentation index

sn_coap_protocol.h File Reference

sn_coap_protocol.h File Reference

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

Go to the source code of this file.

Functions

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.
int8_t sn_coap_protocol_set_block_size (uint16_t block_size)
 If block transfer is enabled, this function changes the block size.
int8_t sn_coap_protocol_set_duplicate_buffer_size (uint8_t message_count)
 If dublicate message detection is enabled, this function changes buffer size.
int8_t sn_coap_protocol_set_retransmission_parameters (uint8_t resending_count, uint8_t resending_interval)
 If re-transmissions are enabled, this function changes resending count and interval.
int8_t sn_coap_protocol_set_retransmission_buffer (uint8_t buffer_size_messages, uint16_t buffer_size_bytes)
 If re-transmissions are enabled, this function changes message retransmission queue size.
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.

Detailed Description

CoAP C-library User protocol interface header file.

Definition in file sn_coap_protocol.h.


Function Documentation

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.

Parameters:
*handlePointer to CoAP library handle

Definition at line 296 of file sn_coap_protocol.c.

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

This function can be called e.g. once in a second but also more frequently.

Parameters:
*handlePointer to CoAP library handle
current_timeis System time in seconds. This time is used for message re-sending timing and to identify old saved data.
Returns:
0 if success -1 if failed

Definition at line 689 of file sn_coap_protocol.c.

int8_t sn_coap_protocol_set_block_size ( uint16_t  block_size )

If block transfer is enabled, this function changes the block size.

Parameters:
uint16_tblock_size maximum size of CoAP payload. Valid sizes are 16, 32, 64, 128, 256, 512 and 1024 bytes
Returns:
0 = success -1 = failure

Definition at line 230 of file sn_coap_protocol.c.

int8_t sn_coap_protocol_set_duplicate_buffer_size ( uint8_t  message_count )

If dublicate message detection is enabled, this function changes buffer size.

Parameters:
uint8_tmessage_count max number of messages saved for duplicate control
Returns:
0 = success -1 = failure

Definition at line 252 of file sn_coap_protocol.c.

int8_t sn_coap_protocol_set_retransmission_buffer ( 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.

Parameters:
uint8_tbuffer_size_messages queue size - maximum number of messages to be saved to queue
uint8_tbuffer_size_bytes queue size - maximum size of messages saved to queue
Returns:
0 = success -1 = failure

Definition at line 281 of file sn_coap_protocol.c.

int8_t sn_coap_protocol_set_retransmission_parameters ( uint8_t  resending_count,
uint8_t  resending_intervall 
)

If re-transmissions are enabled, this function changes resending count and interval.

Parameters:
uint8_tresending_count max number of resendings for message
uint8_tresending_intervall message resending intervall in seconds
Returns:
0 = success -1 = failure

Definition at line 263 of file sn_coap_protocol.c.