mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-14 10:21:49 +00:00
hci_event_builder: use JV format for add string
This commit is contained in:
parent
43bdd57606
commit
7d006440e7
@ -122,8 +122,11 @@ void hci_event_builder_add_con_handle(hci_event_builder_context_t * context, hci
|
||||
void hci_event_builder_add_string(hci_event_builder_context_t * context, const char * text){
|
||||
uint16_t length = (uint16_t) strlen(text);
|
||||
uint16_t pos = context->pos;
|
||||
hci_event_builder_increment_pos(context, length);
|
||||
hci_event_builder_increment_pos(context, length + 2);
|
||||
context->buffer[pos++] = length;
|
||||
memcpy(&context->buffer[pos], text, length);
|
||||
pos += length;
|
||||
context->buffer[pos] = 0;
|
||||
}
|
||||
|
||||
void hci_event_builder_add_bytes(hci_event_builder_context_t * context, const uint8_t * data, uint16_t length){
|
||||
|
@ -141,7 +141,7 @@ void hci_event_builder_add_bd_addr(hci_event_builder_context_t * context, bd_add
|
||||
void hci_event_builder_add_con_handle(hci_event_builder_context_t * context, hci_con_handle_t con_handle);
|
||||
|
||||
/**
|
||||
* @bbrief Add string to event
|
||||
* @bbrief Add string to event using JV format: len, string, trailing zero
|
||||
* @param context
|
||||
* @param value
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user