BadKB fix MAC address byte order

This commit is contained in:
Willy-JL
2023-06-18 22:36:05 +01:00
parent 42cb535739
commit a8a6aef712
5 changed files with 18 additions and 0 deletions
@@ -346,6 +346,7 @@ static bool ducky_set_bt_id(BadKbScript* bad_kb, const char* line) {
return false;
}
}
furi_hal_bt_reverse_mac_addr(cfg->bt_mac);
strlcpy(cfg->bt_name, line + mac_len, BAD_KB_NAME_LEN);
FURI_LOG_D(WORKER_TAG, "set bt id: %s", line);
@@ -11,6 +11,7 @@ void bad_kb_scene_config_bt_mac_on_enter(void* context) {
ByteInput* byte_input = bad_kb->byte_input;
memmove(bad_kb->bt_mac_buf, bad_kb->config.bt_mac, BAD_KB_MAC_LEN);
furi_hal_bt_reverse_mac_addr(bad_kb->bt_mac_buf);
byte_input_set_header_text(byte_input, "Set BT MAC address");
byte_input_set_result_callback(
@@ -31,6 +32,7 @@ bool bad_kb_scene_config_bt_mac_on_event(void* context, SceneManagerEvent event)
if(event.type == SceneManagerEventTypeCustom) {
consumed = true;
if(event.event == BadKbAppCustomEventByteInputDone) {
furi_hal_bt_reverse_mac_addr(bad_kb->bt_mac_buf);
memmove(bad_kb->config.bt_mac, bad_kb->bt_mac_buf, BAD_KB_MAC_LEN);
bad_kb_config_refresh(bad_kb);
}