goep_client: add goep_client_request_get_max_body_size

This commit is contained in:
Matthias Ringwald 2022-05-13 16:28:34 +02:00
parent c2e0c88e3b
commit e23a847672
2 changed files with 19 additions and 0 deletions

View File

@ -607,6 +607,16 @@ void goep_client_header_add_type(uint16_t goep_cid, const char * type){
obex_message_builder_header_add_type(buffer, buffer_len, type); obex_message_builder_header_add_type(buffer, buffer_len, type);
} }
uint16_t goep_server_response_get_max_body_size(uint16_t goep_cid){
UNUSED(goep_cid);
goep_client_t * context = goep_client;
uint8_t * buffer = goep_client_get_outgoing_buffer(context);
uint16_t buffer_len = goep_client_get_outgoing_buffer_len(context);
uint16_t pos = big_endian_read_16(buffer, 1);
return buffer_len - pos;
}
int goep_client_execute(uint16_t goep_cid){ int goep_client_execute(uint16_t goep_cid){
UNUSED(goep_cid); UNUSED(goep_cid);
goep_client_t * context = goep_client; goep_client_t * context = goep_client;

View File

@ -152,6 +152,15 @@ void goep_client_request_create_set_path(uint16_t goep_cid, uint8_t flags);
*/ */
void goep_client_request_create_put(uint16_t goep_cid); void goep_client_request_create_put(uint16_t goep_cid);
/**
* @brief Get max size of body data that can be added to current response with goep_client_body_add_static
* @param goep_cid
* @param data
* @param length
* @return size in bytes or 0
*/
uint16_t goep_client_request_get_max_body_size(uint16_t goep_cid);
/** /**
* @brief Add SRM Enable * @brief Add SRM Enable
* @param goep_cid * @param goep_cid