hci_event_builder: add functions for 8 and 16 byte arrays

This commit is contained in:
Matthias Ringwald 2024-08-26 10:34:31 +02:00
parent b2d70d584c
commit 7fc0aea0ec
2 changed files with 26 additions and 0 deletions

View File

@ -97,6 +97,18 @@ void hci_event_builder_add_32(hci_event_builder_context_t * context, uint32_t va
little_endian_store_32(context->buffer, pos, value);
}
void hci_event_builder_add_64(hci_event_builder_context_t * context, const uint8_t * value){
uint16_t pos = context->pos;
hci_event_builder_increment_pos(context, 8);
reverse_64(value, &context->buffer[pos]);
}
void hci_event_builder_add_128(hci_event_builder_context_t * context, const uint8_t * value){
uint16_t pos = context->pos;
hci_event_builder_increment_pos(context, 16);
reverse_128(value, &context->buffer[pos]);
}
void hci_event_builder_add_bd_addr(hci_event_builder_context_t * context, bd_addr_t addr){
uint16_t pos = context->pos;
hci_event_builder_increment_pos(context, 6);

View File

@ -112,6 +112,20 @@ void hci_event_builder_add_24(hci_event_builder_context_t * context, uint32_t va
*/
void hci_event_builder_add_32(hci_event_builder_context_t * context, uint32_t value);
/**
* @bbrief Add uint8_t[8] in big_endian to event
* @param context
* @param value
*/
void hci_event_builder_add_64(hci_event_builder_context_t * context, const uint8_t * value);
/**
* @bbrief Add uint8_t[16] in big_endian to event
* @param context
* @param value
*/
void hci_event_builder_add_128(hci_event_builder_context_t * context, const uint8_t * value);
/**
* @bbrief Add Bluetooth address to event
* @param context