sandbox / mbed-client-c

Fork of mbed-client-c by Christopher Haster

Revision:
4:5d91b0f5038c
Parent:
1:43f5c94c6771
--- a/nsdl-c/sn_coap_header.h	Fri Feb 19 17:46:29 2016 +0000
+++ b/nsdl-c/sn_coap_header.h	Sat Apr 02 00:39:03 2016 +0300
@@ -279,13 +279,13 @@
  *
  * \param *dst_packet_data_ptr is pointer to allocated destination to built CoAP packet
  *
- * \param *src_coap_msg_ptr is pointer to source structure for building Packet data
+ * \param *src_coap_msg_ptr is pointer to source structure for building Packet data 
  *
  * \return Return value is byte count of built Packet data. In failure cases:\n
  *          -1 = Failure in given CoAP header structure\n
  *          -2 = Failure in given pointer (= NULL)
  */
-extern int16_t        sn_coap_builder(uint8_t *dst_packet_data_ptr, sn_coap_hdr_s *src_coap_msg_ptr);
+extern int16_t sn_coap_builder(uint8_t *dst_packet_data_ptr, sn_coap_hdr_s *src_coap_msg_ptr);
 
 /**
  * \fn uint16_t sn_coap_builder_calc_needed_packet_data_size(sn_coap_hdr_s *src_coap_msg_ptr)
@@ -293,7 +293,7 @@
  * \brief Calculates needed Packet data memory size for given CoAP message
  *
  * \param *src_coap_msg_ptr is pointer to data which needed Packet
- *          data length is calculated
+ *          data length is calculated 
  *
  * \return Return value is count of needed memory as bytes for build Packet data
  *          Null if failed
@@ -301,6 +301,37 @@
 extern uint16_t sn_coap_builder_calc_needed_packet_data_size(sn_coap_hdr_s *src_coap_msg_ptr);
 
 /**
+ * \fn int16_t sn_coap_builder_2(uint8_t *dst_packet_data_ptr, sn_coap_hdr_s *src_coap_msg_ptr,  uint16_t blockwise_size)
+ *
+ * \brief Builds an outgoing message buffer from a CoAP header structure.
+ *
+ * \param *dst_packet_data_ptr is pointer to allocated destination to built CoAP packet
+ *
+ * \param *src_coap_msg_ptr is pointer to source structure for building Packet data
+ *
+ * \param blockwise_payload_size Blockwise message maximum payload size
+ *
+ * \return Return value is byte count of built Packet data. In failure cases:\n
+ *          -1 = Failure in given CoAP header structure\n
+ *          -2 = Failure in given pointer (= NULL)
+ */
+extern int16_t sn_coap_builder_2(uint8_t *dst_packet_data_ptr, sn_coap_hdr_s *src_coap_msg_ptr, uint16_t blockwise_payload_size);
+
+/**
+ * \fn uint16_t sn_coap_builder_calc_needed_packet_data_size_2(sn_coap_hdr_s *src_coap_msg_ptr, uint16_t blockwise_payload_size)
+ *
+ * \brief Calculates needed Packet data memory size for given CoAP message
+ *
+ * \param *src_coap_msg_ptr is pointer to data which needed Packet
+ *          data length is calculated
+ * \param blockwise_payload_size Blockwise message maximum payload size
+ *
+ * \return Return value is count of needed memory as bytes for build Packet data
+ *          Null if failed
+ */
+extern uint16_t sn_coap_builder_calc_needed_packet_data_size_2(sn_coap_hdr_s *src_coap_msg_ptr, uint16_t blockwise_payload_size);
+
+/**
  * \fn sn_coap_hdr_s *sn_coap_build_response(struct coap_s *handle, sn_coap_hdr_s *coap_packet_ptr, uint8_t msg_code)
  *
  * \brief Prepares generic response packet from a request packet. This function allocates memory for the resulting sn_coap_hdr_s
@@ -320,4 +351,3 @@
 #endif
 
 #endif /* SN_COAP_HEADER_H_ */
-