mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-04 15:39:59 +00:00
goep_server: add goep_server_response_get_max_body_size
This commit is contained in:
parent
e23a847672
commit
1a9eef6299
@ -601,6 +601,17 @@ uint8_t goep_server_response_create_general(uint16_t goep_cid, uint8_t opcode){
|
||||
return obex_message_builder_response_create_general(buffer, buffer_len, opcode);
|
||||
}
|
||||
|
||||
uint16_t goep_server_response_get_max_body_size(uint16_t goep_cid){
|
||||
goep_server_connection_t * connection = goep_server_get_connection_for_goep_cid(goep_cid);
|
||||
if (connection == NULL) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t * buffer = goep_server_get_outgoing_buffer(connection);
|
||||
uint16_t buffer_len = goep_server_get_outgoing_buffer_len(connection);
|
||||
uint16_t pos = big_endian_read_16(buffer, 1);
|
||||
return buffer_len - pos;
|
||||
}
|
||||
|
||||
uint8_t goep_server_header_add_end_of_body(uint16_t goep_cid, const uint8_t * end_of_body, uint16_t length){
|
||||
goep_server_connection_t * connection = goep_server_get_connection_for_goep_cid(goep_cid);
|
||||
if (connection == NULL) {
|
||||
|
@ -151,6 +151,15 @@ uint8_t goep_server_response_create_connect(uint16_t goep_cid, uint8_t obex_vers
|
||||
*/
|
||||
uint8_t goep_server_response_create_general(uint16_t goep_cid, uint8_t opcode);
|
||||
|
||||
/**
|
||||
* @brief Get max size of body data that can be added to current response with goep_server_header_add_end_of_body
|
||||
* @param goep_cid
|
||||
* @param data
|
||||
* @param length
|
||||
* @return size in bytes or 0
|
||||
*/
|
||||
uint16_t goep_server_response_get_max_body_size(uint16_t goep_cid);
|
||||
|
||||
/**
|
||||
* @brief Add who header to current response
|
||||
* @param goep_cid
|
||||
|
Loading…
x
Reference in New Issue
Block a user