mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-20 00:48:11 -07:00
BadKB fix MAC address byte order
This commit is contained in:
@@ -1117,6 +1117,7 @@ Function,+,furi_hal_bt_lock_core2,void,
|
||||
Function,+,furi_hal_bt_nvm_sram_sem_acquire,void,
|
||||
Function,+,furi_hal_bt_nvm_sram_sem_release,void,
|
||||
Function,+,furi_hal_bt_reinit,void,
|
||||
Function,+,furi_hal_bt_reverse_mac_addr,void,uint8_t[( 6 )]
|
||||
Function,+,furi_hal_bt_serial_notify_buffer_is_empty,void,
|
||||
Function,+,furi_hal_bt_serial_set_event_callback,void,"uint16_t, FuriHalBtSerialCallback, void*"
|
||||
Function,+,furi_hal_bt_serial_set_rpc_status,void,FuriHalBtSerialRpcStatus
|
||||
|
||||
|
@@ -461,6 +461,15 @@ uint32_t furi_hal_bt_get_conn_rssi(uint8_t* rssi) {
|
||||
return since;
|
||||
}
|
||||
|
||||
void furi_hal_bt_reverse_mac_addr(uint8_t mac_addr[GAP_MAC_ADDR_SIZE]) {
|
||||
uint8_t tmp;
|
||||
for(size_t i = 0; i < GAP_MAC_ADDR_SIZE / 2; i++) {
|
||||
tmp = mac_addr[i];
|
||||
mac_addr[i] = mac_addr[GAP_MAC_ADDR_SIZE - 1 - i];
|
||||
mac_addr[GAP_MAC_ADDR_SIZE - 1 - i] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void furi_hal_bt_set_profile_adv_name(
|
||||
FuriHalBtProfile profile,
|
||||
const char name[FURI_HAL_BT_ADV_NAME_LENGTH]) {
|
||||
|
||||
@@ -218,6 +218,11 @@ float furi_hal_bt_get_rssi();
|
||||
*/
|
||||
uint32_t furi_hal_bt_get_transmitted_packets();
|
||||
|
||||
/** Reverse a MAC address byte order in-place
|
||||
* @param[in] mac mac address to reverse
|
||||
*/
|
||||
void furi_hal_bt_reverse_mac_addr(uint8_t mac_addr[GAP_MAC_ADDR_SIZE]);
|
||||
|
||||
/** Modify profile advertisement name and restart bluetooth
|
||||
* @param[in] profile profile type
|
||||
* @param[in] name new adv name
|
||||
|
||||
Reference in New Issue
Block a user