diff --git a/applications/main/bad_ble/bad_ble_app.c b/applications/main/bad_ble/bad_ble_app.c index ef1a400d6..c5a7e72d0 100644 --- a/applications/main/bad_ble/bad_ble_app.c +++ b/applications/main/bad_ble/bad_ble_app.c @@ -95,14 +95,13 @@ BadBleApp* bad_ble_app_alloc(char* arg) { view_dispatcher_set_navigation_event_callback( app->view_dispatcher, bad_ble_app_back_event_callback); - Bt* bt = furi_record_open(RECORD_BT); app->bt = bt; - const char *adv_name = bt_get_profile_adv_name(bt); + const char* adv_name = bt_get_profile_adv_name(bt); memcpy(app->name, adv_name, BAD_BLE_ADV_NAME_MAX_LEN); - const uint8_t *mac_addr = bt_get_profile_mac_address(bt); - memcpy(app->mac, mac_addr, BAD_BLE_MAC_ADDRESS_LEN); + const uint8_t* mac_addr = bt_get_profile_mac_address(bt); + memcpy(app->mac, mac_addr, BAD_BLE_MAC_ADDRESS_LEN); // Custom Widget app->widget = widget_alloc(); diff --git a/applications/main/bad_ble/bad_ble_app.h b/applications/main/bad_ble/bad_ble_app.h index 35da3ad2c..ff681e849 100644 --- a/applications/main/bad_ble/bad_ble_app.h +++ b/applications/main/bad_ble/bad_ble_app.h @@ -6,7 +6,7 @@ extern "C" { typedef struct BadBleApp BadBleApp; -void bad_ble_set_name(BadBleApp *app, const char* fmt, ...); +void bad_ble_set_name(BadBleApp* app, const char* fmt, ...); #ifdef __cplusplus } diff --git a/applications/main/bad_ble/bad_ble_app_i.h b/applications/main/bad_ble/bad_ble_app_i.h index 940706c85..fd2405c51 100644 --- a/applications/main/bad_ble/bad_ble_app_i.h +++ b/applications/main/bad_ble/bad_ble_app_i.h @@ -23,8 +23,8 @@ #define BAD_BLE_APP_SCRIPT_EXTENSION ".txt" #define BAD_BLE_APP_LAYOUT_EXTENSION ".kl" -#define BAD_BLE_MAC_ADDRESS_LEN 6 // need replace with MAC size maccro -#define BAD_BLE_ADV_NAME_MAX_LEN 18 +#define BAD_BLE_MAC_ADDRESS_LEN 6 // need replace with MAC size maccro +#define BAD_BLE_ADV_NAME_MAX_LEN 18 typedef enum { BadBleAppErrorNoFiles, @@ -40,12 +40,11 @@ struct BadBleApp { Widget* widget; Submenu* submenu; - TextInput *text_input; - ByteInput *byte_input; + TextInput* text_input; + ByteInput* byte_input; uint8_t mac[BAD_BLE_MAC_ADDRESS_LEN]; char name[BAD_BLE_ADV_NAME_MAX_LEN + 1]; - BadBleAppError error; FuriString* file_path; FuriString* keyboard_layout; diff --git a/applications/main/bad_ble/bad_ble_script.c b/applications/main/bad_ble/bad_ble_script.c index 73f4dd6c6..7a14c4498 100644 --- a/applications/main/bad_ble/bad_ble_script.c +++ b/applications/main/bad_ble/bad_ble_script.c @@ -30,7 +30,6 @@ typedef enum { WorkerEvtDisconnect = (1 << 3), } WorkerEvtFlags; - typedef enum { LevelRssi122_100, LevelRssi99_80, @@ -41,12 +40,15 @@ typedef enum { LevelRssiError = 0xFF, } LevelRssiRange; +/** + * Delays for waiting between HID key press and key release +*/ const uint8_t bt_hid_delays[LevelRssiNum] = { - 30, // LevelRssi122_100 - 25, // LevelRssi99_80 - 20, // LevelRssi79_60 - 17, // LevelRssi59_40 - 14, // LevelRssi39_0 + 30, // LevelRssi122_100 + 25, // LevelRssi99_80 + 20, // LevelRssi79_60 + 17, // LevelRssi59_40 + 14, // LevelRssi39_0 }; struct BadBleScript { @@ -161,31 +163,28 @@ static const uint8_t numpad_keys[10] = { uint8_t bt_timeout = 0; -static LevelRssiRange bt_remote_rssi_range(Bt *bt) { +static LevelRssiRange bt_remote_rssi_range(Bt* bt) { + BtRssi rssi_data = {0}; - BtRssi rssi_data = { 0 }; + if(!bt_remote_rssi(bt, &rssi_data)) return LevelRssiError; - if (!bt_remote_rssi(bt, &rssi_data)) - return LevelRssiError; - - if (rssi_data.rssi <= 39) + if(rssi_data.rssi <= 39) return LevelRssi39_0; - else if (rssi_data.rssi <= 59) + else if(rssi_data.rssi <= 59) return LevelRssi59_40; - else if (rssi_data.rssi <= 79) + else if(rssi_data.rssi <= 79) return LevelRssi79_60; - else if (rssi_data.rssi <= 99) + else if(rssi_data.rssi <= 99) return LevelRssi99_80; - else if (rssi_data.rssi <= 122) + else if(rssi_data.rssi <= 122) return LevelRssi122_100; - + return LevelRssiError; } -static inline void update_bt_timeout(Bt *bt) { - +static inline void update_bt_timeout(Bt* bt) { LevelRssiRange r = bt_remote_rssi_range(bt); - if (r < LevelRssiNum) { + if(r < LevelRssiNum) { bt_timeout = bt_hid_delays[r]; } } @@ -297,7 +296,7 @@ static bool ducky_string(BadBleScript* bad_ble, const char* param) { if(keycode != HID_KEYBOARD_NONE) { bt_hid_hold_while_keyboard_buffer_full(1, -1); furi_hal_bt_hid_kb_press(keycode); - + furi_delay_ms(bt_timeout); furi_hal_bt_hid_kb_release(keycode); } @@ -330,8 +329,6 @@ static int32_t return SCRIPT_STATE_NEXT_LINE; // Skip empty lines } - FURI_LOG_D(WORKER_TAG, "line:%s", line_tmp); - // General commands if(strncmp(line_tmp, ducky_cmd_comment, strlen(ducky_cmd_comment)) == 0) { // REM - comment line @@ -426,7 +423,6 @@ static int32_t line_tmp = &line_tmp[ducky_get_command_len(line_tmp) + 1]; key |= ducky_get_keycode(bad_ble, line_tmp, true); } - FURI_LOG_I(WORKER_TAG, "Special key pressed %x\r\n", key); furi_hal_bt_hid_kb_press(key); furi_delay_ms(bt_timeout); @@ -545,7 +541,7 @@ static void bad_ble_hid_state_callback(BtStatus status, void* context) { if(state == true) { LevelRssiRange r = bt_remote_rssi_range(bad_ble->bt); - if (r != LevelRssiError) { + if(r != LevelRssiError) { bt_timeout = bt_hid_delays[r]; } furi_thread_flags_set(furi_thread_get_id(bad_ble->thread), WorkerEvtConnect); @@ -559,9 +555,9 @@ static int32_t bad_ble_worker(void* context) { BadBleWorkerState worker_state = BadBleStateInit; int32_t delay_val = 0; + // BLE HID init bt_timeout = bt_hid_delays[LevelRssi39_0]; - // init ble hid bt_disconnect(bad_ble->bt); // Wait 2nd core to update nvm storage @@ -569,10 +565,6 @@ static int32_t bad_ble_worker(void* context) { bt_keys_storage_set_storage_path(bad_ble->bt, HID_BT_KEYS_STORAGE_PATH); - bt_set_profile_adv_name(bad_ble->bt, "Keyboard K99"); - - //furi_hal_bt_set_profile_adv_name("Keyboard K99", FuriHalBtProfileHidKeyboard); - if(!bt_set_profile(bad_ble->bt, BtProfileHidKeyboard)) { FURI_LOG_E(TAG, "Failed to switch to HID profile"); return -1; @@ -727,7 +719,7 @@ static int32_t bad_ble_worker(void* context) { } update_bt_timeout(bad_ble->bt); - FURI_LOG_I(WORKER_TAG, "BLE Key timeout : %u", bt_timeout); + FURI_LOG_D(WORKER_TAG, "BLE Key timeout : %u", bt_timeout); } // release all keys diff --git a/applications/main/bad_ble/bad_ble_script.h b/applications/main/bad_ble/bad_ble_script.h index f1553e1db..5445c45ed 100644 --- a/applications/main/bad_ble/bad_ble_script.h +++ b/applications/main/bad_ble/bad_ble_script.h @@ -30,7 +30,7 @@ typedef struct { char error[64]; } BadBleState; -BadBleScript* bad_ble_script_open(FuriString* file_path, Bt *bt); +BadBleScript* bad_ble_script_open(FuriString* file_path, Bt* bt); void bad_ble_script_close(BadBleScript* bad_ble); diff --git a/applications/main/bad_ble/scenes/bad_ble_scene_config.c b/applications/main/bad_ble/scenes/bad_ble_scene_config.c index b601a80af..0987b153b 100644 --- a/applications/main/bad_ble/scenes/bad_ble_scene_config.c +++ b/applications/main/bad_ble/scenes/bad_ble_scene_config.c @@ -52,9 +52,9 @@ bool bad_ble_scene_config_on_event(void* context, SceneManagerEvent event) { consumed = true; if(event.event == SubmenuIndexKeyboardLayout) { scene_manager_next_scene(bad_ble->scene_manager, BadBleSceneConfigLayout); - } else if (event.event == SubmenuIndexAdvertisementName) { + } else if(event.event == SubmenuIndexAdvertisementName) { scene_manager_next_scene(bad_ble->scene_manager, BadBleSceneConfigName); - } else if (event.event == SubmenuIndexMacAddress) { + } else if(event.event == SubmenuIndexMacAddress) { scene_manager_next_scene(bad_ble->scene_manager, BadBleSceneConfigMac); } else { furi_crash("Unknown key type"); diff --git a/applications/main/bad_ble/scenes/bad_ble_scene_config_name.c b/applications/main/bad_ble/scenes/bad_ble_scene_config_name.c index 9fdeebe1b..ae9d16ba4 100644 --- a/applications/main/bad_ble/scenes/bad_ble_scene_config_name.c +++ b/applications/main/bad_ble/scenes/bad_ble_scene_config_name.c @@ -33,8 +33,7 @@ bool bad_ble_scene_config_name_on_event(void* context, SceneManagerEvent event) if(event.event == BadBleAppCustomEventTextEditResult) { bt_set_profile_adv_name(bad_ble->bt, bad_ble->name); } - scene_manager_previous_scene( - bad_ble->scene_manager); + scene_manager_previous_scene(bad_ble->scene_manager); } return consumed; } diff --git a/applications/main/gpio/scenes/gpio_scene_start.c b/applications/main/gpio/scenes/gpio_scene_start.c index c06d7b5c6..c43858a0a 100644 --- a/applications/main/gpio/scenes/gpio_scene_start.c +++ b/applications/main/gpio/scenes/gpio_scene_start.c @@ -38,8 +38,7 @@ static void gpio_scene_start_var_list_enter_callback(void* context, uint32_t ind } } -static void -gpio_scene_start_var_list_change_callback(VariableItem* item) { +static void gpio_scene_start_var_list_change_callback(VariableItem* item) { GpioApp* app = variable_item_get_context(item); uint8_t index = variable_item_get_current_value_index(item); diff --git a/applications/plugins/dap_link/dap_link.c b/applications/plugins/dap_link/dap_link.c index c46c68788..dd684810a 100644 --- a/applications/plugins/dap_link/dap_link.c +++ b/applications/plugins/dap_link/dap_link.c @@ -486,8 +486,7 @@ int32_t dap_link_app(void* p) { if(furi_hal_usb_is_locked()) { DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS); DialogMessage* message = dialog_message_alloc(); - dialog_message_set_header( - message, "Connection\nis active!", 3, 2, AlignLeft, AlignTop); + dialog_message_set_header(message, "Connection\nis active!", 3, 2, AlignLeft, AlignTop); dialog_message_set_text( message, "Disconnect from\nPC or phone to\nuse this function.", diff --git a/applications/plugins/dice/dice.c b/applications/plugins/dice/dice.c index 61aa7b4f5..dc748b68f 100644 --- a/applications/plugins/dice/dice.c +++ b/applications/plugins/dice/dice.c @@ -467,7 +467,6 @@ int32_t dice_app(void* p) { return 255; } - ViewPort* view_port = view_port_alloc(); view_port_draw_callback_set(view_port, dice_render_callback, plugin_state); view_port_input_callback_set(view_port, dice_input_callback, plugin_state->event_queue); diff --git a/applications/plugins/orgasmotron/orgasmotron.c b/applications/plugins/orgasmotron/orgasmotron.c index b28f392f5..684fc3d95 100644 --- a/applications/plugins/orgasmotron/orgasmotron.c +++ b/applications/plugins/orgasmotron/orgasmotron.c @@ -40,7 +40,7 @@ int32_t orgasmotron_app(void* p) { PluginState* plugin_state = malloc(sizeof(PluginState)); ValueMutex state_mutex; - if (!init_mutex(&state_mutex, plugin_state, sizeof(PluginState))) { + if(!init_mutex(&state_mutex, plugin_state, sizeof(PluginState))) { FURI_LOG_E("Orgasmatron", "cannot create mutex\r\n"); free(plugin_state); return 255; @@ -61,10 +61,10 @@ int32_t orgasmotron_app(void* p) { //int mode = 0; bool processing = true; //while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) { - while (processing) { + while(processing) { FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100); PluginState* plugin_state = (PluginState*)acquire_mutex_block(&state_mutex); - if (event_status == FuriStatusOk) { + if(event_status == FuriStatusOk) { if(event.key == InputKeyBack && event.type == InputTypeShort) { //Exit Application notification_message(notification, &sequence_reset_vibro); @@ -73,53 +73,58 @@ int32_t orgasmotron_app(void* p) { processing = false; //break; } - if(event.key == InputKeyOk && (event.type == InputTypePress || event.type == InputTypeRelease)) { + if(event.key == InputKeyOk && + (event.type == InputTypePress || event.type == InputTypeRelease)) { plugin_state->mode = 0; } - if(event.key == InputKeyLeft && (event.type == InputTypePress || event.type == InputTypeRelease)) { + if(event.key == InputKeyLeft && + (event.type == InputTypePress || event.type == InputTypeRelease)) { plugin_state->mode = 1; } - if(event.key == InputKeyRight && (event.type == InputTypePress || event.type == InputTypeRelease)) { + if(event.key == InputKeyRight && + (event.type == InputTypePress || event.type == InputTypeRelease)) { plugin_state->mode = 3; } - if(event.key == InputKeyUp && (event.type == InputTypePress || event.type == InputTypeRelease)) { + if(event.key == InputKeyUp && + (event.type == InputTypePress || event.type == InputTypeRelease)) { plugin_state->mode = 2; } - if(event.key == InputKeyDown && (event.type == InputTypePress || event.type == InputTypeRelease)) { + if(event.key == InputKeyDown && + (event.type == InputTypePress || event.type == InputTypeRelease)) { plugin_state->mode = 4; } } - - if (plugin_state->mode == 0) { + + if(plugin_state->mode == 0) { //Stop Vibration notification_message(notification, &sequence_reset_vibro); notification_message(notification, &sequence_reset_green); - } else if (plugin_state->mode == 1) { + } else if(plugin_state->mode == 1) { //Full power notification_message(notification, &sequence_set_vibro_on); notification_message(notification, &sequence_set_green_255); - } else if (plugin_state->mode == 2) { + } else if(plugin_state->mode == 2) { //Pulsed Vibration notification_message(notification, &sequence_set_vibro_on); notification_message(notification, &sequence_set_green_255); delay(100); notification_message(notification, &sequence_reset_vibro); - } else if (plugin_state->mode == 3) { + } else if(plugin_state->mode == 3) { //Soft power notification_message(notification, &sequence_set_vibro_on); notification_message(notification, &sequence_set_green_255); delay(50); notification_message(notification, &sequence_reset_vibro); - } else if (plugin_state->mode == 4) { + } else if(plugin_state->mode == 4) { //Special Sequence - for (int i = 0;i < 15;i++) { + for(int i = 0; i < 15; i++) { notification_message(notification, &sequence_set_vibro_on); notification_message(notification, &sequence_set_green_255); delay(50); notification_message(notification, &sequence_reset_vibro); delay(50); } - for (int i = 0;i < 2;i++) { + for(int i = 0; i < 2; i++) { notification_message(notification, &sequence_set_vibro_on); notification_message(notification, &sequence_set_green_255); delay(400); diff --git a/applications/plugins/protoview/app.c b/applications/plugins/protoview/app.c index f16457e55..d060e2242 100644 --- a/applications/plugins/protoview/app.c +++ b/applications/plugins/protoview/app.c @@ -40,8 +40,8 @@ extern const SubGhzProtocolRegistry protoview_protocol_registry; /* The callback actually just passes the control to the actual active * view callback, after setting up basic stuff like cleaning the screen * and setting color to black. */ -static void render_callback(Canvas *const canvas, void *ctx) { - ProtoViewApp *app = ctx; +static void render_callback(Canvas* const canvas, void* ctx) { + ProtoViewApp* app = ctx; /* Clear screen. */ canvas_set_color(canvas, ColorWhite); @@ -51,14 +51,25 @@ static void render_callback(Canvas *const canvas, void *ctx) { /* Call who is in charge right now. */ switch(app->current_view) { - case ViewRawPulses: render_view_raw_pulses(canvas,app); break; - case ViewInfo: render_view_info(canvas,app); break; + case ViewRawPulses: + render_view_raw_pulses(canvas, app); + break; + case ViewInfo: + render_view_info(canvas, app); + break; case ViewFrequencySettings: case ViewModulationSettings: - render_view_settings(canvas,app); break; - case ViewDirectSampling: render_view_direct_sampling(canvas,app); break; - case ViewBuildMessage: render_view_build_message(canvas,app); break; - default: furi_crash(TAG "Invalid view selected"); break; + render_view_settings(canvas, app); + break; + case ViewDirectSampling: + render_view_direct_sampling(canvas, app); + break; + case ViewBuildMessage: + render_view_build_message(canvas, app); + break; + default: + furi_crash(TAG "Invalid view selected"); + break; } /* Draw the alert box if set. */ @@ -67,10 +78,9 @@ static void render_callback(Canvas *const canvas, void *ctx) { /* Here all we do is putting the events into the queue that will be handled * in the while() loop of the app entry point function. */ -static void input_callback(InputEvent* input_event, void* ctx) -{ - ProtoViewApp *app = ctx; - furi_message_queue_put(app->event_queue,input_event,FuriWaitForever); +static void input_callback(InputEvent* input_event, void* ctx) { + ProtoViewApp* app = ctx; + furi_message_queue_put(app->event_queue, input_event, FuriWaitForever); } /* Called to switch view (when left/right is pressed). Handles @@ -80,15 +90,15 @@ static void input_callback(InputEvent* input_event, void* ctx) * The 'switchto' parameter can be the identifier of a view, or the * special views ViewGoNext and ViewGoPrev in order to move to * the logical next/prev view. */ -static void app_switch_view(ProtoViewApp *app, ProtoViewCurrentView switchto) { +static void app_switch_view(ProtoViewApp* app, ProtoViewCurrentView switchto) { /* Switch to the specified view. */ ProtoViewCurrentView old = app->current_view; - if (switchto == ViewGoNext) { + if(switchto == ViewGoNext) { app->current_view++; - if (app->current_view == ViewLast) app->current_view = 0; - } else if (switchto == ViewGoPrev) { - if (app->current_view == 0) - app->current_view = ViewLast-1; + if(app->current_view == ViewLast) app->current_view = 0; + } else if(switchto == ViewGoPrev) { + if(app->current_view == 0) + app->current_view = ViewLast - 1; else app->current_view--; } else { @@ -103,20 +113,20 @@ static void app_switch_view(ProtoViewApp *app, ProtoViewCurrentView switchto) { /* Reset the view private data each time, before calling the enter/exit * callbacks that may want to setup some state. */ - memset(app->view_privdata,0,PROTOVIEW_VIEW_PRIVDATA_LEN); + memset(app->view_privdata, 0, PROTOVIEW_VIEW_PRIVDATA_LEN); /* Call the enter/exit view callbacks if needed. */ - if (old == ViewDirectSampling) view_exit_direct_sampling(app); - if (new == ViewDirectSampling) view_enter_direct_sampling(app); - if (old == ViewBuildMessage) view_exit_build_message(app); - if (new == ViewBuildMessage) view_enter_build_message(app); - if (old == ViewInfo) view_exit_info(app); + if(old == ViewDirectSampling) view_exit_direct_sampling(app); + if(new == ViewDirectSampling) view_enter_direct_sampling(app); + if(old == ViewBuildMessage) view_exit_build_message(app); + if(new == ViewBuildMessage) view_enter_build_message(app); + if(old == ViewInfo) view_exit_info(app); /* The frequency/modulation settings are actually a single view: * as long as the user stays between the two modes of this view we * don't need to call the exit-view callback. */ - if ((old == ViewFrequencySettings && new != ViewModulationSettings) || - (old == ViewModulationSettings && new != ViewFrequencySettings)) + if((old == ViewFrequencySettings && new != ViewModulationSettings) || + (old == ViewModulationSettings && new != ViewFrequencySettings)) view_exit_settings(app); ui_dismiss_alert(app); @@ -125,7 +135,7 @@ static void app_switch_view(ProtoViewApp *app, ProtoViewCurrentView switchto) { /* Allocate the application state and initialize a number of stuff. * This is called in the entry point to create the application state. */ ProtoViewApp* protoview_app_alloc() { - ProtoViewApp *app = malloc(sizeof(ProtoViewApp)); + ProtoViewApp* app = malloc(sizeof(ProtoViewApp)); // Init shared data structures RawSamples = raw_samples_alloc(); @@ -148,10 +158,10 @@ ProtoViewApp* protoview_app_alloc() { app->show_text_input = false; app->alert_dismiss_time = 0; app->current_view = ViewRawPulses; - for (int j = 0; j < ViewLast; j++) app->current_subview[j] = 0; + for(int j = 0; j < ViewLast; j++) app->current_subview[j] = 0; app->direct_sampling_enabled = false; app->view_privdata = malloc(PROTOVIEW_VIEW_PRIVDATA_LEN); - memset(app->view_privdata,0,PROTOVIEW_VIEW_PRIVDATA_LEN); + memset(app->view_privdata, 0, PROTOVIEW_VIEW_PRIVDATA_LEN); // Signal found and visualization defaults app->signal_bestlen = 0; @@ -176,17 +186,14 @@ ProtoViewApp* protoview_app_alloc() { app->txrx->environment = subghz_environment_alloc(); subghz_environment_set_protocol_registry( app->txrx->environment, (void*)&protoview_protocol_registry); - app->txrx->receiver = - subghz_receiver_alloc_init(app->txrx->environment); - subghz_receiver_set_filter(app->txrx->receiver, - SubGhzProtocolFlag_Decodable); + app->txrx->receiver = subghz_receiver_alloc_init(app->txrx->environment); + subghz_receiver_set_filter(app->txrx->receiver, SubGhzProtocolFlag_Decodable); subghz_worker_set_overrun_callback( - app->txrx->worker, - (SubGhzWorkerOverrunCallback)subghz_receiver_reset); + app->txrx->worker, (SubGhzWorkerOverrunCallback)subghz_receiver_reset); subghz_worker_set_pair_callback( app->txrx->worker, (SubGhzWorkerPairCallback)subghz_receiver_decode); subghz_worker_set_context(app->txrx->worker, app->txrx->receiver); - + app->frequency = subghz_setting_get_default_frequency(app->setting); app->modulation = 0; /* Defaults to ProtoViewModulations[0]. */ @@ -199,7 +206,7 @@ ProtoViewApp* protoview_app_alloc() { /* Free what the application allocated. It is not clear to me if the * Flipper OS, once the application exits, will be able to reclaim space * even if we forget to free something here. */ -void protoview_app_free(ProtoViewApp *app) { +void protoview_app_free(ProtoViewApp* app) { furi_assert(app); // Put CC1101 on sleep, this also restores charging. @@ -218,7 +225,7 @@ void protoview_app_free(ProtoViewApp *app) { subghz_setting_free(app->setting); // Worker stuff. - if (!app->txrx->debug_timer_sampling) { + if(!app->txrx->debug_timer_sampling) { subghz_receiver_free(app->txrx->receiver); subghz_environment_free(app->txrx->environment); subghz_worker_free(app->txrx->worker); @@ -236,8 +243,8 @@ void protoview_app_free(ProtoViewApp *app) { /* Called periodically. Do signal processing here. Data we process here * will be later displayed by the render callback. The side effect of this * function is to scan for signals and set DetectedSamples. */ -static void timer_callback(void *ctx) { - ProtoViewApp *app = ctx; +static void timer_callback(void* ctx) { + ProtoViewApp* app = ctx; uint32_t delta, lastidx = app->signal_last_scan_idx; /* scan_for_signal(), called by this function, deals with a @@ -245,14 +252,14 @@ static void timer_callback(void *ctx) { * cross-boundaries, it is enough if we scan each time the buffer fills * for 50% more compared to the last scan. Thanks to this check we * can avoid scanning too many times to just find the same data. */ - if (lastidx < RawSamples->idx) { + if(lastidx < RawSamples->idx) { delta = RawSamples->idx - lastidx; } else { delta = RawSamples->total - lastidx + RawSamples->idx; } - if (delta < RawSamples->total/2) return; + if(delta < RawSamples->total / 2) return; app->signal_last_scan_idx = RawSamples->idx; - scan_for_signal(app,RawSamples); + scan_for_signal(app, RawSamples); } /* This is the navigation callback we use in the view dispatcher used @@ -265,7 +272,7 @@ static void timer_callback(void *ctx) { * We just need a dummy callback returning false. We believe the * implementation should be changed and if no callback is set, it should be * the same as returning false. */ -static bool keyboard_view_dispatcher_navigation_callback(void *ctx) { +static bool keyboard_view_dispatcher_navigation_callback(void* ctx) { UNUSED(ctx); return false; } @@ -273,10 +280,10 @@ static bool keyboard_view_dispatcher_navigation_callback(void *ctx) { /* App entry point, as specified in application.fam. */ int32_t protoview_app_entry(void* p) { UNUSED(p); - ProtoViewApp *app = protoview_app_alloc(); + ProtoViewApp* app = protoview_app_alloc(); /* Create a timer. We do data analysis in the callback. */ - FuriTimer *timer = furi_timer_alloc(timer_callback, FuriTimerTypePeriodic, app); + FuriTimer* timer = furi_timer_alloc(timer_callback, FuriTimerTypePeriodic, app); furi_timer_start(timer, furi_kernel_get_tick_frequency() / 8); /* Start listening to signals immediately. */ @@ -291,71 +298,68 @@ int32_t protoview_app_entry(void* p) { InputEvent input; while(app->running) { FuriStatus qstat = furi_message_queue_get(app->event_queue, &input, 100); - if (qstat == FuriStatusOk) { - if (DEBUG_MSG) FURI_LOG_E(TAG, "Main Loop - Input: type %d key %u", - input.type, input.key); + if(qstat == FuriStatusOk) { + if(DEBUG_MSG) + FURI_LOG_E(TAG, "Main Loop - Input: type %d key %u", input.type, input.key); /* Handle navigation here. Then handle view-specific inputs * in the view specific handling function. */ - if (input.type == InputTypeShort && - input.key == InputKeyBack) - { - if (app->current_view != ViewRawPulses) { + if(input.type == InputTypeShort && input.key == InputKeyBack) { + if(app->current_view != ViewRawPulses) { /* If this is not the main app view, go there. */ - app_switch_view(app,ViewRawPulses); + app_switch_view(app, ViewRawPulses); } else { /* If we are in the main app view, warn the user * they needs to long press to really quit. */ - ui_show_alert(app,"Long press to exit",1000); + ui_show_alert(app, "Long press to exit", 1000); } - } else if (input.type == InputTypeLong && - input.key == InputKeyBack) - { + } else if(input.type == InputTypeLong && input.key == InputKeyBack) { app->running = 0; - } else if (input.type == InputTypeShort && - input.key == InputKeyRight && - ui_get_current_subview(app) == 0) - { + } else if( + input.type == InputTypeShort && input.key == InputKeyRight && + ui_get_current_subview(app) == 0) { /* Go to the next view. */ - app_switch_view(app,ViewGoNext); - } else if (input.type == InputTypeShort && - input.key == InputKeyLeft && - ui_get_current_subview(app) == 0) - { + app_switch_view(app, ViewGoNext); + } else if( + input.type == InputTypeShort && input.key == InputKeyLeft && + ui_get_current_subview(app) == 0) { /* Go to the previous view. */ - app_switch_view(app,ViewGoPrev); + app_switch_view(app, ViewGoPrev); } else { /* This is where we pass the control to the currently * active view input processing. */ switch(app->current_view) { case ViewRawPulses: - process_input_raw_pulses(app,input); + process_input_raw_pulses(app, input); break; case ViewInfo: - process_input_info(app,input); + process_input_info(app, input); break; case ViewFrequencySettings: case ViewModulationSettings: - process_input_settings(app,input); + process_input_settings(app, input); break; case ViewDirectSampling: - process_input_direct_sampling(app,input); + process_input_direct_sampling(app, input); break; case ViewBuildMessage: - process_input_build_message(app,input); + process_input_build_message(app, input); + break; + default: + furi_crash(TAG "Invalid view selected"); break; - default: furi_crash(TAG "Invalid view selected"); break; } } } else { /* Useful to understand if the app is still alive when it * does not respond because of bugs. */ - if (DEBUG_MSG) { - static int c = 0; c++; - if (!(c % 20)) FURI_LOG_E(TAG, "Loop timeout"); + if(DEBUG_MSG) { + static int c = 0; + c++; + if(!(c % 20)) FURI_LOG_E(TAG, "Loop timeout"); } } - if (app->show_text_input) { + if(app->show_text_input) { /* Remove our viewport: we need to use a view dispatcher * in order to show the standard Flipper keyboard. */ gui_remove_view_port(app->gui, app->view_port); @@ -368,11 +372,11 @@ int32_t protoview_app_entry(void* p) { * otherwise when the user presses back on the keyboard to * abort, the dispatcher will not stop. */ view_dispatcher_set_navigation_event_callback( - app->view_dispatcher, - keyboard_view_dispatcher_navigation_callback); + app->view_dispatcher, keyboard_view_dispatcher_navigation_callback); app->text_input = text_input_alloc(); - view_dispatcher_set_event_callback_context(app->view_dispatcher,app); - view_dispatcher_add_view(app->view_dispatcher, 0, text_input_get_view(app->text_input)); + view_dispatcher_set_event_callback_context(app->view_dispatcher, app); + view_dispatcher_add_view( + app->view_dispatcher, 0, text_input_get_view(app->text_input)); view_dispatcher_switch_to_view(app->view_dispatcher, 0); /* Setup the text input view. The different parameters are set @@ -388,7 +392,8 @@ int32_t protoview_app_entry(void* p) { false); /* Run the dispatcher with the keyboard. */ - view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen); + view_dispatcher_attach_to_gui( + app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen); view_dispatcher_run(app->view_dispatcher); /* Undo all it: remove the view from the dispatcher, free it @@ -406,7 +411,7 @@ int32_t protoview_app_entry(void* p) { } /* App no longer running. Shut down and free. */ - if (app->txrx->txrx_state == TxRxStateRx) { + if(app->txrx->txrx_state == TxRxStateRx) { FURI_LOG_E(TAG, "Putting CC1101 to sleep before exiting."); radio_rx_end(app); radio_sleep(app); @@ -416,4 +421,3 @@ int32_t protoview_app_entry(void* p) { protoview_app_free(app); return 0; } - diff --git a/applications/plugins/protoview/app.h b/applications/plugins/protoview/app.h index 33bd85eb4..85007e345 100644 --- a/applications/plugins/protoview/app.h +++ b/applications/plugins/protoview/app.h @@ -66,11 +66,11 @@ typedef enum { /* ================================== RX/TX ================================= */ typedef struct { - const char *name; // Name to show to the user. - const char *id; // Identifier in the Flipper API/file. - FuriHalSubGhzPreset preset; // The preset ID. - uint8_t *custom; // If not null, a set of registers for - // the CC1101, specifying a custom preset. + const char* name; // Name to show to the user. + const char* id; // Identifier in the Flipper API/file. + FuriHalSubGhzPreset preset; // The preset ID. + uint8_t* custom; // If not null, a set of registers for + // the CC1101, specifying a custom preset. } ProtoViewModulation; extern ProtoViewModulation ProtoViewModulations[]; /* In app_subghz.c */ @@ -79,19 +79,19 @@ extern ProtoViewModulation ProtoViewModulations[]; /* In app_subghz.c */ * It receives data and we get our protocol "feed" callback called * with the level (1 or 0) and duration. */ struct ProtoViewTxRx { - bool freq_mod_changed; /* The user changed frequency and/or modulation + bool freq_mod_changed; /* The user changed frequency and/or modulation from the interface. There is to restart the radio with the right parameters. */ - SubGhzWorker* worker; /* Our background worker. */ + SubGhzWorker* worker; /* Our background worker. */ SubGhzEnvironment* environment; SubGhzReceiver* receiver; TxRxState txrx_state; /* Receiving, idle or sleeping? */ /* Timer sampling mode state. */ - bool debug_timer_sampling; /* Read data from GDO0 in a busy loop. Only + bool debug_timer_sampling; /* Read data from GDO0 in a busy loop. Only for testing. */ uint32_t last_g0_change_time; /* Last high->low (or reverse) switch. */ - bool last_g0_value; /* Current value (high or low): we are + bool last_g0_value; /* Current value (high or low): we are checking the duration in the timer handler. */ }; @@ -103,44 +103,44 @@ typedef struct ProtoViewTxRx ProtoViewTxRx; #define ALERT_MAX_LEN 32 struct ProtoViewApp { /* GUI */ - Gui *gui; - NotificationApp *notification; - ViewPort *view_port; /* We just use a raw viewport and we render + Gui* gui; + NotificationApp* notification; + ViewPort* view_port; /* We just use a raw viewport and we render everything into the low level canvas. */ - ProtoViewCurrentView current_view; /* Active left-right view ID. */ - int current_subview[ViewLast]; /* Active up-down subview ID. */ - FuriMessageQueue *event_queue; /* Keypress events go here. */ + ProtoViewCurrentView current_view; /* Active left-right view ID. */ + int current_subview[ViewLast]; /* Active up-down subview ID. */ + FuriMessageQueue* event_queue; /* Keypress events go here. */ /* Input text state. */ - ViewDispatcher *view_dispatcher; /* Used only when we want to show + ViewDispatcher* view_dispatcher; /* Used only when we want to show the text_input view for a moment. Otherwise it is set to null. */ - TextInput *text_input; + TextInput* text_input; bool show_text_input; - char *text_input_buffer; + char* text_input_buffer; uint32_t text_input_buffer_len; void (*text_input_done_callback)(void*); /* Alert state. */ - uint32_t alert_dismiss_time; /* Millisecond when the alert will be + uint32_t alert_dismiss_time; /* Millisecond when the alert will be no longer shown. Or zero if the alert is currently not set at all. */ char alert_text[ALERT_MAX_LEN]; /* Alert content. */ /* Radio related. */ - ProtoViewTxRx *txrx; /* Radio state. */ - SubGhzSetting *setting; /* A list of valid frequencies. */ + ProtoViewTxRx* txrx; /* Radio state. */ + SubGhzSetting* setting; /* A list of valid frequencies. */ /* Generic app state. */ - int running; /* Once false exists the app. */ + int running; /* Once false exists the app. */ uint32_t signal_bestlen; /* Longest coherent signal observed so far. */ uint32_t signal_last_scan_idx; /* Index of the buffer last time we performed the scan. */ - bool signal_decoded; /* Was the current signal decoded? */ - ProtoViewMsgInfo *msg_info; /* Decoded message info if not NULL. */ + bool signal_decoded; /* Was the current signal decoded? */ + ProtoViewMsgInfo* msg_info; /* Decoded message info if not NULL. */ bool direct_sampling_enabled; /* This special view needs an explicit acknowledge to work. */ - void *view_privdata; /* This is a piece of memory of total size + void* view_privdata; /* This is a piece of memory of total size PROTOVIEW_VIEW_PRIVDATA_LEN that it is initialized to zero when we switch to a a new view. While the view we are using @@ -149,12 +149,12 @@ struct ProtoViewApp { the pointer to a few specific-data structure. */ /* Raw view apps state. */ - uint32_t us_scale; /* microseconds per pixel. */ - uint32_t signal_offset; /* Long press left/right panning in raw view. */ + uint32_t us_scale; /* microseconds per pixel. */ + uint32_t signal_offset; /* Long press left/right panning in raw view. */ /* Configuration view app state. */ - uint32_t frequency; /* Current frequency. */ - uint8_t modulation; /* Current modulation ID, array index in the + uint32_t frequency; /* Current frequency. */ + uint8_t modulation; /* Current modulation ID, array index in the ProtoViewModulations table. */ }; @@ -165,18 +165,18 @@ struct ProtoViewApp { * in the message info view. */ #define PROTOVIEW_MSG_STR_LEN 32 typedef struct ProtoViewMsgInfo { - ProtoViewDecoder *decoder; /* The decoder that decoded the message. */ - ProtoViewFieldSet *fieldset; /* Decoded fields. */ + ProtoViewDecoder* decoder; /* The decoder that decoded the message. */ + ProtoViewFieldSet* fieldset; /* Decoded fields. */ /* Low level information of the detected signal: the following are filled * by the protocol decoding function: */ - uint32_t start_off; /* Pulses start offset in the bitmap. */ - uint32_t pulses_count; /* Number of pulses of the full message. */ + uint32_t start_off; /* Pulses start offset in the bitmap. */ + uint32_t pulses_count; /* Number of pulses of the full message. */ /* The following are passed already filled to the decoder. */ - uint32_t short_pulse_dur; /* Microseconds duration of the short pulse. */ + uint32_t short_pulse_dur; /* Microseconds duration of the short pulse. */ /* The following are filled by ProtoView core after the decoder returned * success. */ - uint8_t *bits; /* Bitmap with the signal. */ - uint32_t bits_bytes; /* Number of full bytes in the bitmap, that + uint8_t* bits; /* Bitmap with the signal. */ + uint32_t bits_bytes; /* Number of full bytes in the bitmap, that is 'pulses_count/8' rounded to the next integer. */ } ProtoViewMsgInfo; @@ -196,28 +196,28 @@ typedef enum { typedef struct { ProtoViewFieldType type; - uint32_t len; // Depends on type: - // Bits for integers (signed,unsigned,binary,hex). - // Number of characters for strings. - // Number of nibbles for bytes (1 for each 4 bits). - // Number of digits after dot for floats. - char *name; // Field name. + uint32_t len; // Depends on type: + // Bits for integers (signed,unsigned,binary,hex). + // Number of characters for strings. + // Number of nibbles for bytes (1 for each 4 bits). + // Number of digits after dot for floats. + char* name; // Field name. union { - char *str; // String type. - int64_t value; // Signed integer type. - uint64_t uvalue; // Unsigned integer type. - uint8_t *bytes; // Raw bytes type. - float fvalue; // Float type. + char* str; // String type. + int64_t value; // Signed integer type. + uint64_t uvalue; // Unsigned integer type. + uint8_t* bytes; // Raw bytes type. + float fvalue; // Float type. }; } ProtoViewField; typedef struct ProtoViewFieldSet { - ProtoViewField **fields; + ProtoViewField** fields; uint32_t numfields; } ProtoViewFieldSet; typedef struct ProtoViewDecoder { - const char *name; /* Protocol name. */ + const char* name; /* Protocol name. */ /* The decode function takes a buffer that is actually a bitmap, with * high and low levels represented as 0 and 1. The number of high/low * pulses represented by the bitmap is passed as the 'numbits' argument, @@ -225,15 +225,15 @@ typedef struct ProtoViewDecoder { * 'bits'. So 'numbytes' is mainly useful to pass as argument to other * functions that perform bit extraction with bound checking, such as * bitmap_get() and so forth. */ - bool (*decode)(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info); + bool (*decode)(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info); /* This method is used by the decoder to return the fields it needs * in order to build a new message. This way the message builder view * can ask the user to fill the right set of fields of the specified * type. */ - void (*get_fields)(ProtoViewFieldSet *fields); + void (*get_fields)(ProtoViewFieldSet* fields); /* This method takes the fields supported by the decoder, and * renders a message in 'samples'. */ - void (*build_message)(RawSamplesBuffer *samples, ProtoViewFieldSet *fields); + void (*build_message)(RawSamplesBuffer* samples, ProtoViewFieldSet* fields); } ProtoViewDecoder; extern RawSamplesBuffer *RawSamples, *DetectedSamples; @@ -244,76 +244,118 @@ uint32_t radio_rx(ProtoViewApp* app); void radio_idle(ProtoViewApp* app); void radio_rx_end(ProtoViewApp* app); void radio_sleep(ProtoViewApp* app); -void raw_sampling_worker_start(ProtoViewApp *app); -void raw_sampling_worker_stop(ProtoViewApp *app); -void radio_tx_signal(ProtoViewApp *app, FuriHalSubGhzAsyncTxCallback data_feeder, void *ctx); +void raw_sampling_worker_start(ProtoViewApp* app); +void raw_sampling_worker_stop(ProtoViewApp* app); +void radio_tx_signal(ProtoViewApp* app, FuriHalSubGhzAsyncTxCallback data_feeder, void* ctx); /* signal.c */ uint32_t duration_delta(uint32_t a, uint32_t b); -void reset_current_signal(ProtoViewApp *app); -void scan_for_signal(ProtoViewApp *app,RawSamplesBuffer *source); -bool bitmap_get(uint8_t *b, uint32_t blen, uint32_t bitpos); -void bitmap_set(uint8_t *b, uint32_t blen, uint32_t bitpos, bool val); -void bitmap_copy(uint8_t *d, uint32_t dlen, uint32_t doff, uint8_t *s, uint32_t slen, uint32_t soff, uint32_t count); -void bitmap_set_pattern(uint8_t *b, uint32_t blen, uint32_t off, const char *pat); -void bitmap_reverse_bytes_bits(uint8_t *p, uint32_t len); -bool bitmap_match_bits(uint8_t *b, uint32_t blen, uint32_t bitpos, const char *bits); -uint32_t bitmap_seek_bits(uint8_t *b, uint32_t blen, uint32_t startpos, uint32_t maxbits, const char *bits); -uint32_t convert_from_line_code(uint8_t *buf, uint64_t buflen, uint8_t *bits, uint32_t len, uint32_t offset, const char *zero_pattern, const char *one_pattern); -uint32_t convert_from_diff_manchester(uint8_t *buf, uint64_t buflen, uint8_t *bits, uint32_t len, uint32_t off, bool previous); -void init_msg_info(ProtoViewMsgInfo *i, ProtoViewApp *app); -void free_msg_info(ProtoViewMsgInfo *i); +void reset_current_signal(ProtoViewApp* app); +void scan_for_signal(ProtoViewApp* app, RawSamplesBuffer* source); +bool bitmap_get(uint8_t* b, uint32_t blen, uint32_t bitpos); +void bitmap_set(uint8_t* b, uint32_t blen, uint32_t bitpos, bool val); +void bitmap_copy( + uint8_t* d, + uint32_t dlen, + uint32_t doff, + uint8_t* s, + uint32_t slen, + uint32_t soff, + uint32_t count); +void bitmap_set_pattern(uint8_t* b, uint32_t blen, uint32_t off, const char* pat); +void bitmap_reverse_bytes_bits(uint8_t* p, uint32_t len); +bool bitmap_match_bits(uint8_t* b, uint32_t blen, uint32_t bitpos, const char* bits); +uint32_t bitmap_seek_bits( + uint8_t* b, + uint32_t blen, + uint32_t startpos, + uint32_t maxbits, + const char* bits); +uint32_t convert_from_line_code( + uint8_t* buf, + uint64_t buflen, + uint8_t* bits, + uint32_t len, + uint32_t offset, + const char* zero_pattern, + const char* one_pattern); +uint32_t convert_from_diff_manchester( + uint8_t* buf, + uint64_t buflen, + uint8_t* bits, + uint32_t len, + uint32_t off, + bool previous); +void init_msg_info(ProtoViewMsgInfo* i, ProtoViewApp* app); +void free_msg_info(ProtoViewMsgInfo* i); /* signal_file.c */ -bool save_signal(ProtoViewApp *app, const char *filename); +bool save_signal(ProtoViewApp* app, const char* filename); /* view_*.c */ -void render_view_raw_pulses(Canvas *const canvas, ProtoViewApp *app); -void process_input_raw_pulses(ProtoViewApp *app, InputEvent input); -void render_view_settings(Canvas *const canvas, ProtoViewApp *app); -void process_input_settings(ProtoViewApp *app, InputEvent input); -void render_view_info(Canvas *const canvas, ProtoViewApp *app); -void process_input_info(ProtoViewApp *app, InputEvent input); -void render_view_direct_sampling(Canvas *const canvas, ProtoViewApp *app); -void process_input_direct_sampling(ProtoViewApp *app, InputEvent input); -void render_view_build_message(Canvas *const canvas, ProtoViewApp *app); -void process_input_build_message(ProtoViewApp *app, InputEvent input); -void view_enter_build_message(ProtoViewApp *app); -void view_exit_build_message(ProtoViewApp *app); -void view_enter_direct_sampling(ProtoViewApp *app); -void view_exit_direct_sampling(ProtoViewApp *app); -void view_exit_settings(ProtoViewApp *app); -void view_exit_info(ProtoViewApp *app); -void adjust_raw_view_scale(ProtoViewApp *app, uint32_t short_pulse_dur); +void render_view_raw_pulses(Canvas* const canvas, ProtoViewApp* app); +void process_input_raw_pulses(ProtoViewApp* app, InputEvent input); +void render_view_settings(Canvas* const canvas, ProtoViewApp* app); +void process_input_settings(ProtoViewApp* app, InputEvent input); +void render_view_info(Canvas* const canvas, ProtoViewApp* app); +void process_input_info(ProtoViewApp* app, InputEvent input); +void render_view_direct_sampling(Canvas* const canvas, ProtoViewApp* app); +void process_input_direct_sampling(ProtoViewApp* app, InputEvent input); +void render_view_build_message(Canvas* const canvas, ProtoViewApp* app); +void process_input_build_message(ProtoViewApp* app, InputEvent input); +void view_enter_build_message(ProtoViewApp* app); +void view_exit_build_message(ProtoViewApp* app); +void view_enter_direct_sampling(ProtoViewApp* app); +void view_exit_direct_sampling(ProtoViewApp* app); +void view_exit_settings(ProtoViewApp* app); +void view_exit_info(ProtoViewApp* app); +void adjust_raw_view_scale(ProtoViewApp* app, uint32_t short_pulse_dur); /* ui.c */ -int ui_get_current_subview(ProtoViewApp *app); -void ui_show_available_subviews(Canvas *canvas, ProtoViewApp *app, int last_subview); -bool ui_process_subview_updown(ProtoViewApp *app, InputEvent input, int last_subview); -void ui_show_keyboard(ProtoViewApp *app, char *buffer, uint32_t buflen, - void (*done_callback)(void*)); -void ui_dismiss_keyboard(ProtoViewApp *app); -void ui_show_alert(ProtoViewApp *app, const char *text, uint32_t ttl); -void ui_dismiss_alert(ProtoViewApp *app); -void ui_draw_alert_if_needed(Canvas *canvas, ProtoViewApp *app); -void canvas_draw_str_with_border(Canvas* canvas, uint8_t x, uint8_t y, const char* str, Color text_color, Color border_color); +int ui_get_current_subview(ProtoViewApp* app); +void ui_show_available_subviews(Canvas* canvas, ProtoViewApp* app, int last_subview); +bool ui_process_subview_updown(ProtoViewApp* app, InputEvent input, int last_subview); +void ui_show_keyboard( + ProtoViewApp* app, + char* buffer, + uint32_t buflen, + void (*done_callback)(void*)); +void ui_dismiss_keyboard(ProtoViewApp* app); +void ui_show_alert(ProtoViewApp* app, const char* text, uint32_t ttl); +void ui_dismiss_alert(ProtoViewApp* app); +void ui_draw_alert_if_needed(Canvas* canvas, ProtoViewApp* app); +void canvas_draw_str_with_border( + Canvas* canvas, + uint8_t x, + uint8_t y, + const char* str, + Color text_color, + Color border_color); /* fields.c */ -void fieldset_free(ProtoViewFieldSet *fs); -ProtoViewFieldSet *fieldset_new(void); -void fieldset_add_int(ProtoViewFieldSet *fs, const char *name, int64_t val, uint8_t bits); -void fieldset_add_uint(ProtoViewFieldSet *fs, const char *name, uint64_t uval, uint8_t bits); -void fieldset_add_hex(ProtoViewFieldSet *fs, const char *name, uint64_t uval, uint8_t bits); -void fieldset_add_bin(ProtoViewFieldSet *fs, const char *name, uint64_t uval, uint8_t bits); -void fieldset_add_str(ProtoViewFieldSet *fs, const char *name, const char *s); -void fieldset_add_bytes(ProtoViewFieldSet *fs, const char *name, const uint8_t *bytes, uint32_t count); -void fieldset_add_float(ProtoViewFieldSet *fs, const char *name, float val, uint32_t digits_after_dot); -const char *field_get_type_name(ProtoViewField *f); -int field_to_string(char *buf, size_t len, ProtoViewField *f); -bool field_set_from_string(ProtoViewField *f, char *buf, size_t len); -bool field_incr_value(ProtoViewField *f, int incr); -void fieldset_copy_matching_fields(ProtoViewFieldSet *dst, ProtoViewFieldSet *src); -void field_set_from_field(ProtoViewField *dst, ProtoViewField *src); +void fieldset_free(ProtoViewFieldSet* fs); +ProtoViewFieldSet* fieldset_new(void); +void fieldset_add_int(ProtoViewFieldSet* fs, const char* name, int64_t val, uint8_t bits); +void fieldset_add_uint(ProtoViewFieldSet* fs, const char* name, uint64_t uval, uint8_t bits); +void fieldset_add_hex(ProtoViewFieldSet* fs, const char* name, uint64_t uval, uint8_t bits); +void fieldset_add_bin(ProtoViewFieldSet* fs, const char* name, uint64_t uval, uint8_t bits); +void fieldset_add_str(ProtoViewFieldSet* fs, const char* name, const char* s); +void fieldset_add_bytes( + ProtoViewFieldSet* fs, + const char* name, + const uint8_t* bytes, + uint32_t count); +void fieldset_add_float( + ProtoViewFieldSet* fs, + const char* name, + float val, + uint32_t digits_after_dot); +const char* field_get_type_name(ProtoViewField* f); +int field_to_string(char* buf, size_t len, ProtoViewField* f); +bool field_set_from_string(ProtoViewField* f, char* buf, size_t len); +bool field_incr_value(ProtoViewField* f, int incr); +void fieldset_copy_matching_fields(ProtoViewFieldSet* dst, ProtoViewFieldSet* src); +void field_set_from_field(ProtoViewField* dst, ProtoViewField* src); /* crc.c */ -uint8_t crc8(const uint8_t *data, size_t len, uint8_t init, uint8_t poly); +uint8_t crc8(const uint8_t* data, size_t len, uint8_t init, uint8_t poly); diff --git a/applications/plugins/protoview/app_subghz.c b/applications/plugins/protoview/app_subghz.c index 55905e8a3..73e0e16ae 100644 --- a/applications/plugins/protoview/app_subghz.c +++ b/applications/plugins/protoview/app_subghz.c @@ -9,18 +9,20 @@ #include #include -void raw_sampling_worker_start(ProtoViewApp *app); -void raw_sampling_worker_stop(ProtoViewApp *app); +void raw_sampling_worker_start(ProtoViewApp* app); +void raw_sampling_worker_stop(ProtoViewApp* app); ProtoViewModulation ProtoViewModulations[] = { - {"OOK 650Khz", "FuriHalSubGhzPresetOok650Async", - FuriHalSubGhzPresetOok650Async, NULL}, - {"OOK 270Khz", "FuriHalSubGhzPresetOok270Async", - FuriHalSubGhzPresetOok270Async, NULL}, - {"2FSK 2.38Khz", "FuriHalSubGhzPreset2FSKDev238Async", - FuriHalSubGhzPreset2FSKDev238Async, NULL}, - {"2FSK 47.6Khz", "FuriHalSubGhzPreset2FSKDev476Async", - FuriHalSubGhzPreset2FSKDev476Async, NULL}, + {"OOK 650Khz", "FuriHalSubGhzPresetOok650Async", FuriHalSubGhzPresetOok650Async, NULL}, + {"OOK 270Khz", "FuriHalSubGhzPresetOok270Async", FuriHalSubGhzPresetOok270Async, NULL}, + {"2FSK 2.38Khz", + "FuriHalSubGhzPreset2FSKDev238Async", + FuriHalSubGhzPreset2FSKDev238Async, + NULL}, + {"2FSK 47.6Khz", + "FuriHalSubGhzPreset2FSKDev476Async", + FuriHalSubGhzPreset2FSKDev476Async, + NULL}, {"TPMS 1 (FSK)", NULL, 0, (uint8_t*)protoview_subghz_tpms1_fsk_async_regs}, {"TPMS 2 (OOK)", NULL, 0, (uint8_t*)protoview_subghz_tpms2_ook_async_regs}, {"TPMS 3 (FSK)", NULL, 0, (uint8_t*)protoview_subghz_tpms3_fsk_async_regs}, @@ -44,12 +46,10 @@ void radio_begin(ProtoViewApp* app) { /* The CC1101 preset can be either one of the standard presets, if * the modulation "custom" field is NULL, or a custom preset we * defined in custom_presets.h. */ - if (ProtoViewModulations[app->modulation].custom == NULL) { - furi_hal_subghz_load_preset( - ProtoViewModulations[app->modulation].preset); + if(ProtoViewModulations[app->modulation].custom == NULL) { + furi_hal_subghz_load_preset(ProtoViewModulations[app->modulation].preset); } else { - furi_hal_subghz_load_custom_preset( - ProtoViewModulations[app->modulation].custom); + furi_hal_subghz_load_custom_preset(ProtoViewModulations[app->modulation].custom); } furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow); app->txrx->txrx_state = TxRxStateIDLE; @@ -61,10 +61,10 @@ void radio_begin(ProtoViewApp* app) { uint32_t radio_rx(ProtoViewApp* app) { furi_assert(app); if(!furi_hal_subghz_is_frequency_valid(app->frequency)) { - furi_crash(TAG" Incorrect RX frequency."); + furi_crash(TAG " Incorrect RX frequency."); } - if (app->txrx->txrx_state == TxRxStateRx) return app->frequency; + if(app->txrx->txrx_state == TxRxStateRx) return app->frequency; furi_hal_subghz_idle(); /* Put it into idle state in case it is sleeping. */ uint32_t value = furi_hal_subghz_set_frequency_and_path(app->frequency); @@ -72,10 +72,8 @@ uint32_t radio_rx(ProtoViewApp* app) { furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow); furi_hal_subghz_flush_rx(); furi_hal_subghz_rx(); - if (!app->txrx->debug_timer_sampling) { - - furi_hal_subghz_start_async_rx(subghz_worker_rx_callback, - app->txrx->worker); + if(!app->txrx->debug_timer_sampling) { + furi_hal_subghz_start_async_rx(subghz_worker_rx_callback, app->txrx->worker); subghz_worker_start(app->txrx->worker); } else { raw_sampling_worker_start(app); @@ -88,8 +86,8 @@ uint32_t radio_rx(ProtoViewApp* app) { void radio_rx_end(ProtoViewApp* app) { furi_assert(app); - if (app->txrx->txrx_state == TxRxStateRx) { - if (!app->txrx->debug_timer_sampling) { + if(app->txrx->txrx_state == TxRxStateRx) { + if(!app->txrx->debug_timer_sampling) { if(subghz_worker_is_running(app->txrx->worker)) { subghz_worker_stop(app->txrx->worker); furi_hal_subghz_stop_async_rx(); @@ -105,7 +103,7 @@ void radio_rx_end(ProtoViewApp* app) { /* Put radio on sleep. */ void radio_sleep(ProtoViewApp* app) { furi_assert(app); - if (app->txrx->txrx_state == TxRxStateRx) { + if(app->txrx->txrx_state == TxRxStateRx) { /* We can't go from having an active RX worker to sleeping. * Stop the RX subsystems first. */ radio_rx_end(app); @@ -120,10 +118,10 @@ void radio_sleep(ProtoViewApp* app) { /* This function suspends the current RX state, switches to TX mode, * transmits the signal provided by the callback data_feeder, and later * restores the RX state if there was one. */ -void radio_tx_signal(ProtoViewApp *app, FuriHalSubGhzAsyncTxCallback data_feeder, void *ctx) { +void radio_tx_signal(ProtoViewApp* app, FuriHalSubGhzAsyncTxCallback data_feeder, void* ctx) { TxRxState oldstate = app->txrx->txrx_state; - if (oldstate == TxRxStateRx) radio_rx_end(app); + if(oldstate == TxRxStateRx) radio_rx_end(app); radio_begin(app); furi_hal_subghz_idle(); @@ -138,7 +136,7 @@ void radio_tx_signal(ProtoViewApp *app, FuriHalSubGhzAsyncTxCallback data_feeder furi_hal_subghz_idle(); radio_begin(app); - if (oldstate == TxRxStateRx) radio_rx(app); + if(oldstate == TxRxStateRx) radio_rx(app); } /* ============================= Raw sampling mode ============================= @@ -148,15 +146,15 @@ void radio_tx_signal(ProtoViewApp *app, FuriHalSubGhzAsyncTxCallback data_feeder * Flipper system. * ===========================================================================*/ -void protoview_timer_isr(void *ctx) { - ProtoViewApp *app = ctx; +void protoview_timer_isr(void* ctx) { + ProtoViewApp* app = ctx; bool level = furi_hal_gpio_read(&gpio_cc1101_g0); - if (app->txrx->last_g0_value != level) { + if(app->txrx->last_g0_value != level) { uint32_t now = DWT->CYCCNT; uint32_t dur = now - app->txrx->last_g0_change_time; dur /= furi_hal_cortex_instructions_per_microsecond(); - if (dur > 15000) dur = 15000; + if(dur > 15000) dur = 15000; raw_samples_add(RawSamples, app->txrx->last_g0_value, dur); app->txrx->last_g0_value = level; app->txrx->last_g0_change_time = now; @@ -164,13 +162,13 @@ void protoview_timer_isr(void *ctx) { LL_TIM_ClearFlag_UPDATE(TIM2); } -void raw_sampling_worker_start(ProtoViewApp *app) { +void raw_sampling_worker_start(ProtoViewApp* app) { UNUSED(app); LL_TIM_InitTypeDef tim_init = { - .Prescaler = 63, /* CPU frequency is ~64Mhz. */ + .Prescaler = 63, /* CPU frequency is ~64Mhz. */ .CounterMode = LL_TIM_COUNTERMODE_UP, - .Autoreload = 5, /* Sample every 5 us */ + .Autoreload = 5, /* Sample every 5 us */ }; LL_TIM_Init(TIM2, &tim_init); @@ -183,7 +181,7 @@ void raw_sampling_worker_start(ProtoViewApp *app) { FURI_LOG_E(TAG, "Timer enabled"); } -void raw_sampling_worker_stop(ProtoViewApp *app) { +void raw_sampling_worker_stop(ProtoViewApp* app) { UNUSED(app); FURI_CRITICAL_ENTER(); LL_TIM_DisableCounter(TIM2); diff --git a/applications/plugins/protoview/crc.c b/applications/plugins/protoview/crc.c index 38a809e10..94d482972 100644 --- a/applications/plugins/protoview/crc.c +++ b/applications/plugins/protoview/crc.c @@ -3,14 +3,13 @@ /* CRC8 with the specified initialization value 'init' and * polynomial 'poly'. */ -uint8_t crc8(const uint8_t *data, size_t len, uint8_t init, uint8_t poly) -{ +uint8_t crc8(const uint8_t* data, size_t len, uint8_t init, uint8_t poly) { uint8_t crc = init; size_t i, j; - for (i = 0; i < len; i++) { + for(i = 0; i < len; i++) { crc ^= data[i]; - for (j = 0; j < 8; j++) { - if ((crc & 0x80) != 0) + for(j = 0; j < 8; j++) { + if((crc & 0x80) != 0) crc = (uint8_t)((crc << 1) ^ poly); else crc <<= 1; diff --git a/applications/plugins/protoview/custom_presets.h b/applications/plugins/protoview/custom_presets.h index cb9a421c6..00aa49945 100644 --- a/applications/plugins/protoview/custom_presets.h +++ b/applications/plugins/protoview/custom_presets.h @@ -76,7 +76,8 @@ static uint8_t protoview_subghz_tpms1_fsk_async_regs[][2] = { // // Modem Configuration {CC1101_MDMCFG0, 0x00}, {CC1101_MDMCFG1, 0x02}, - {CC1101_MDMCFG2, 0x04}, // Format 2-FSK/FM, No preamble/sync, Disable (current optimized). Other code reading TPMS uses GFSK, but should be the same when in RX mode. + {CC1101_MDMCFG2, + 0x04}, // Format 2-FSK/FM, No preamble/sync, Disable (current optimized). Other code reading TPMS uses GFSK, but should be the same when in RX mode. {CC1101_MDMCFG3, 0x93}, // Data rate is 20kBaud {CC1101_MDMCFG4, 0x59}, // Rx bandwidth filter is 325 kHz {CC1101_DEVIATN, 0x41}, // Deviation 28.56 kHz @@ -106,8 +107,10 @@ static uint8_t protoview_subghz_tpms1_fsk_async_regs[][2] = { {0, 0}, /* CC1101 2FSK PATABLE. */ - {0xC0, 0}, {0,0}, {0,0}, {0,0} -}; + {0xC0, 0}, + {0, 0}, + {0, 0}, + {0, 0}}; /* This is like the default Flipper OOK 640Khz bandwidth preset, but * the bandwidth is changed to 10kBaud to accomodate TPMS frequency. */ @@ -156,8 +159,10 @@ static const uint8_t protoview_subghz_tpms2_ook_async_regs[][2] = { {0, 0}, /* CC1101 OOK PATABLE. */ - {0, 0xC0}, {0,0}, {0,0}, {0,0} -}; + {0, 0xC0}, + {0, 0}, + {0, 0}, + {0, 0}}; /* 40 KBaud, 2FSK, 28 kHz deviation, 270 Khz bandwidth filter. */ static uint8_t protoview_subghz_tpms3_fsk_async_regs[][2] = { @@ -174,7 +179,8 @@ static uint8_t protoview_subghz_tpms3_fsk_async_regs[][2] = { // // Modem Configuration {CC1101_MDMCFG0, 0x00}, {CC1101_MDMCFG1, 0x02}, - {CC1101_MDMCFG2, 0x04}, // Format 2-FSK/FM, No preamble/sync, Disable (current optimized). Other code reading TPMS uses GFSK, but should be the same when in RX mode. + {CC1101_MDMCFG2, + 0x04}, // Format 2-FSK/FM, No preamble/sync, Disable (current optimized). Other code reading TPMS uses GFSK, but should be the same when in RX mode. {CC1101_MDMCFG3, 0x93}, // Data rate is 40kBaud {CC1101_MDMCFG4, 0x6A}, // 6 = BW filter 270kHz, A = Data rate exp {CC1101_DEVIATN, 0x41}, // Deviation 28kHz @@ -204,8 +210,10 @@ static uint8_t protoview_subghz_tpms3_fsk_async_regs[][2] = { {0, 0}, /* CC1101 2FSK PATABLE. */ - {0xC0, 0}, {0,0}, {0,0}, {0,0} -}; + {0xC0, 0}, + {0, 0}, + {0, 0}, + {0, 0}}; /* FSK 19k dev, 325 Khz filter, 20kBaud. Works well with Toyota. */ static uint8_t protoview_subghz_tpms4_fsk_async_regs[][2] = { @@ -250,6 +258,7 @@ static uint8_t protoview_subghz_tpms4_fsk_async_regs[][2] = { {0, 0}, /* CC1101 2FSK PATABLE. */ - {0xC0, 0}, {0,0}, {0,0}, {0,0} -}; - + {0xC0, 0}, + {0, 0}, + {0, 0}, + {0, 0}}; diff --git a/applications/plugins/protoview/data_feed.c b/applications/plugins/protoview/data_feed.c index a3bed238e..81d1a8020 100644 --- a/applications/plugins/protoview/data_feed.c +++ b/applications/plugins/protoview/data_feed.c @@ -14,7 +14,7 @@ const SubGhzProtocol subghz_protocol_protoview; /* The feed() method puts data in the RawSamples global (protected by * a mutex). */ -extern RawSamplesBuffer *RawSamples; +extern RawSamplesBuffer* RawSamples; /* This is totally dummy: we just define the decoder base for the async * system to work but we don't really use it if not to collect raw @@ -26,8 +26,7 @@ typedef struct SubGhzProtocolDecoderprotoview { void* subghz_protocol_decoder_protoview_alloc(SubGhzEnvironment* environment) { UNUSED(environment); - SubGhzProtocolDecoderprotoview* instance = - malloc(sizeof(SubGhzProtocolDecoderprotoview)); + SubGhzProtocolDecoderprotoview* instance = malloc(sizeof(SubGhzProtocolDecoderprotoview)); instance->base.protocol = &subghz_protocol_protoview; return instance; } @@ -66,8 +65,7 @@ uint8_t subghz_protocol_decoder_protoview_get_hash_data(void* context) { bool subghz_protocol_decoder_protoview_serialize( void* context, FlipperFormat* flipper_format, - SubGhzRadioPreset* preset) -{ + SubGhzRadioPreset* preset) { UNUSED(context); UNUSED(flipper_format); UNUSED(preset); @@ -75,15 +73,13 @@ bool subghz_protocol_decoder_protoview_serialize( } /* Not used. */ -bool subghz_protocol_decoder_protoview_deserialize(void* context, FlipperFormat* flipper_format) -{ +bool subghz_protocol_decoder_protoview_deserialize(void* context, FlipperFormat* flipper_format) { UNUSED(context); UNUSED(flipper_format); return false; } -void subhz_protocol_decoder_protoview_get_string(void* context, FuriString* output) -{ +void subhz_protocol_decoder_protoview_get_string(void* context, FuriString* output) { furi_assert(context); furi_string_cat_printf(output, "Protoview"); } @@ -116,5 +112,4 @@ const SubGhzProtocol* protoview_protocol_registry_items[] = { const SubGhzProtocolRegistry protoview_protocol_registry = { .items = protoview_protocol_registry_items, - .size = COUNT_OF(protoview_protocol_registry_items) -}; + .size = COUNT_OF(protoview_protocol_registry_items)}; diff --git a/applications/plugins/protoview/fields.c b/applications/plugins/protoview/fields.c index bc62cda54..47d573f4f 100644 --- a/applications/plugins/protoview/fields.c +++ b/applications/plugins/protoview/fields.c @@ -7,8 +7,8 @@ /* Create a new field of the specified type. Without populating its * type-specific value. */ -static ProtoViewField *field_new(ProtoViewFieldType type, const char *name) { - ProtoViewField *f = malloc(sizeof(*f)); +static ProtoViewField* field_new(ProtoViewFieldType type, const char* name) { + ProtoViewField* f = malloc(sizeof(*f)); f->type = type; f->name = strdup(name); return f; @@ -16,72 +16,80 @@ static ProtoViewField *field_new(ProtoViewFieldType type, const char *name) { /* Free only the auxiliary data of a field, used to represent the * current type. Name and type are not touched. */ -static void field_free_aux_data(ProtoViewField *f) { +static void field_free_aux_data(ProtoViewField* f) { switch(f->type) { - case FieldTypeStr: free(f->str); break; - case FieldTypeBytes: free(f->bytes); break; - default: break; // Nothing to free for other types. + case FieldTypeStr: + free(f->str); + break; + case FieldTypeBytes: + free(f->bytes); + break; + default: + break; // Nothing to free for other types. } } /* Free a field an associated data. */ -static void field_free(ProtoViewField *f) { +static void field_free(ProtoViewField* f) { field_free_aux_data(f); free(f->name); free(f); } /* Return the type of the field as string. */ -const char *field_get_type_name(ProtoViewField *f) { +const char* field_get_type_name(ProtoViewField* f) { switch(f->type) { - case FieldTypeStr: return "str"; - case FieldTypeSignedInt: return "int"; - case FieldTypeUnsignedInt: return "uint"; - case FieldTypeBinary: return "bin"; - case FieldTypeHex: return "hex"; - case FieldTypeBytes: return "bytes"; - case FieldTypeFloat: return "float"; + case FieldTypeStr: + return "str"; + case FieldTypeSignedInt: + return "int"; + case FieldTypeUnsignedInt: + return "uint"; + case FieldTypeBinary: + return "bin"; + case FieldTypeHex: + return "hex"; + case FieldTypeBytes: + return "bytes"; + case FieldTypeFloat: + return "float"; } return "unknown"; } /* Set a string representation of the specified field in buf. */ -int field_to_string(char *buf, size_t len, ProtoViewField *f) { +int field_to_string(char* buf, size_t len, ProtoViewField* f) { switch(f->type) { case FieldTypeStr: - return snprintf(buf,len,"%s", f->str); + return snprintf(buf, len, "%s", f->str); case FieldTypeSignedInt: - return snprintf(buf,len,"%lld", (long long) f->value); + return snprintf(buf, len, "%lld", (long long)f->value); case FieldTypeUnsignedInt: - return snprintf(buf,len,"%llu", (unsigned long long) f->uvalue); - case FieldTypeBinary: - { - uint64_t test_bit = (1 << (f->len-1)); - uint64_t idx = 0; - while(idx < len-1 && test_bit) { - buf[idx++] = (f->uvalue & test_bit) ? '1' : '0'; - test_bit >>= 1; - } - buf[idx] = 0; - return idx; + return snprintf(buf, len, "%llu", (unsigned long long)f->uvalue); + case FieldTypeBinary: { + uint64_t test_bit = (1 << (f->len - 1)); + uint64_t idx = 0; + while(idx < len - 1 && test_bit) { + buf[idx++] = (f->uvalue & test_bit) ? '1' : '0'; + test_bit >>= 1; } + buf[idx] = 0; + return idx; + } case FieldTypeHex: - return snprintf(buf, len, "%*llX", (int)(f->len+7)/8, f->uvalue); + return snprintf(buf, len, "%*llX", (int)(f->len + 7) / 8, f->uvalue); case FieldTypeFloat: return snprintf(buf, len, "%.*f", (int)f->len, (double)f->fvalue); - case FieldTypeBytes: - { - uint64_t idx = 0; - while(idx < len-1 && idx < f->len) { - const char *charset = "0123456789ABCDEF"; - uint32_t nibble = idx & 1 ? - (f->bytes[idx/2] & 0xf) : - (f->bytes[idx/2] >> 4); - buf[idx++] = charset[nibble]; - } - buf[idx] = 0; - return idx; + case FieldTypeBytes: { + uint64_t idx = 0; + while(idx < len - 1 && idx < f->len) { + const char* charset = "0123456789ABCDEF"; + uint32_t nibble = idx & 1 ? (f->bytes[idx / 2] & 0xf) : (f->bytes[idx / 2] >> 4); + buf[idx++] = charset[nibble]; } + buf[idx] = 0; + return idx; + } } return 0; } @@ -96,7 +104,7 @@ int field_to_string(char *buf, size_t len, ProtoViewField *f) { * The function returns true if the filed was successfully set to the * new value, otherwise if the specified value is invalid for the * field type, false is returned. */ -bool field_set_from_string(ProtoViewField *f, char *buf, size_t len) { +bool field_set_from_string(ProtoViewField* f, char* buf, size_t len) { // Initialize values to zero since the Flipper sscanf() implementation // is fuzzy... may populate only part of the value. long long val = 0; @@ -107,80 +115,78 @@ bool field_set_from_string(ProtoViewField *f, char *buf, size_t len) { case FieldTypeStr: free(f->str); f->len = len; - f->str = malloc(len+1); - memcpy(f->str,buf,len+1); + f->str = malloc(len + 1); + memcpy(f->str, buf, len + 1); break; case FieldTypeSignedInt: - if (!sscanf(buf,"%lld",&val)) return false; + if(!sscanf(buf, "%lld", &val)) return false; f->value = val; break; case FieldTypeUnsignedInt: - if (!sscanf(buf,"%llu",&uval)) return false; + if(!sscanf(buf, "%llu", &uval)) return false; f->uvalue = uval; break; - case FieldTypeBinary: - { - uint64_t bit_to_set = (1 << (len-1)); - uint64_t idx = 0; - uval = 0; - while(buf[idx]) { - if (buf[idx] == '1') uval |= bit_to_set; - else if (buf[idx] != '0') return false; - bit_to_set >>= 1; - idx++; - } - f->uvalue = uval; + case FieldTypeBinary: { + uint64_t bit_to_set = (1 << (len - 1)); + uint64_t idx = 0; + uval = 0; + while(buf[idx]) { + if(buf[idx] == '1') + uval |= bit_to_set; + else if(buf[idx] != '0') + return false; + bit_to_set >>= 1; + idx++; } - break; + f->uvalue = uval; + } break; case FieldTypeHex: - if (!sscanf(buf,"%llx",&uval) && - !sscanf(buf,"%llX",&uval)) return false; + if(!sscanf(buf, "%llx", &uval) && !sscanf(buf, "%llX", &uval)) return false; f->uvalue = uval; break; case FieldTypeFloat: - if (!sscanf(buf,"%f",&fval)) return false; + if(!sscanf(buf, "%f", &fval)) return false; f->fvalue = fval; break; - case FieldTypeBytes: - { - if (len > f->len) return false; - uint64_t idx = 0; - while(buf[idx]) { - uint8_t nibble = 0; - char c = toupper(buf[idx]); - if (c >= '0' && c <= '9') nibble = c-'0'; - else if (c >= 'A' && c <= 'F') nibble = 10+(c-'A'); - else return false; + case FieldTypeBytes: { + if(len > f->len) return false; + uint64_t idx = 0; + while(buf[idx]) { + uint8_t nibble = 0; + char c = toupper(buf[idx]); + if(c >= '0' && c <= '9') + nibble = c - '0'; + else if(c >= 'A' && c <= 'F') + nibble = 10 + (c - 'A'); + else + return false; - if (idx & 1) { - f->bytes[idx/2] = - (f->bytes[idx/2] & 0xF0) | nibble; - } else { - f->bytes[idx/2] = - (f->bytes[idx/2] & 0x0F) | (nibble<<4); - } - idx++; + if(idx & 1) { + f->bytes[idx / 2] = (f->bytes[idx / 2] & 0xF0) | nibble; + } else { + f->bytes[idx / 2] = (f->bytes[idx / 2] & 0x0F) | (nibble << 4); } - buf[idx] = 0; + idx++; } - break; + buf[idx] = 0; + } break; } return true; } /* Set the 'dst' field to contain a copy of the value of the 'src' * field. The field name is not modified. */ -void field_set_from_field(ProtoViewField *dst, ProtoViewField *src) { +void field_set_from_field(ProtoViewField* dst, ProtoViewField* src) { field_free_aux_data(dst); dst->type = src->type; dst->len = src->len; - switch(src->type) { + switch(src->type) { case FieldTypeStr: dst->str = strdup(src->str); break; case FieldTypeBytes: dst->bytes = malloc(src->len); - memcpy(dst->bytes,src->bytes,dst->len); + memcpy(dst->bytes, src->bytes, dst->len); break; case FieldTypeSignedInt: dst->value = src->value; @@ -199,159 +205,159 @@ void field_set_from_field(ProtoViewField *dst, ProtoViewField *src) { /* Increment the specified field value of 'incr'. If the field type * does not support increments false is returned, otherwise the * action is performed. */ -bool field_incr_value(ProtoViewField *f, int incr) { +bool field_incr_value(ProtoViewField* f, int incr) { switch(f->type) { - case FieldTypeStr: return false; - case FieldTypeSignedInt: { - /* Wrap around depending on the number of bits (f->len) + case FieldTypeStr: + return false; + case FieldTypeSignedInt: { + /* Wrap around depending on the number of bits (f->len) * the integer was declared to have. */ - int64_t max = (1ULL << (f->len-1))-1; - int64_t min = -max-1; - int64_t v = (int64_t)f->value + incr; - if (v > max) v = min+(v-max-1); - if (v < min) v = max+(v-min+1); - f->value = v; - break; - } - case FieldTypeBinary: - case FieldTypeHex: - case FieldTypeUnsignedInt: { - /* Wrap around like for the unsigned case, but here + int64_t max = (1ULL << (f->len - 1)) - 1; + int64_t min = -max - 1; + int64_t v = (int64_t)f->value + incr; + if(v > max) v = min + (v - max - 1); + if(v < min) v = max + (v - min + 1); + f->value = v; + break; + } + case FieldTypeBinary: + case FieldTypeHex: + case FieldTypeUnsignedInt: { + /* Wrap around like for the unsigned case, but here * is simpler. */ - uint64_t max = (1ULL << f->len)-1; // Broken for 64 bits. - uint64_t uv = (uint64_t)f->value + incr; - if (uv > max) uv = uv & max; - f->uvalue = uv; - break; - } - case FieldTypeFloat: - f->fvalue += incr; - break; - case FieldTypeBytes: { - // For bytes we only support single unit increments. - if (incr != -1 && incr != 1) return false; - for (int j = f->len-1; j >= 0; j--) { - uint8_t nibble = (j&1) ? (f->bytes[j/2] & 0x0F) : - ((f->bytes[j/2] & 0xF0) >> 4); + uint64_t max = (1ULL << f->len) - 1; // Broken for 64 bits. + uint64_t uv = (uint64_t)f->value + incr; + if(uv > max) uv = uv & max; + f->uvalue = uv; + break; + } + case FieldTypeFloat: + f->fvalue += incr; + break; + case FieldTypeBytes: { + // For bytes we only support single unit increments. + if(incr != -1 && incr != 1) return false; + for(int j = f->len - 1; j >= 0; j--) { + uint8_t nibble = (j & 1) ? (f->bytes[j / 2] & 0x0F) : ((f->bytes[j / 2] & 0xF0) >> 4); - nibble += incr; - nibble &= 0x0F; + nibble += incr; + nibble &= 0x0F; - f->bytes[j/2] = (j&1) ? ((f->bytes[j/2] & 0xF0) | nibble) : - ((f->bytes[j/2] & 0x0F) | (nibble<<4)); + f->bytes[j / 2] = (j & 1) ? ((f->bytes[j / 2] & 0xF0) | nibble) : + ((f->bytes[j / 2] & 0x0F) | (nibble << 4)); - /* Propagate the operation on overflow of this nibble. */ - if ((incr == 1 && nibble == 0) || - (incr == -1 && nibble == 0xf)) - { - continue; - } - break; // Otherwise stop the loop here. + /* Propagate the operation on overflow of this nibble. */ + if((incr == 1 && nibble == 0) || (incr == -1 && nibble == 0xf)) { + continue; } - break; + break; // Otherwise stop the loop here. } + break; + } } return true; } - /* Free a field set and its contained fields. */ -void fieldset_free(ProtoViewFieldSet *fs) { - for (uint32_t j = 0; j < fs->numfields; j++) - field_free(fs->fields[j]); +void fieldset_free(ProtoViewFieldSet* fs) { + for(uint32_t j = 0; j < fs->numfields; j++) field_free(fs->fields[j]); free(fs->fields); free(fs); } /* Allocate and init an empty field set. */ -ProtoViewFieldSet *fieldset_new(void) { - ProtoViewFieldSet *fs = malloc(sizeof(*fs)); +ProtoViewFieldSet* fieldset_new(void) { + ProtoViewFieldSet* fs = malloc(sizeof(*fs)); fs->numfields = 0; fs->fields = NULL; return fs; } /* Append an already allocated field at the end of the specified field set. */ -static void fieldset_add_field(ProtoViewFieldSet *fs, ProtoViewField *field) { +static void fieldset_add_field(ProtoViewFieldSet* fs, ProtoViewField* field) { fs->numfields++; - fs->fields = realloc(fs->fields,sizeof(ProtoViewField*)*fs->numfields); - fs->fields[fs->numfields-1] = field; + fs->fields = realloc(fs->fields, sizeof(ProtoViewField*) * fs->numfields); + fs->fields[fs->numfields - 1] = field; } /* Allocate and append an integer field. */ -void fieldset_add_int(ProtoViewFieldSet *fs, const char *name, int64_t val, uint8_t bits) { - ProtoViewField *f = field_new(FieldTypeSignedInt,name); +void fieldset_add_int(ProtoViewFieldSet* fs, const char* name, int64_t val, uint8_t bits) { + ProtoViewField* f = field_new(FieldTypeSignedInt, name); f->value = val; f->len = bits; - fieldset_add_field(fs,f); + fieldset_add_field(fs, f); } /* Allocate and append an unsigned field. */ -void fieldset_add_uint(ProtoViewFieldSet *fs, const char *name, uint64_t uval, uint8_t bits) { - ProtoViewField *f = field_new(FieldTypeUnsignedInt,name); +void fieldset_add_uint(ProtoViewFieldSet* fs, const char* name, uint64_t uval, uint8_t bits) { + ProtoViewField* f = field_new(FieldTypeUnsignedInt, name); f->uvalue = uval; f->len = bits; - fieldset_add_field(fs,f); + fieldset_add_field(fs, f); } /* Allocate and append a hex field. This is an unsigned number but * with an hex representation. */ -void fieldset_add_hex(ProtoViewFieldSet *fs, const char *name, uint64_t uval, uint8_t bits) { - ProtoViewField *f = field_new(FieldTypeHex,name); +void fieldset_add_hex(ProtoViewFieldSet* fs, const char* name, uint64_t uval, uint8_t bits) { + ProtoViewField* f = field_new(FieldTypeHex, name); f->uvalue = uval; f->len = bits; - fieldset_add_field(fs,f); + fieldset_add_field(fs, f); } /* Allocate and append a bin field. This is an unsigned number but * with a binary representation. */ -void fieldset_add_bin(ProtoViewFieldSet *fs, const char *name, uint64_t uval, uint8_t bits) { - ProtoViewField *f = field_new(FieldTypeBinary,name); +void fieldset_add_bin(ProtoViewFieldSet* fs, const char* name, uint64_t uval, uint8_t bits) { + ProtoViewField* f = field_new(FieldTypeBinary, name); f->uvalue = uval; f->len = bits; - fieldset_add_field(fs,f); + fieldset_add_field(fs, f); } /* Allocate and append a string field. */ -void fieldset_add_str(ProtoViewFieldSet *fs, const char *name, const char *s) { - ProtoViewField *f = field_new(FieldTypeStr,name); +void fieldset_add_str(ProtoViewFieldSet* fs, const char* name, const char* s) { + ProtoViewField* f = field_new(FieldTypeStr, name); f->str = strdup(s); f->len = strlen(s); - fieldset_add_field(fs,f); + fieldset_add_field(fs, f); } /* Allocate and append a bytes field. Note that 'count' is specified in * nibbles (bytes*2). */ -void fieldset_add_bytes(ProtoViewFieldSet *fs, const char *name, const uint8_t *bytes, uint32_t count_nibbles) { - uint32_t numbytes = (count_nibbles+count_nibbles%2)/2; - ProtoViewField *f = field_new(FieldTypeBytes,name); +void fieldset_add_bytes( + ProtoViewFieldSet* fs, + const char* name, + const uint8_t* bytes, + uint32_t count_nibbles) { + uint32_t numbytes = (count_nibbles + count_nibbles % 2) / 2; + ProtoViewField* f = field_new(FieldTypeBytes, name); f->bytes = malloc(numbytes); - memcpy(f->bytes,bytes,numbytes); + memcpy(f->bytes, bytes, numbytes); f->len = count_nibbles; - fieldset_add_field(fs,f); + fieldset_add_field(fs, f); } /* Allocate and append a float field. */ -void fieldset_add_float(ProtoViewFieldSet *fs, const char *name, float val, uint32_t digits_after_dot) { - ProtoViewField *f = field_new(FieldTypeFloat,name); +void fieldset_add_float( + ProtoViewFieldSet* fs, + const char* name, + float val, + uint32_t digits_after_dot) { + ProtoViewField* f = field_new(FieldTypeFloat, name); f->fvalue = val; f->len = digits_after_dot; - fieldset_add_field(fs,f); + fieldset_add_field(fs, f); } /* For each field of the destination filedset 'dst', look for a matching * field name/type in the source fieldset 'src', and if one is found copy * its value into the 'dst' field. */ -void fieldset_copy_matching_fields(ProtoViewFieldSet *dst, - ProtoViewFieldSet *src) -{ - for (uint32_t j = 0; j < dst->numfields; j++) { - for (uint32_t i = 0; i < src->numfields; i++) { - if (dst->fields[j]->type == src->fields[i]->type && - !strcmp(dst->fields[j]->name,src->fields[i]->name)) - { - field_set_from_field(dst->fields[j], - src->fields[i]); +void fieldset_copy_matching_fields(ProtoViewFieldSet* dst, ProtoViewFieldSet* src) { + for(uint32_t j = 0; j < dst->numfields; j++) { + for(uint32_t i = 0; i < src->numfields; i++) { + if(dst->fields[j]->type == src->fields[i]->type && + !strcmp(dst->fields[j]->name, src->fields[i]->name)) { + field_set_from_field(dst->fields[j], src->fields[i]); } } } diff --git a/applications/plugins/protoview/protocols/b4b1.c b/applications/plugins/protoview/protocols/b4b1.c index 7308d1211..52c59d24b 100644 --- a/applications/plugins/protoview/protocols/b4b1.c +++ b/applications/plugins/protoview/protocols/b4b1.c @@ -9,9 +9,9 @@ #include "../app.h" -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { - if (numbits < 30) return false; - const char *sync_patterns[3] = { +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { + if(numbits < 30) return false; + const char* sync_patterns[3] = { "10000000000000000000000000000001", /* 30 zero bits. */ "100000000000000000000000000000001", /* 31 zero bits. */ "1000000000000000000000000000000001", /* 32 zero bits. */ @@ -19,70 +19,67 @@ static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoView uint32_t off; int j; - for (j = 0; j < 3; j++) { - off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_patterns[j]); - if (off != BITMAP_SEEK_NOT_FOUND) break; + for(j = 0; j < 3; j++) { + off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_patterns[j]); + if(off != BITMAP_SEEK_NOT_FOUND) break; } - if (off == BITMAP_SEEK_NOT_FOUND) return false; - if (DEBUG_MSG) FURI_LOG_E(TAG, "B4B1 preamble at: %lu",off); + if(off == BITMAP_SEEK_NOT_FOUND) return false; + if(DEBUG_MSG) FURI_LOG_E(TAG, "B4B1 preamble at: %lu", off); info->start_off = off; // Seek data setction. Why -1? Last bit is data. - off += strlen(sync_patterns[j])-1; + off += strlen(sync_patterns[j]) - 1; uint8_t d[3]; /* 24 bits of data. */ - uint32_t decoded = - convert_from_line_code(d,sizeof(d),bits,numbytes,off,"1000","1110"); + uint32_t decoded = convert_from_line_code(d, sizeof(d), bits, numbytes, off, "1000", "1110"); - if (DEBUG_MSG) FURI_LOG_E(TAG, "B4B1 decoded: %lu",decoded); - if (decoded < 24) return false; + if(DEBUG_MSG) FURI_LOG_E(TAG, "B4B1 decoded: %lu", decoded); + if(decoded < 24) return false; - off += 24*4; // seek to end symbol offset to calculate the length. + off += 24 * 4; // seek to end symbol offset to calculate the length. off++; // In this protocol there is a final pulse as terminator. info->pulses_count = off - info->start_off; - fieldset_add_bytes(info->fieldset,"id",d,5); - fieldset_add_uint(info->fieldset,"button",d[2]&0xf,4); + fieldset_add_bytes(info->fieldset, "id", d, 5); + fieldset_add_uint(info->fieldset, "button", d[2] & 0xf, 4); return true; } /* Give fields and defaults for the signal creator. */ -static void get_fields(ProtoViewFieldSet *fieldset) { - uint8_t default_id[3]= {0xAB, 0xCD, 0xE0}; - fieldset_add_bytes(fieldset,"id",default_id,5); - fieldset_add_uint(fieldset,"button",1,4); +static void get_fields(ProtoViewFieldSet* fieldset) { + uint8_t default_id[3] = {0xAB, 0xCD, 0xE0}; + fieldset_add_bytes(fieldset, "id", default_id, 5); + fieldset_add_uint(fieldset, "button", 1, 4); } /* Create a signal. */ -static void build_message(RawSamplesBuffer *samples, ProtoViewFieldSet *fs) -{ +static void build_message(RawSamplesBuffer* samples, ProtoViewFieldSet* fs) { uint32_t te = 334; // Short pulse duration in microseconds. // Sync: 1 te pulse, 31 te gap. - raw_samples_add(samples,true,te); - raw_samples_add(samples,false,te*31); + raw_samples_add(samples, true, te); + raw_samples_add(samples, false, te * 31); // ID + button state uint8_t data[3]; - memcpy(data,fs->fields[0]->bytes,3); - data[2] = (data[2]&0xF0) | (fs->fields[1]->uvalue & 0xF); - for (uint32_t j = 0; j < 24; j++) { - if (bitmap_get(data,sizeof(data),j)) { - raw_samples_add(samples,true,te*3); - raw_samples_add(samples,false,te); + memcpy(data, fs->fields[0]->bytes, 3); + data[2] = (data[2] & 0xF0) | (fs->fields[1]->uvalue & 0xF); + for(uint32_t j = 0; j < 24; j++) { + if(bitmap_get(data, sizeof(data), j)) { + raw_samples_add(samples, true, te * 3); + raw_samples_add(samples, false, te); } else { - raw_samples_add(samples,true,te); - raw_samples_add(samples,false,te*3); + raw_samples_add(samples, true, te); + raw_samples_add(samples, false, te * 3); } } // Signal terminator. Just a single short pulse. - raw_samples_add(samples,true,te); + raw_samples_add(samples, true, te); } ProtoViewDecoder B4B1Decoder = { .name = "PT/SC remote", .decode = decode, .get_fields = get_fields, - .build_message = build_message -}; + .build_message = build_message}; diff --git a/applications/plugins/protoview/protocols/keeloq.c b/applications/plugins/protoview/protocols/keeloq.c index 0741eac47..298c690d4 100644 --- a/applications/plugins/protoview/protocols/keeloq.c +++ b/applications/plugins/protoview/protocols/keeloq.c @@ -24,16 +24,16 @@ #include "../app.h" -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { - +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { /* In the sync pattern, we require the 12 high/low pulses and at least * half the gap we expect (5 pulses times, one is the final zero in the * 24 symbols high/low sequence, then other 4). */ - const char *sync_pattern = "101010101010101010101010" "0000"; - uint8_t sync_len = 24+4; - if (numbits-sync_len+sync_len < 3*66) return false; - uint32_t off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_pattern); - if (off == BITMAP_SEEK_NOT_FOUND) return false; + const char* sync_pattern = "101010101010101010101010" + "0000"; + uint8_t sync_len = 24 + 4; + if(numbits - sync_len + sync_len < 3 * 66) return false; + uint32_t off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_pattern); + if(off == BITMAP_SEEK_NOT_FOUND) return false; info->start_off = off; off += sync_len; // Seek start of message. @@ -42,84 +42,77 @@ static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoView * symbols of gap, to avoid missing the signal for a matter of wrong * timing. */ uint8_t gap_len = 0; - while(gap_len <= 7 && bitmap_get(bits,numbytes,off+gap_len) == 0) - gap_len++; - if (gap_len < 3 || gap_len > 7) return false; + while(gap_len <= 7 && bitmap_get(bits, numbytes, off + gap_len) == 0) gap_len++; + if(gap_len < 3 || gap_len > 7) return false; off += gap_len; FURI_LOG_E(TAG, "Keeloq preamble+sync found"); uint8_t raw[9] = {0}; - uint32_t decoded = - convert_from_line_code(raw,sizeof(raw),bits,numbytes,off, - "110","100"); /* Pulse width modulation. */ + uint32_t decoded = convert_from_line_code( + raw, sizeof(raw), bits, numbytes, off, "110", "100"); /* Pulse width modulation. */ FURI_LOG_E(TAG, "Keeloq decoded bits: %lu", decoded); - if (decoded < 66) return false; /* Require the full 66 bits. */ + if(decoded < 66) return false; /* Require the full 66 bits. */ - info->pulses_count = (off+66*3) - info->start_off; + info->pulses_count = (off + 66 * 3) - info->start_off; - bitmap_reverse_bytes_bits(raw,sizeof(raw)); /* Keeloq is LSB first. */ + bitmap_reverse_bytes_bits(raw, sizeof(raw)); /* Keeloq is LSB first. */ - int buttons = raw[7]>>4; - int lowbat = (raw[8]&0x1) == 0; // Actual bit meaning: good battery level - int alwaysone = (raw[8]&0x2) != 0; + int buttons = raw[7] >> 4; + int lowbat = (raw[8] & 0x1) == 0; // Actual bit meaning: good battery level + int alwaysone = (raw[8] & 0x2) != 0; - fieldset_add_bytes(info->fieldset,"encr",raw,8); - raw[7] = raw[7]<<4; // Make ID bits contiguous - fieldset_add_bytes(info->fieldset,"id",raw+4,7); // 28 bits, 7 nibbles - fieldset_add_bin(info->fieldset,"s[2,1,0,3]",buttons,4); - fieldset_add_bin(info->fieldset,"low battery",lowbat,1); - fieldset_add_bin(info->fieldset,"always one",alwaysone,1); + fieldset_add_bytes(info->fieldset, "encr", raw, 8); + raw[7] = raw[7] << 4; // Make ID bits contiguous + fieldset_add_bytes(info->fieldset, "id", raw + 4, 7); // 28 bits, 7 nibbles + fieldset_add_bin(info->fieldset, "s[2,1,0,3]", buttons, 4); + fieldset_add_bin(info->fieldset, "low battery", lowbat, 1); + fieldset_add_bin(info->fieldset, "always one", alwaysone, 1); return true; } -static void get_fields(ProtoViewFieldSet *fieldset) { +static void get_fields(ProtoViewFieldSet* fieldset) { uint8_t remote_id[4] = {0xab, 0xcd, 0xef, 0xa0}; uint8_t encr[4] = {0xab, 0xab, 0xab, 0xab}; - fieldset_add_bytes(fieldset,"encr",encr,8); - fieldset_add_bytes(fieldset,"id",remote_id,7); - fieldset_add_bin(fieldset,"s[2,1,0,3]",2,4); - fieldset_add_bin(fieldset,"low battery",0,1); - fieldset_add_bin(fieldset,"always one",1,1); + fieldset_add_bytes(fieldset, "encr", encr, 8); + fieldset_add_bytes(fieldset, "id", remote_id, 7); + fieldset_add_bin(fieldset, "s[2,1,0,3]", 2, 4); + fieldset_add_bin(fieldset, "low battery", 0, 1); + fieldset_add_bin(fieldset, "always one", 1, 1); } -static void build_message(RawSamplesBuffer *samples, ProtoViewFieldSet *fieldset) -{ +static void build_message(RawSamplesBuffer* samples, ProtoViewFieldSet* fieldset) { uint32_t te = 380; // Short pulse duration in microseconds. // Sync: 12 pairs of pulse/gap + 9 times gap - for (int j = 0; j < 12; j++) { - raw_samples_add(samples,true,te); - raw_samples_add(samples,false,te); + for(int j = 0; j < 12; j++) { + raw_samples_add(samples, true, te); + raw_samples_add(samples, false, te); } - raw_samples_add(samples,false,te*9); + raw_samples_add(samples, false, te * 9); // Data, 66 bits. uint8_t data[9] = {0}; - memcpy(data,fieldset->fields[0]->bytes,4); // Encrypted part. - memcpy(data+4,fieldset->fields[1]->bytes,4); // ID. - data[7] = data[7]>>4 | fieldset->fields[2]->uvalue << 4; // s[2,1,0,3] + memcpy(data, fieldset->fields[0]->bytes, 4); // Encrypted part. + memcpy(data + 4, fieldset->fields[1]->bytes, 4); // ID. + data[7] = data[7] >> 4 | fieldset->fields[2]->uvalue << 4; // s[2,1,0,3] int low_battery = fieldset->fields[3] != 0; int always_one = fieldset->fields[4] != 0; low_battery = !low_battery; // Bit real meaning is good battery level. data[8] |= low_battery; data[8] |= (always_one << 1); - bitmap_reverse_bytes_bits(data,sizeof(data)); /* Keeloq is LSB first. */ + bitmap_reverse_bytes_bits(data, sizeof(data)); /* Keeloq is LSB first. */ - for (int j = 0; j < 66; j++) { - if (bitmap_get(data,9,j)) { - raw_samples_add(samples,true,te); - raw_samples_add(samples,false,te*2); + for(int j = 0; j < 66; j++) { + if(bitmap_get(data, 9, j)) { + raw_samples_add(samples, true, te); + raw_samples_add(samples, false, te * 2); } else { - raw_samples_add(samples,true,te*2); - raw_samples_add(samples,false,te); + raw_samples_add(samples, true, te * 2); + raw_samples_add(samples, false, te); } } } -ProtoViewDecoder KeeloqDecoder = { - .name = "Keeloq", - .decode = decode, - .get_fields = get_fields, - .build_message = build_message -}; +ProtoViewDecoder KeeloqDecoder = + {.name = "Keeloq", .decode = decode, .get_fields = get_fields, .build_message = build_message}; diff --git a/applications/plugins/protoview/protocols/oregon2.c b/applications/plugins/protoview/protocols/oregon2.c index 1d909a504..f67e85a2d 100644 --- a/applications/plugins/protoview/protocols/oregon2.c +++ b/applications/plugins/protoview/protocols/oregon2.c @@ -6,11 +6,14 @@ #include "../app.h" -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { - if (numbits < 32) return false; - const char *sync_pattern = "01100110" "01100110" "10010110" "10010110"; - uint64_t off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_pattern); - if (off == BITMAP_SEEK_NOT_FOUND) return false; +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { + if(numbits < 32) return false; + const char* sync_pattern = "01100110" + "01100110" + "10010110" + "10010110"; + uint64_t off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_pattern); + if(off == BITMAP_SEEK_NOT_FOUND) return false; FURI_LOG_E(TAG, "Oregon2 preamble+sync found"); info->start_off = off; @@ -18,50 +21,61 @@ static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoView uint8_t buffer[8], raw[8] = {0}; uint32_t decoded = - convert_from_line_code(buffer,sizeof(buffer),bits,numbytes,off,"1001","0110"); + convert_from_line_code(buffer, sizeof(buffer), bits, numbytes, off, "1001", "0110"); FURI_LOG_E(TAG, "Oregon2 decoded bits: %lu", decoded); - if (decoded < 11*4) return false; /* Minimum len to extract some data. */ - info->pulses_count = (off+11*4*4) - info->start_off; + if(decoded < 11 * 4) return false; /* Minimum len to extract some data. */ + info->pulses_count = (off + 11 * 4 * 4) - info->start_off; char temp[3] = {0}, hum[2] = {0}; uint8_t deviceid[2]; - for (int j = 0; j < 64; j += 4) { + for(int j = 0; j < 64; j += 4) { uint8_t nib[1]; - nib[0] = (bitmap_get(buffer,8,j+0) | - bitmap_get(buffer,8,j+1) << 1 | - bitmap_get(buffer,8,j+2) << 2 | - bitmap_get(buffer,8,j+3) << 3); - if (DEBUG_MSG) FURI_LOG_E(TAG, "Not inverted nibble[%d]: %x", j/4, (unsigned int)nib[0]); - raw[j/8] |= nib[0] << (4-(j%4)); - switch(j/4) { - case 1: deviceid[0] |= nib[0]; break; - case 0: deviceid[0] |= nib[0] << 4; break; - case 3: deviceid[1] |= nib[0]; break; - case 2: deviceid[1] |= nib[0] << 4; break; - case 10: temp[0] = nib[0]; break; + nib[0] = + (bitmap_get(buffer, 8, j + 0) | bitmap_get(buffer, 8, j + 1) << 1 | + bitmap_get(buffer, 8, j + 2) << 2 | bitmap_get(buffer, 8, j + 3) << 3); + if(DEBUG_MSG) FURI_LOG_E(TAG, "Not inverted nibble[%d]: %x", j / 4, (unsigned int)nib[0]); + raw[j / 8] |= nib[0] << (4 - (j % 4)); + switch(j / 4) { + case 1: + deviceid[0] |= nib[0]; + break; + case 0: + deviceid[0] |= nib[0] << 4; + break; + case 3: + deviceid[1] |= nib[0]; + break; + case 2: + deviceid[1] |= nib[0] << 4; + break; + case 10: + temp[0] = nib[0]; + break; /* Fixme: take the temperature sign from nibble 11. */ - case 9: temp[1] = nib[0]; break; - case 8: temp[2] = nib[0]; break; - case 13: hum[0] = nib[0]; break; - case 12: hum[1] = nib[0]; break; + case 9: + temp[1] = nib[0]; + break; + case 8: + temp[2] = nib[0]; + break; + case 13: + hum[0] = nib[0]; + break; + case 12: + hum[1] = nib[0]; + break; } } - float tempval = ((temp[0]-'0')*10) + - (temp[1]-'0') + - ((float)(temp[2]-'0')*0.1); - int humval = (hum[0]-'0')*10 + (hum[1]-'0'); + float tempval = ((temp[0] - '0') * 10) + (temp[1] - '0') + ((float)(temp[2] - '0') * 0.1); + int humval = (hum[0] - '0') * 10 + (hum[1] - '0'); - fieldset_add_bytes(info->fieldset,"Sensor ID",deviceid,4); - fieldset_add_float(info->fieldset,"Temperature",tempval,1); - fieldset_add_uint(info->fieldset,"Humidity",humval,7); + fieldset_add_bytes(info->fieldset, "Sensor ID", deviceid, 4); + fieldset_add_float(info->fieldset, "Temperature", tempval, 1); + fieldset_add_uint(info->fieldset, "Humidity", humval, 7); return true; } -ProtoViewDecoder Oregon2Decoder = { - .name = "Oregon2", - .decode = decode, - .get_fields = NULL, - .build_message = NULL -}; +ProtoViewDecoder Oregon2Decoder = + {.name = "Oregon2", .decode = decode, .get_fields = NULL, .build_message = NULL}; diff --git a/applications/plugins/protoview/protocols/tpms/citroen.c b/applications/plugins/protoview/protocols/tpms/citroen.c index d8a1681e4..ecd8fb983 100644 --- a/applications/plugins/protoview/protocols/tpms/citroen.c +++ b/applications/plugins/protoview/protocols/tpms/citroen.c @@ -7,55 +7,49 @@ #include "../../app.h" -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { - +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { /* We consider a preamble of 17 symbols. They are more, but the decoding * is more likely to happen if we don't pretend to receive from the * very start of the message. */ uint32_t sync_len = 17; - const char *sync_pattern = "10101010101010110"; - if (numbits-sync_len < 8*10) return false; /* Expect 10 bytes. */ + const char* sync_pattern = "10101010101010110"; + if(numbits - sync_len < 8 * 10) return false; /* Expect 10 bytes. */ - uint64_t off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_pattern); - if (off == BITMAP_SEEK_NOT_FOUND) return false; + uint64_t off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_pattern); + if(off == BITMAP_SEEK_NOT_FOUND) return false; FURI_LOG_E(TAG, "Renault TPMS preamble+sync found"); info->start_off = off; off += sync_len; /* Skip preamble + sync. */ uint8_t raw[10]; - uint32_t decoded = - convert_from_line_code(raw,sizeof(raw),bits,numbytes,off, - "01","10"); /* Manchester. */ + uint32_t decoded = convert_from_line_code( + raw, sizeof(raw), bits, numbytes, off, "01", "10"); /* Manchester. */ FURI_LOG_E(TAG, "Citroen TPMS decoded bits: %lu", decoded); - if (decoded < 8*10) return false; /* Require the full 10 bytes. */ + if(decoded < 8 * 10) return false; /* Require the full 10 bytes. */ /* Check the CRC. It's a simple XOR of bytes 1-9, the first byte * is not included. The meaning of the first byte is unknown and * we don't display it. */ uint8_t crc = 0; - for (int j = 1; j < 10; j++) crc ^= raw[j]; - if (crc != 0) return false; /* Require sane checksum. */ + for(int j = 1; j < 10; j++) crc ^= raw[j]; + if(crc != 0) return false; /* Require sane checksum. */ - info->pulses_count = (off+8*10*2) - info->start_off; + info->pulses_count = (off + 8 * 10 * 2) - info->start_off; int repeat = raw[5] & 0xf; - float kpa = (float)raw[6]*1.364; - int temp = raw[7]-50; + float kpa = (float)raw[6] * 1.364; + int temp = raw[7] - 50; int battery = raw[8]; /* This may be the battery. It's not clear. */ - fieldset_add_bytes(info->fieldset,"Tire ID",raw+1,4*2); - fieldset_add_float(info->fieldset,"Pressure kpa",kpa,2); - fieldset_add_int(info->fieldset,"Temperature C",temp,8); - fieldset_add_uint(info->fieldset,"Repeat",repeat,4); - fieldset_add_uint(info->fieldset,"Battery",battery,8); + fieldset_add_bytes(info->fieldset, "Tire ID", raw + 1, 4 * 2); + fieldset_add_float(info->fieldset, "Pressure kpa", kpa, 2); + fieldset_add_int(info->fieldset, "Temperature C", temp, 8); + fieldset_add_uint(info->fieldset, "Repeat", repeat, 4); + fieldset_add_uint(info->fieldset, "Battery", battery, 8); return true; } -ProtoViewDecoder CitroenTPMSDecoder = { - .name = "Citroen TPMS", - .decode = decode, - .get_fields = NULL, - .build_message = NULL -}; +ProtoViewDecoder CitroenTPMSDecoder = + {.name = "Citroen TPMS", .decode = decode, .get_fields = NULL, .build_message = NULL}; diff --git a/applications/plugins/protoview/protocols/tpms/ford.c b/applications/plugins/protoview/protocols/tpms/ford.c index abdb692ee..3816e72f9 100644 --- a/applications/plugins/protoview/protocols/tpms/ford.c +++ b/applications/plugins/protoview/protocols/tpms/ford.c @@ -10,54 +10,49 @@ #include "../../app.h" -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { + const char* sync_pattern = "010101010101" + "0110"; + uint8_t sync_len = 12 + 4; /* We just use 12 preamble symbols + sync. */ + if(numbits - sync_len < 8 * 8) return false; - const char *sync_pattern = "010101010101" "0110"; - uint8_t sync_len = 12+4; /* We just use 12 preamble symbols + sync. */ - if (numbits-sync_len < 8*8) return false; - - uint64_t off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_pattern); - if (off == BITMAP_SEEK_NOT_FOUND) return false; + uint64_t off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_pattern); + if(off == BITMAP_SEEK_NOT_FOUND) return false; FURI_LOG_E(TAG, "Fort TPMS preamble+sync found"); info->start_off = off; off += sync_len; /* Skip preamble and sync. */ uint8_t raw[8]; - uint32_t decoded = - convert_from_line_code(raw,sizeof(raw),bits,numbytes,off, - "01","10"); /* Manchester. */ + uint32_t decoded = convert_from_line_code( + raw, sizeof(raw), bits, numbytes, off, "01", "10"); /* Manchester. */ FURI_LOG_E(TAG, "Ford TPMS decoded bits: %lu", decoded); - if (decoded < 8*8) return false; /* Require the full 8 bytes. */ + if(decoded < 8 * 8) return false; /* Require the full 8 bytes. */ /* CRC is just the sum of the first 7 bytes MOD 256. */ uint8_t crc = 0; - for (int j = 0; j < 7; j++) crc += raw[j]; - if (crc != raw[7]) return false; /* Require sane CRC. */ + for(int j = 0; j < 7; j++) crc += raw[j]; + if(crc != raw[7]) return false; /* Require sane CRC. */ - info->pulses_count = (off+8*8*2) - info->start_off; + info->pulses_count = (off + 8 * 8 * 2) - info->start_off; - float psi = 0.25 * (((raw[6]&0x20)<<3)|raw[4]); + float psi = 0.25 * (((raw[6] & 0x20) << 3) | raw[4]); /* Temperature apperas to be valid only if the most significant * bit of the value is not set. Otherwise its meaning is unknown. * Likely useful to alternatively send temperature or other info. */ - int temp = raw[5] & 0x80 ? 0 : raw[5]-56; + int temp = raw[5] & 0x80 ? 0 : raw[5] - 56; int flags = raw[5] & 0x7f; int car_moving = (raw[6] & 0x44) == 0x44; - fieldset_add_bytes(info->fieldset,"Tire ID",raw,4*2); - fieldset_add_float(info->fieldset,"Pressure psi",psi,2); - fieldset_add_int(info->fieldset,"Temperature C",temp,8); - fieldset_add_hex(info->fieldset,"Flags",flags,7); - fieldset_add_uint(info->fieldset,"Moving",car_moving,1); + fieldset_add_bytes(info->fieldset, "Tire ID", raw, 4 * 2); + fieldset_add_float(info->fieldset, "Pressure psi", psi, 2); + fieldset_add_int(info->fieldset, "Temperature C", temp, 8); + fieldset_add_hex(info->fieldset, "Flags", flags, 7); + fieldset_add_uint(info->fieldset, "Moving", car_moving, 1); return true; } -ProtoViewDecoder FordTPMSDecoder = { - .name = "Ford TPMS", - .decode = decode, - .get_fields = NULL, - .build_message = NULL -}; +ProtoViewDecoder FordTPMSDecoder = + {.name = "Ford TPMS", .decode = decode, .get_fields = NULL, .build_message = NULL}; diff --git a/applications/plugins/protoview/protocols/tpms/renault.c b/applications/plugins/protoview/protocols/tpms/renault.c index 09de77d17..3d8fc43d5 100644 --- a/applications/plugins/protoview/protocols/tpms/renault.c +++ b/applications/plugins/protoview/protocols/tpms/renault.c @@ -6,85 +6,82 @@ #include "../../app.h" #define USE_TEST_VECTOR 0 -static const char *test_vector = +static const char* test_vector = "...01010101010101010110" // Preamble + sync /* The following is Marshal encoded, so each two characters are * actaully one bit. 01 = 0, 10 = 1. */ "010110010110" // Flags. "10011001101010011001" // Pressure, multiply by 0.75 to obtain kpa. - // 244 kpa here. - "1010010110011010" // Temperature, subtract 30 to obtain celsius. 22C here. + // 244 kpa here. + "1010010110011010" // Temperature, subtract 30 to obtain celsius. 22C here. "1001010101101001" "0101100110010101" - "1001010101100110" // Tire ID. 0x7AD779 here. + "1001010101100110" // Tire ID. 0x7AD779 here. "0101010101010101" - "0101010101010101" // Two FF bytes (usually). Unknown. + "0101010101010101" // Two FF bytes (usually). Unknown. "0110010101010101"; // CRC8 with (poly 7, initialization 0). -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { - - if (USE_TEST_VECTOR) { /* Test vector to check that decoding works. */ - bitmap_set_pattern(bits,numbytes,0,test_vector); +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { + if(USE_TEST_VECTOR) { /* Test vector to check that decoding works. */ + bitmap_set_pattern(bits, numbytes, 0, test_vector); numbits = strlen(test_vector); } - if (numbits-12 < 9*8) return false; + if(numbits - 12 < 9 * 8) return false; - const char *sync_pattern = "01010101010101010110"; - uint64_t off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_pattern); - if (off == BITMAP_SEEK_NOT_FOUND) return false; + const char* sync_pattern = "01010101010101010110"; + uint64_t off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_pattern); + if(off == BITMAP_SEEK_NOT_FOUND) return false; FURI_LOG_E(TAG, "Renault TPMS preamble+sync found"); info->start_off = off; off += 20; /* Skip preamble. */ uint8_t raw[9]; - uint32_t decoded = - convert_from_line_code(raw,sizeof(raw),bits,numbytes,off, - "01","10"); /* Manchester. */ + uint32_t decoded = convert_from_line_code( + raw, sizeof(raw), bits, numbytes, off, "01", "10"); /* Manchester. */ FURI_LOG_E(TAG, "Renault TPMS decoded bits: %lu", decoded); - if (decoded < 8*9) return false; /* Require the full 9 bytes. */ - if (crc8(raw,8,0,7) != raw[8]) return false; /* Require sane CRC. */ + if(decoded < 8 * 9) return false; /* Require the full 9 bytes. */ + if(crc8(raw, 8, 0, 7) != raw[8]) return false; /* Require sane CRC. */ - info->pulses_count = (off+8*9*2) - info->start_off; + info->pulses_count = (off + 8 * 9 * 2) - info->start_off; - uint8_t flags = raw[0]>>2; - float kpa = 0.75 * ((uint32_t)((raw[0]&3)<<8) | raw[1]); - int temp = raw[2]-30; + uint8_t flags = raw[0] >> 2; + float kpa = 0.75 * ((uint32_t)((raw[0] & 3) << 8) | raw[1]); + int temp = raw[2] - 30; - fieldset_add_bytes(info->fieldset,"Tire ID",raw+3,3*2); - fieldset_add_float(info->fieldset,"Pressure kpa",kpa,2); - fieldset_add_int(info->fieldset,"Temperature C",temp,8); - fieldset_add_hex(info->fieldset,"Flags",flags,6); - fieldset_add_bytes(info->fieldset,"Unknown1",raw+6,2); - fieldset_add_bytes(info->fieldset,"Unknown2",raw+7,2); + fieldset_add_bytes(info->fieldset, "Tire ID", raw + 3, 3 * 2); + fieldset_add_float(info->fieldset, "Pressure kpa", kpa, 2); + fieldset_add_int(info->fieldset, "Temperature C", temp, 8); + fieldset_add_hex(info->fieldset, "Flags", flags, 6); + fieldset_add_bytes(info->fieldset, "Unknown1", raw + 6, 2); + fieldset_add_bytes(info->fieldset, "Unknown2", raw + 7, 2); return true; } /* Give fields and defaults for the signal creator. */ -static void get_fields(ProtoViewFieldSet *fieldset) { - uint8_t default_id[3]= {0xAB, 0xCD, 0xEF}; - fieldset_add_bytes(fieldset,"Tire ID",default_id,3*2); - fieldset_add_float(fieldset,"Pressure kpa",123,2); - fieldset_add_int(fieldset,"Temperature C",20,8); +static void get_fields(ProtoViewFieldSet* fieldset) { + uint8_t default_id[3] = {0xAB, 0xCD, 0xEF}; + fieldset_add_bytes(fieldset, "Tire ID", default_id, 3 * 2); + fieldset_add_float(fieldset, "Pressure kpa", 123, 2); + fieldset_add_int(fieldset, "Temperature C", 20, 8); // We don't know what flags are, but 1B is a common value. - fieldset_add_hex(fieldset,"Flags",0x1b,6); - fieldset_add_bytes(fieldset,"Unknown1",(uint8_t*)"\xff",2); - fieldset_add_bytes(fieldset,"Unknown2",(uint8_t*)"\xff",2); + fieldset_add_hex(fieldset, "Flags", 0x1b, 6); + fieldset_add_bytes(fieldset, "Unknown1", (uint8_t*)"\xff", 2); + fieldset_add_bytes(fieldset, "Unknown2", (uint8_t*)"\xff", 2); } /* Create a Renault TPMS signal, according to the fields provided. */ -static void build_message(RawSamplesBuffer *samples, ProtoViewFieldSet *fieldset) -{ +static void build_message(RawSamplesBuffer* samples, ProtoViewFieldSet* fieldset) { uint32_t te = 50; // Short pulse duration in microseconds. // Preamble + sync - const char *psync = "01010101010101010101010101010110"; - const char *p = psync; + const char* psync = "01010101010101010101010101010110"; + const char* p = psync; while(*p) { - raw_samples_add_or_update(samples,*p == '1',te); + raw_samples_add_or_update(samples, *p == '1', te); p++; } @@ -93,21 +90,21 @@ static void build_message(RawSamplesBuffer *samples, ProtoViewFieldSet *fieldset unsigned int raw_pressure = fieldset->fields[1]->fvalue * 4 / 3; data[0] = fieldset->fields[3]->uvalue << 2; // Flags data[0] |= (raw_pressure >> 8) & 3; // Pressure kpa high 2 bits - data[1] = raw_pressure & 0xff; // Pressure kpa low 8 bits + data[1] = raw_pressure & 0xff; // Pressure kpa low 8 bits data[2] = fieldset->fields[2]->value + 30; // Temperature C - memcpy(data+3,fieldset->fields[0]->bytes,6); // ID, 24 bits. - data[6] = fieldset->fields[4]->bytes[0]; // Unknown 1 - data[7] = fieldset->fields[5]->bytes[0]; // Unknown 2 - data[8] = crc8(data,8,0,7); + memcpy(data + 3, fieldset->fields[0]->bytes, 6); // ID, 24 bits. + data[6] = fieldset->fields[4]->bytes[0]; // Unknown 1 + data[7] = fieldset->fields[5]->bytes[0]; // Unknown 2 + data[8] = crc8(data, 8, 0, 7); // Generate Manchester code for each bit - for (uint32_t j = 0; j < 9*8; j++) { - if (bitmap_get(data,sizeof(data),j)) { - raw_samples_add_or_update(samples,true,te); - raw_samples_add_or_update(samples,false,te); + for(uint32_t j = 0; j < 9 * 8; j++) { + if(bitmap_get(data, sizeof(data), j)) { + raw_samples_add_or_update(samples, true, te); + raw_samples_add_or_update(samples, false, te); } else { - raw_samples_add_or_update(samples,false,te); - raw_samples_add_or_update(samples,true,te); + raw_samples_add_or_update(samples, false, te); + raw_samples_add_or_update(samples, true, te); } } } @@ -116,5 +113,4 @@ ProtoViewDecoder RenaultTPMSDecoder = { .name = "Renault TPMS", .decode = decode, .get_fields = get_fields, - .build_message = build_message -}; + .build_message = build_message}; diff --git a/applications/plugins/protoview/protocols/tpms/schrader.c b/applications/plugins/protoview/protocols/tpms/schrader.c index ae25e39bb..7dc85a2cb 100644 --- a/applications/plugins/protoview/protocols/tpms/schrader.c +++ b/applications/plugins/protoview/protocols/tpms/schrader.c @@ -11,20 +11,21 @@ #include "../../app.h" #define USE_TEST_VECTOR 0 -static const char *test_vector = "000000111101010101011010010110010110101001010110100110011001100101010101011010100110100110011010101010101010101010101010101010101010101010101010"; +static const char* test_vector = + "000000111101010101011010010110010110101001010110100110011001100101010101011010100110100110011010101010101010101010101010101010101010101010101010"; -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { - - if (USE_TEST_VECTOR) { /* Test vector to check that decoding works. */ - bitmap_set_pattern(bits,numbytes,0,test_vector); +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { + if(USE_TEST_VECTOR) { /* Test vector to check that decoding works. */ + bitmap_set_pattern(bits, numbytes, 0, test_vector); numbits = strlen(test_vector); } - if (numbits < 64) return false; /* Preamble + data. */ + if(numbits < 64) return false; /* Preamble + data. */ - const char *sync_pattern = "1111010101" "01011010"; - uint64_t off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_pattern); - if (off == BITMAP_SEEK_NOT_FOUND) return false; + const char* sync_pattern = "1111010101" + "01011010"; + uint64_t off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_pattern); + if(off == BITMAP_SEEK_NOT_FOUND) return false; FURI_LOG_E(TAG, "Schrader TPMS gap+preamble found"); info->start_off = off; @@ -34,38 +35,33 @@ static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoView uint8_t raw[8]; uint8_t id[4]; - uint32_t decoded = - convert_from_line_code(raw,sizeof(raw),bits,numbytes,off, - "01","10"); /* Manchester code. */ + uint32_t decoded = convert_from_line_code( + raw, sizeof(raw), bits, numbytes, off, "01", "10"); /* Manchester code. */ FURI_LOG_E(TAG, "Schrader TPMS decoded bits: %lu", decoded); - if (decoded < 64) return false; /* Require the full 8 bytes. */ + if(decoded < 64) return false; /* Require the full 8 bytes. */ raw[0] |= 0xf0; // Fix the preamble nibble for checksum computation. - uint8_t cksum = crc8(raw,sizeof(raw)-1,0xf0,0x7); - if (cksum != raw[7]) { + uint8_t cksum = crc8(raw, sizeof(raw) - 1, 0xf0, 0x7); + if(cksum != raw[7]) { FURI_LOG_E(TAG, "Schrader TPMS checksum mismatch"); return false; } - info->pulses_count = (off+8*8*2) - info->start_off; + info->pulses_count = (off + 8 * 8 * 2) - info->start_off; - float kpa = (float)raw[5]*2.5; - int temp = raw[6]-50; - id[0] = raw[1]&7; + float kpa = (float)raw[5] * 2.5; + int temp = raw[6] - 50; + id[0] = raw[1] & 7; id[1] = raw[2]; id[2] = raw[3]; id[3] = raw[4]; - fieldset_add_bytes(info->fieldset,"Tire ID",id,4*2); - fieldset_add_float(info->fieldset,"Pressure kpa",kpa,2); - fieldset_add_int(info->fieldset,"Temperature C",temp,8); + fieldset_add_bytes(info->fieldset, "Tire ID", id, 4 * 2); + fieldset_add_float(info->fieldset, "Pressure kpa", kpa, 2); + fieldset_add_int(info->fieldset, "Temperature C", temp, 8); return true; } -ProtoViewDecoder SchraderTPMSDecoder = { - .name = "Schrader TPMS", - .decode = decode, - .get_fields = NULL, - .build_message = NULL -}; +ProtoViewDecoder SchraderTPMSDecoder = + {.name = "Schrader TPMS", .decode = decode, .get_fields = NULL, .build_message = NULL}; diff --git a/applications/plugins/protoview/protocols/tpms/schrader_eg53ma4.c b/applications/plugins/protoview/protocols/tpms/schrader_eg53ma4.c index 0105010bd..45accf1a1 100644 --- a/applications/plugins/protoview/protocols/tpms/schrader_eg53ma4.c +++ b/applications/plugins/protoview/protocols/tpms/schrader_eg53ma4.c @@ -15,50 +15,45 @@ #include "../../app.h" -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { + const char* sync_pattern = "010101010101" + "01100101"; + uint8_t sync_len = 12 + 8; /* We just use 12 preamble symbols + sync. */ + if(numbits - sync_len + 8 < 8 * 10) return false; - const char *sync_pattern = "010101010101" "01100101"; - uint8_t sync_len = 12+8; /* We just use 12 preamble symbols + sync. */ - if (numbits-sync_len+8 < 8*10) return false; - - uint64_t off = bitmap_seek_bits(bits,numbytes,0,numbits,sync_pattern); - if (off == BITMAP_SEEK_NOT_FOUND) return false; + uint64_t off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync_pattern); + if(off == BITMAP_SEEK_NOT_FOUND) return false; FURI_LOG_E(TAG, "Schrader EG53MA4 TPMS preamble+sync found"); info->start_off = off; - off += sync_len-8; /* Skip preamble, not sync that is part of the data. */ + off += sync_len - 8; /* Skip preamble, not sync that is part of the data. */ uint8_t raw[10]; - uint32_t decoded = - convert_from_line_code(raw,sizeof(raw),bits,numbytes,off, - "01","10"); /* Manchester code. */ + uint32_t decoded = convert_from_line_code( + raw, sizeof(raw), bits, numbytes, off, "01", "10"); /* Manchester code. */ FURI_LOG_E(TAG, "Schrader EG53MA4 TPMS decoded bits: %lu", decoded); - if (decoded < 10*8) return false; /* Require the full 10 bytes. */ + if(decoded < 10 * 8) return false; /* Require the full 10 bytes. */ /* CRC is just all bytes added mod 256. */ uint8_t crc = 0; - for (int j = 0; j < 9; j++) crc += raw[j]; - if (crc != raw[9]) return false; /* Require sane CRC. */ + for(int j = 0; j < 9; j++) crc += raw[j]; + if(crc != raw[9]) return false; /* Require sane CRC. */ - info->pulses_count = (off+10*8*2) - info->start_off; + info->pulses_count = (off + 10 * 8 * 2) - info->start_off; /* To convert the raw pressure to kPa, RTL433 uses 2.5, but is likely * wrong. Searching on Google for users experimenting with the value * reported, the value appears to be 2.75. */ - float kpa = (float)raw[7]*2.75; + float kpa = (float)raw[7] * 2.75; int temp_f = raw[8]; - int temp_c = (temp_f-32)*5/9; /* Convert Fahrenheit to Celsius. */ + int temp_c = (temp_f - 32) * 5 / 9; /* Convert Fahrenheit to Celsius. */ - fieldset_add_bytes(info->fieldset,"Tire ID",raw+4,3*2); - fieldset_add_float(info->fieldset,"Pressure kpa",kpa,2); - fieldset_add_int(info->fieldset,"Temperature C",temp_c,8); + fieldset_add_bytes(info->fieldset, "Tire ID", raw + 4, 3 * 2); + fieldset_add_float(info->fieldset, "Pressure kpa", kpa, 2); + fieldset_add_int(info->fieldset, "Temperature C", temp_c, 8); return true; } -ProtoViewDecoder SchraderEG53MA4TPMSDecoder = { - .name = "Schrader EG53MA4 TPMS", - .decode = decode, - .get_fields = NULL, - .build_message = NULL -}; +ProtoViewDecoder SchraderEG53MA4TPMSDecoder = + {.name = "Schrader EG53MA4 TPMS", .decode = decode, .get_fields = NULL, .build_message = NULL}; diff --git a/applications/plugins/protoview/protocols/tpms/toyota.c b/applications/plugins/protoview/protocols/tpms/toyota.c index b9dd1d959..b80af7647 100644 --- a/applications/plugins/protoview/protocols/tpms/toyota.c +++ b/applications/plugins/protoview/protocols/tpms/toyota.c @@ -24,40 +24,33 @@ #include "../../app.h" -static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo *info) { - - if (numbits-6 < 64*2) return false; /* Ask for 64 bit of data (each bit +static bool decode(uint8_t* bits, uint32_t numbytes, uint32_t numbits, ProtoViewMsgInfo* info) { + if(numbits - 6 < 64 * 2) + return false; /* Ask for 64 bit of data (each bit is two symbols in the bitmap). */ - char *sync[] = { - "00111100", - "001111100", - "00111101", - "001111101", - NULL - }; + char* sync[] = {"00111100", "001111100", "00111101", "001111101", NULL}; int j; uint32_t off = 0; - for (j = 0; sync[j]; j++) { - off = bitmap_seek_bits(bits,numbytes,0,numbits,sync[j]); - if (off != BITMAP_SEEK_NOT_FOUND) { + for(j = 0; sync[j]; j++) { + off = bitmap_seek_bits(bits, numbytes, 0, numbits, sync[j]); + if(off != BITMAP_SEEK_NOT_FOUND) { info->start_off = off; - off += strlen(sync[j])-2; + off += strlen(sync[j]) - 2; break; - } + } } - if (off == BITMAP_SEEK_NOT_FOUND) return false; + if(off == BITMAP_SEEK_NOT_FOUND) return false; FURI_LOG_E(TAG, "Toyota TPMS sync[%s] found", sync[j]); uint8_t raw[9]; - uint32_t decoded = - convert_from_diff_manchester(raw,sizeof(raw),bits,numbytes,off,true); + uint32_t decoded = convert_from_diff_manchester(raw, sizeof(raw), bits, numbytes, off, true); FURI_LOG_E(TAG, "Toyota TPMS decoded bits: %lu", decoded); - if (decoded < 8*9) return false; /* Require the full 8 bytes. */ - if (crc8(raw,8,0x80,7) != raw[8]) return false; /* Require sane CRC. */ + if(decoded < 8 * 9) return false; /* Require the full 8 bytes. */ + if(crc8(raw, 8, 0x80, 7) != raw[8]) return false; /* Require sane CRC. */ /* We detected a valid signal. However now info->start_off is actually * pointing to the sync part, not the preamble of alternating 0 and 1. @@ -65,25 +58,21 @@ static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoView * for the decoder itself to fix the signal if neeeded, so that its * logical representation will be more accurate and better to save * and retransmit. */ - if (info->start_off >= 12) { + if(info->start_off >= 12) { info->start_off -= 12; - bitmap_set_pattern(bits,numbytes,info->start_off,"010101010101"); + bitmap_set_pattern(bits, numbytes, info->start_off, "010101010101"); } - info->pulses_count = (off+8*9*2) - info->start_off; + info->pulses_count = (off + 8 * 9 * 2) - info->start_off; - float psi = (float)((raw[4]&0x7f)<<1 | raw[5]>>7) * 0.25 - 7; - int temp = ((raw[5]&0x7f)<<1 | raw[6]>>7) - 40; + float psi = (float)((raw[4] & 0x7f) << 1 | raw[5] >> 7) * 0.25 - 7; + int temp = ((raw[5] & 0x7f) << 1 | raw[6] >> 7) - 40; - fieldset_add_bytes(info->fieldset,"Tire ID",raw,4*2); - fieldset_add_float(info->fieldset,"Pressure psi",psi,2); - fieldset_add_int(info->fieldset,"Temperature C",temp,8); + fieldset_add_bytes(info->fieldset, "Tire ID", raw, 4 * 2); + fieldset_add_float(info->fieldset, "Pressure psi", psi, 2); + fieldset_add_int(info->fieldset, "Temperature C", temp, 8); return true; } -ProtoViewDecoder ToyotaTPMSDecoder = { - .name = "Toyota TPMS", - .decode = decode, - .get_fields = NULL, - .build_message = NULL -}; +ProtoViewDecoder ToyotaTPMSDecoder = + {.name = "Toyota TPMS", .decode = decode, .get_fields = NULL, .build_message = NULL}; diff --git a/applications/plugins/protoview/raw_samples.c b/applications/plugins/protoview/raw_samples.c index f83cca361..54773f43f 100644 --- a/applications/plugins/protoview/raw_samples.c +++ b/applications/plugins/protoview/raw_samples.c @@ -8,15 +8,15 @@ #include "raw_samples.h" /* Allocate and initialize a samples buffer. */ -RawSamplesBuffer *raw_samples_alloc(void) { - RawSamplesBuffer *buf = malloc(sizeof(*buf)); +RawSamplesBuffer* raw_samples_alloc(void) { + RawSamplesBuffer* buf = malloc(sizeof(*buf)); buf->mutex = furi_mutex_alloc(FuriMutexTypeNormal); raw_samples_reset(buf); return buf; } /* Free a sample buffer. Should be called when the mutex is released. */ -void raw_samples_free(RawSamplesBuffer *s) { +void raw_samples_free(RawSamplesBuffer* s) { furi_mutex_free(s->mutex); free(s); } @@ -24,27 +24,27 @@ void raw_samples_free(RawSamplesBuffer *s) { /* This just set all the samples to zero and also resets the internal * index. There is no need to call it after raw_samples_alloc(), but only * when one wants to reset the whole buffer of samples. */ -void raw_samples_reset(RawSamplesBuffer *s) { - furi_mutex_acquire(s->mutex,FuriWaitForever); +void raw_samples_reset(RawSamplesBuffer* s) { + furi_mutex_acquire(s->mutex, FuriWaitForever); s->total = RAW_SAMPLES_NUM; s->idx = 0; s->short_pulse_dur = 0; - memset(s->samples,0,sizeof(s->samples)); + memset(s->samples, 0, sizeof(s->samples)); furi_mutex_release(s->mutex); } /* Set the raw sample internal index so that what is currently at * offset 'offset', will appear to be at 0 index. */ -void raw_samples_center(RawSamplesBuffer *s, uint32_t offset) { - s->idx = (s->idx+offset) % RAW_SAMPLES_NUM; +void raw_samples_center(RawSamplesBuffer* s, uint32_t offset) { + s->idx = (s->idx + offset) % RAW_SAMPLES_NUM; } /* Add the specified sample in the circular buffer. */ -void raw_samples_add(RawSamplesBuffer *s, bool level, uint32_t dur) { - furi_mutex_acquire(s->mutex,FuriWaitForever); +void raw_samples_add(RawSamplesBuffer* s, bool level, uint32_t dur) { + furi_mutex_acquire(s->mutex, FuriWaitForever); s->samples[s->idx].level = level; s->samples[s->idx].dur = dur; - s->idx = (s->idx+1) % RAW_SAMPLES_NUM; + s->idx = (s->idx + 1) % RAW_SAMPLES_NUM; furi_mutex_release(s->mutex); } @@ -56,28 +56,25 @@ void raw_samples_add(RawSamplesBuffer *s, bool level, uint32_t dur) { * * This function is a bit slower so the internal data sampling should * be performed with raw_samples_add(). */ -void raw_samples_add_or_update(RawSamplesBuffer *s, bool level, uint32_t dur) { - furi_mutex_acquire(s->mutex,FuriWaitForever); - uint32_t previdx = (s->idx-1) % RAW_SAMPLES_NUM; - if (s->samples[previdx].level == level && - s->samples[previdx].dur != 0) - { +void raw_samples_add_or_update(RawSamplesBuffer* s, bool level, uint32_t dur) { + furi_mutex_acquire(s->mutex, FuriWaitForever); + uint32_t previdx = (s->idx - 1) % RAW_SAMPLES_NUM; + if(s->samples[previdx].level == level && s->samples[previdx].dur != 0) { /* Update the last sample: it has the same level. */ s->samples[previdx].dur += dur; } else { /* Add a new sample. */ s->samples[s->idx].level = level; s->samples[s->idx].dur = dur; - s->idx = (s->idx+1) % RAW_SAMPLES_NUM; + s->idx = (s->idx + 1) % RAW_SAMPLES_NUM; } furi_mutex_release(s->mutex); } /* Get the sample from the buffer. It is possible to use out of range indexes * as 'idx' because the modulo operation will rewind back from the start. */ -void raw_samples_get(RawSamplesBuffer *s, uint32_t idx, bool *level, uint32_t *dur) -{ - furi_mutex_acquire(s->mutex,FuriWaitForever); +void raw_samples_get(RawSamplesBuffer* s, uint32_t idx, bool* level, uint32_t* dur) { + furi_mutex_acquire(s->mutex, FuriWaitForever); idx = (s->idx + idx) % RAW_SAMPLES_NUM; *level = s->samples[idx].level; *dur = s->samples[idx].dur; @@ -85,12 +82,12 @@ void raw_samples_get(RawSamplesBuffer *s, uint32_t idx, bool *level, uint32_t *d } /* Copy one buffer to the other, including current index. */ -void raw_samples_copy(RawSamplesBuffer *dst, RawSamplesBuffer *src) { - furi_mutex_acquire(src->mutex,FuriWaitForever); - furi_mutex_acquire(dst->mutex,FuriWaitForever); +void raw_samples_copy(RawSamplesBuffer* dst, RawSamplesBuffer* src) { + furi_mutex_acquire(src->mutex, FuriWaitForever); + furi_mutex_acquire(dst->mutex, FuriWaitForever); dst->idx = src->idx; dst->short_pulse_dur = src->short_pulse_dur; - memcpy(dst->samples,src->samples,sizeof(dst->samples)); + memcpy(dst->samples, src->samples, sizeof(dst->samples)); furi_mutex_release(src->mutex); furi_mutex_release(dst->mutex); } diff --git a/applications/plugins/protoview/raw_samples.h b/applications/plugins/protoview/raw_samples.h index 0b0422025..3493f07fd 100644 --- a/applications/plugins/protoview/raw_samples.h +++ b/applications/plugins/protoview/raw_samples.h @@ -4,16 +4,17 @@ /* Our circular buffer of raw samples, used in order to display * the signal. */ -#define RAW_SAMPLES_NUM 2048 /* Use a power of two: we take the modulo +#define RAW_SAMPLES_NUM \ + 2048 /* Use a power of two: we take the modulo of the index quite often to normalize inside the range, and division is slow. */ typedef struct RawSamplesBuffer { - FuriMutex *mutex; + FuriMutex* mutex; struct { - uint16_t level:1; - uint16_t dur:15; + uint16_t level : 1; + uint16_t dur : 15; } samples[RAW_SAMPLES_NUM]; - uint32_t idx; /* Current idx (next to write). */ + uint32_t idx; /* Current idx (next to write). */ uint32_t total; /* Total samples: same as RAW_SAMPLES_NUM, we provide this field for a cleaner interface with the user, but we always use RAW_SAMPLES_NUM when taking the modulo so @@ -22,11 +23,11 @@ typedef struct RawSamplesBuffer { uint32_t short_pulse_dur; /* Duration of the shortest pulse. */ } RawSamplesBuffer; -RawSamplesBuffer *raw_samples_alloc(void); -void raw_samples_reset(RawSamplesBuffer *s); -void raw_samples_center(RawSamplesBuffer *s, uint32_t offset); -void raw_samples_add(RawSamplesBuffer *s, bool level, uint32_t dur); -void raw_samples_add_or_update(RawSamplesBuffer *s, bool level, uint32_t dur); -void raw_samples_get(RawSamplesBuffer *s, uint32_t idx, bool *level, uint32_t *dur); -void raw_samples_copy(RawSamplesBuffer *dst, RawSamplesBuffer *src); -void raw_samples_free(RawSamplesBuffer *s); +RawSamplesBuffer* raw_samples_alloc(void); +void raw_samples_reset(RawSamplesBuffer* s); +void raw_samples_center(RawSamplesBuffer* s, uint32_t offset); +void raw_samples_add(RawSamplesBuffer* s, bool level, uint32_t dur); +void raw_samples_add_or_update(RawSamplesBuffer* s, bool level, uint32_t dur); +void raw_samples_get(RawSamplesBuffer* s, uint32_t idx, bool* level, uint32_t* dur); +void raw_samples_copy(RawSamplesBuffer* dst, RawSamplesBuffer* src); +void raw_samples_free(RawSamplesBuffer* s); diff --git a/applications/plugins/protoview/signal.c b/applications/plugins/protoview/signal.c index f4c5ebedf..a1c4b2b8f 100644 --- a/applications/plugins/protoview/signal.c +++ b/applications/plugins/protoview/signal.c @@ -3,7 +3,7 @@ #include "app.h" -bool decode_signal(RawSamplesBuffer *s, uint64_t len, ProtoViewMsgInfo *info); +bool decode_signal(RawSamplesBuffer* s, uint64_t len, ProtoViewMsgInfo* info); /* ============================================================================= * Raw signal detection @@ -16,7 +16,7 @@ uint32_t duration_delta(uint32_t a, uint32_t b) { } /* Reset the current signal, so that a new one can be detected. */ -void reset_current_signal(ProtoViewApp *app) { +void reset_current_signal(ProtoViewApp* app) { app->signal_bestlen = 0; app->signal_offset = 0; app->signal_decoded = false; @@ -39,47 +39,47 @@ void reset_current_signal(ProtoViewApp *app) { * For instance Oregon2 sensors, in the case of protocol 2.1 will send * pulses of ~400us (RF on) VS ~580us (RF off). */ #define SEARCH_CLASSES 3 -uint32_t search_coherent_signal(RawSamplesBuffer *s, uint32_t idx) { +uint32_t search_coherent_signal(RawSamplesBuffer* s, uint32_t idx) { struct { - uint32_t dur[2]; /* dur[0] = low, dur[1] = high */ - uint32_t count[2]; /* Associated observed frequency. */ + uint32_t dur[2]; /* dur[0] = low, dur[1] = high */ + uint32_t count[2]; /* Associated observed frequency. */ } classes[SEARCH_CLASSES]; - memset(classes,0,sizeof(classes)); + memset(classes, 0, sizeof(classes)); uint32_t minlen = 30, maxlen = 4000; /* Depends on data rate, here we allow for high and low. */ uint32_t len = 0; /* Observed len of coherent samples. */ s->short_pulse_dur = 0; - for (uint32_t j = idx; j < idx+500; j++) { + for(uint32_t j = idx; j < idx + 500; j++) { bool level; uint32_t dur; raw_samples_get(s, j, &level, &dur); - if (dur < minlen || dur > maxlen) break; /* return. */ + if(dur < minlen || dur > maxlen) break; /* return. */ /* Let's see if it matches a class we already have or if we * can populate a new (yet empty) class. */ uint32_t k; - for (k = 0; k < SEARCH_CLASSES; k++) { - if (classes[k].count[level] == 0) { + for(k = 0; k < SEARCH_CLASSES; k++) { + if(classes[k].count[level] == 0) { classes[k].dur[level] = dur; classes[k].count[level] = 1; break; /* Sample accepted. */ } else { uint32_t classavg = classes[k].dur[level]; uint32_t count = classes[k].count[level]; - uint32_t delta = duration_delta(dur,classavg); + uint32_t delta = duration_delta(dur, classavg); /* Is the difference in duration between this signal and * the class we are inspecting less than a given percentage? * If so, accept this signal. */ - if (delta < classavg/5) { /* 100%/5 = 20%. */ + if(delta < classavg / 5) { /* 100%/5 = 20%. */ /* It is useful to compute the average of the class * we are observing. We know how many samples we got so * far, so we can recompute the average easily. * By always having a better estimate of the pulse len * we can avoid missing next samples in case the first * observed samples are too off. */ - classavg = ((classavg * count) + dur) / (count+1); + classavg = ((classavg * count) + dur) / (count + 1); classes[k].dur[level] = classavg; classes[k].count[level]++; break; /* Sample accepted. */ @@ -87,7 +87,7 @@ uint32_t search_coherent_signal(RawSamplesBuffer *s, uint32_t idx) { } } - if (k == SEARCH_CLASSES) break; /* No match, return. */ + if(k == SEARCH_CLASSES) break; /* No match, return. */ /* If we are here, we accepted this sample. Try with the next * one. */ @@ -97,14 +97,12 @@ uint32_t search_coherent_signal(RawSamplesBuffer *s, uint32_t idx) { /* Update the buffer setting the shortest pulse we found * among the three classes. This will be used when scaling * for visualization. */ - uint32_t short_dur[2] = {0,0}; - for (int j = 0; j < SEARCH_CLASSES; j++) { - for (int level = 0; level < 2; level++) { - if (classes[j].dur[level] == 0) continue; - if (classes[j].count[level] < 3) continue; - if (short_dur[level] == 0 || - short_dur[level] > classes[j].dur[level]) - { + uint32_t short_dur[2] = {0, 0}; + for(int j = 0; j < SEARCH_CLASSES; j++) { + for(int level = 0; level < 2; level++) { + if(classes[j].dur[level] == 0) continue; + if(classes[j].count[level] < 3) continue; + if(short_dur[level] == 0 || short_dur[level] > classes[j].dur[level]) { short_dur[level] = classes[j].dur[level]; } } @@ -113,33 +111,28 @@ uint32_t search_coherent_signal(RawSamplesBuffer *s, uint32_t idx) { /* Use the average between high and low short pulses duration. * Often they are a bit different, and using the average is more robust * when we do decoding sampling at short_pulse_dur intervals. */ - if (short_dur[0] == 0) short_dur[0] = short_dur[1]; - if (short_dur[1] == 0) short_dur[1] = short_dur[0]; - s->short_pulse_dur = (short_dur[0]+short_dur[1])/2; + if(short_dur[0] == 0) short_dur[0] = short_dur[1]; + if(short_dur[1] == 0) short_dur[1] = short_dur[0]; + s->short_pulse_dur = (short_dur[0] + short_dur[1]) / 2; return len; } /* Called when we detect a message. Just blinks when the message was * not decoded. Vibrates, too, when the message was correctly decoded. */ -void notify_signal_detected(ProtoViewApp *app, bool decoded) { +void notify_signal_detected(ProtoViewApp* app, bool decoded) { static const NotificationSequence decoded_seq = { &message_vibro_on, &message_green_255, &message_delay_50, &message_green_0, &message_vibro_off, - NULL - }; + NULL}; static const NotificationSequence unknown_seq = { - &message_red_255, - &message_delay_50, - &message_red_0, - NULL - }; + &message_red_255, &message_delay_50, &message_red_0, NULL}; - if (decoded) + if(decoded) notification_message(app->notification, &decoded_seq); else notification_message(app->notification, &unknown_seq); @@ -149,57 +142,59 @@ void notify_signal_detected(ProtoViewApp *app, bool decoded) { * in order to find a coherent signal. If a signal that does not appear to * be just noise is found, it is set in DetectedSamples global signal * buffer, that is what is rendered on the screen. */ -void scan_for_signal(ProtoViewApp *app, RawSamplesBuffer *source) { +void scan_for_signal(ProtoViewApp* app, RawSamplesBuffer* source) { /* We need to work on a copy: the source buffer may be populated * by the background thread receiving data. */ - RawSamplesBuffer *copy = raw_samples_alloc(); - raw_samples_copy(copy,source); + RawSamplesBuffer* copy = raw_samples_alloc(); + raw_samples_copy(copy, source); /* Try to seek on data that looks to have a regular high low high low * pattern. */ - uint32_t minlen = 18; /* Min run of coherent samples. With less + uint32_t minlen = 18; /* Min run of coherent samples. With less than a few samples it's very easy to mistake noise for signal. */ uint32_t i = 0; - while (i < copy->total-1) { - uint32_t thislen = search_coherent_signal(copy,i); + while(i < copy->total - 1) { + uint32_t thislen = search_coherent_signal(copy, i); /* For messages that are long enough, attempt decoding. */ - if (thislen > minlen) { + if(thislen > minlen) { /* Allocate the message information that some decoder may * fill, in case it is able to decode a message. */ - ProtoViewMsgInfo *info = malloc(sizeof(ProtoViewMsgInfo)); - init_msg_info(info,app); + ProtoViewMsgInfo* info = malloc(sizeof(ProtoViewMsgInfo)); + init_msg_info(info, app); info->short_pulse_dur = copy->short_pulse_dur; uint32_t saved_idx = copy->idx; /* Save index, see later. */ /* decode_signal() expects the detected signal to start * from index zero .*/ - raw_samples_center(copy,i); - bool decoded = decode_signal(copy,thislen,info); + raw_samples_center(copy, i); + bool decoded = decode_signal(copy, thislen, info); copy->idx = saved_idx; /* Restore the index as we are scanning the signal in the loop. */ /* Accept this signal as the new signal if either it's longer * than the previous undecoded one, or the previous one was * unknown and this is decoded. */ - if ((thislen > app->signal_bestlen && app->signal_decoded == false) - || (app->signal_decoded == false && decoded)) - { + if((thislen > app->signal_bestlen && app->signal_decoded == false) || + (app->signal_decoded == false && decoded)) { free_msg_info(app->msg_info); app->msg_info = info; app->signal_bestlen = thislen; app->signal_decoded = decoded; - raw_samples_copy(DetectedSamples,copy); - raw_samples_center(DetectedSamples,i); - FURI_LOG_E(TAG, "===> Displayed sample updated (%d samples %lu us)", - (int)thislen, DetectedSamples->short_pulse_dur); + raw_samples_copy(DetectedSamples, copy); + raw_samples_center(DetectedSamples, i); + FURI_LOG_E( + TAG, + "===> Displayed sample updated (%d samples %lu us)", + (int)thislen, + DetectedSamples->short_pulse_dur); - adjust_raw_view_scale(app,DetectedSamples->short_pulse_dur); - notify_signal_detected(app,decoded); + adjust_raw_view_scale(app, DetectedSamples->short_pulse_dur); + notify_signal_detected(app, decoded); } else { /* If the structure was not filled, discard it. Otherwise * now the owner is app->msg_info. */ @@ -227,38 +222,42 @@ void scan_for_signal(ProtoViewApp *app, RawSamplesBuffer *source) { /* Set the 'bitpos' bit to value 'val', in the specified bitmap * 'b' of len 'blen'. * Out of range bits will silently be discarded. */ -void bitmap_set(uint8_t *b, uint32_t blen, uint32_t bitpos, bool val) { - uint32_t byte = bitpos/8; - uint32_t bit = 7-(bitpos&7); - if (byte >= blen) return; - if (val) - b[byte] |= 1<= blen) return; + if(val) + b[byte] |= 1 << bit; else - b[byte] &= ~(1<= blen) return 0; - return (b[byte] & (1<= blen) return 0; + return (b[byte] & (1 << bit)) != 0; } /* Copy 'count' bits from the bitmap 's' of 'slen' total bytes, to the * bitmap 'd' of 'dlen' total bytes. The bits are copied starting from * offset 'soff' of the source bitmap to the offset 'doff' of the * destination bitmap. */ -void bitmap_copy(uint8_t *d, uint32_t dlen, uint32_t doff, - uint8_t *s, uint32_t slen, uint32_t soff, - uint32_t count) -{ +void bitmap_copy( + uint8_t* d, + uint32_t dlen, + uint32_t doff, + uint8_t* s, + uint32_t slen, + uint32_t soff, + uint32_t count) { /* If we are byte-aligned in both source and destination, use a fast * path for the number of bytes we can consume this way. */ - if ((doff & 7) == 0 && (soff & 7) == 0) { - uint32_t didx = doff/8; - uint32_t sidx = soff/8; + if((doff & 7) == 0 && (soff & 7) == 0) { + uint32_t didx = doff / 8; + uint32_t sidx = soff / 8; while(count > 8 && didx < dlen && sidx < slen) { d[didx++] = s[sidx++]; count -= 8; @@ -271,9 +270,9 @@ void bitmap_copy(uint8_t *d, uint32_t dlen, uint32_t doff, /* Copy the bits needed to reach an offset where we can copy * two half bytes of src to a full byte of destination. */ - while(count > 8 && (doff&7) != 0) { - bool bit = bitmap_get(s,slen,soff++); - bitmap_set(d,dlen,doff++,bit); + while(count > 8 && (doff & 7) != 0) { + bool bit = bitmap_get(s, slen, soff++); + bitmap_set(d, dlen, doff++, bit); count--; } @@ -316,13 +315,12 @@ void bitmap_copy(uint8_t *d, uint32_t dlen, uint32_t doff, * src[2] << 5, that is "WORLDS!!" >> 5 = ".....WOR" * That is "HELLOWOR" */ - if (count > 8) { + if(count > 8) { uint8_t skew = soff % 8; /* Don't worry, compiler will optimize. */ - uint32_t didx = doff/8; - uint32_t sidx = soff/8; + uint32_t didx = doff / 8; + uint32_t sidx = soff / 8; while(count > 8 && didx < dlen && sidx < slen) { - d[didx] = ((s[sidx] << skew) | - (s[sidx+1] >> (8-skew))); + d[didx] = ((s[sidx] << skew) | (s[sidx + 1] >> (8 - skew))); sidx++; didx++; soff += 8; @@ -334,8 +332,8 @@ void bitmap_copy(uint8_t *d, uint32_t dlen, uint32_t doff, /* Here count is guaranteed to be < 8. * Copy the final bits bit by bit. */ while(count) { - bool bit = bitmap_get(s,slen,soff++); - bitmap_set(d,dlen,doff++,bit); + bool bit = bitmap_get(s, slen, soff++); + bitmap_set(d, dlen, doff++, bit); count--; } } @@ -343,15 +341,15 @@ void bitmap_copy(uint8_t *d, uint32_t dlen, uint32_t doff, /* We decode bits assuming the first bit we receive is the MSB * (see bitmap_set/get functions). Certain devices send data * encoded in the reverse way. */ -void bitmap_reverse_bytes_bits(uint8_t *p, uint32_t len) { - for (uint32_t j = 0; j < len; j++) { +void bitmap_reverse_bytes_bits(uint8_t* p, uint32_t len) { + for(uint32_t j = 0; j < len; j++) { uint32_t b = p[j]; /* Step 1: swap the two nibbles: 12345678 -> 56781234 */ - b = (b&0xf0)>>4 | (b&0x0f)<<4; + b = (b & 0xf0) >> 4 | (b & 0x0f) << 4; /* Step 2: swap adjacent pairs : 56781234 -> 78563412 */ - b = (b&0xcc)>>2 | (b&0x33)<<2; + b = (b & 0xcc) >> 2 | (b & 0x33) << 2; /* Step 3: swap adjacent bits : 78563412 -> 87654321 */ - b = (b&0xaa)>>1 | (b&0x55)<<1; + b = (b & 0xaa) >> 1 | (b & 0x55) << 1; p[j] = b; } } @@ -359,10 +357,10 @@ void bitmap_reverse_bytes_bits(uint8_t *p, uint32_t len) { /* Return true if the specified sequence of bits, provided as a string in the * form "11010110..." is found in the 'b' bitmap of 'blen' bits at 'bitpos' * position. */ -bool bitmap_match_bits(uint8_t *b, uint32_t blen, uint32_t bitpos, const char *bits) { - for (size_t j = 0; bits[j]; j++) { +bool bitmap_match_bits(uint8_t* b, uint32_t blen, uint32_t bitpos, const char* bits) { + for(size_t j = 0; bits[j]; j++) { bool expected = (bits[j] == '1') ? true : false; - if (bitmap_get(b,blen,bitpos+j) != expected) return false; + if(bitmap_get(b, blen, bitpos + j) != expected) return false; } return true; } @@ -375,12 +373,17 @@ bool bitmap_match_bits(uint8_t *b, uint32_t blen, uint32_t bitpos, const char *b * Note: there are better algorithms, such as Boyer-Moore. Here we hope that * for the kind of patterns we search we'll have a lot of early stops so * we use a vanilla approach. */ -uint32_t bitmap_seek_bits(uint8_t *b, uint32_t blen, uint32_t startpos, uint32_t maxbits, const char *bits) { - uint32_t endpos = startpos+blen*8; - uint32_t end2 = startpos+maxbits; - if (end2 < endpos) endpos = end2; - for (uint32_t j = startpos; j < endpos; j++) - if (bitmap_match_bits(b,blen,j,bits)) return j; +uint32_t bitmap_seek_bits( + uint8_t* b, + uint32_t blen, + uint32_t startpos, + uint32_t maxbits, + const char* bits) { + uint32_t endpos = startpos + blen * 8; + uint32_t end2 = startpos + maxbits; + if(end2 < endpos) endpos = end2; + for(uint32_t j = startpos; j < endpos; j++) + if(bitmap_match_bits(b, blen, j, bits)) return j; return BITMAP_SEEK_NOT_FOUND; } @@ -391,10 +394,10 @@ uint32_t bitmap_seek_bits(uint8_t *b, uint32_t blen, uint32_t startpos, uint32_t * This function is useful in order to set the test vectors in the protocol * decoders, to see if the decoding works regardless of the fact we are able * to actually receive a given signal. */ -void bitmap_set_pattern(uint8_t *b, uint32_t blen, uint32_t off, const char *pat) { +void bitmap_set_pattern(uint8_t* b, uint32_t blen, uint32_t off, const char* pat) { uint32_t i = 0; while(pat[i]) { - bitmap_set(b,blen,i+off,pat[i] == '1'); + bitmap_set(b, blen, i + off, pat[i] == '1'); i++; } } @@ -426,31 +429,36 @@ void bitmap_set_pattern(uint8_t *b, uint32_t blen, uint32_t off, const char *pat * bits set into the buffer 'b'. The 'rate' argument, in microseconds, is * the detected short-pulse duration. We expect the line code to be * meaningful when interpreted at multiples of 'rate'. */ -uint32_t convert_signal_to_bits(uint8_t *b, uint32_t blen, RawSamplesBuffer *s, uint32_t idx, uint32_t count, uint32_t rate) { - if (rate == 0) return 0; /* We can't perform the conversion. */ +uint32_t convert_signal_to_bits( + uint8_t* b, + uint32_t blen, + RawSamplesBuffer* s, + uint32_t idx, + uint32_t count, + uint32_t rate) { + if(rate == 0) return 0; /* We can't perform the conversion. */ uint32_t bitpos = 0; - for (uint32_t j = 0; j < count; j++) { + for(uint32_t j = 0; j < count; j++) { uint32_t dur; bool level; - raw_samples_get(s, j+idx, &level, &dur); + raw_samples_get(s, j + idx, &level, &dur); uint32_t numbits = dur / rate; /* full bits that surely fit. */ - uint32_t rest = dur % rate; /* How much we are left with. */ - if (rest > rate/2) numbits++; /* There is another one. */ + uint32_t rest = dur % rate; /* How much we are left with. */ + if(rest > rate / 2) numbits++; /* There is another one. */ /* Limit how much a single sample can spawn. There are likely no * protocols doing such long pulses when the rate is low. */ - if (numbits > 1024) numbits = 1024; + if(numbits > 1024) numbits = 1024; - if (0) /* Super verbose, so not under the DEBUG_MSG define. */ - FURI_LOG_E(TAG, "%lu converted into %lu (%d) bits", - dur,numbits,(int)level); + if(0) /* Super verbose, so not under the DEBUG_MSG define. */ + FURI_LOG_E(TAG, "%lu converted into %lu (%d) bits", dur, numbits, (int)level); /* If the signal is too short, let's claim it an interference * and ignore it completely. */ - if (numbits == 0) continue; + if(numbits == 0) continue; - while(numbits--) bitmap_set(b,blen,bitpos++,level); + while(numbits--) bitmap_set(b, blen, bitpos++, level); } return bitpos; } @@ -467,23 +475,29 @@ uint32_t convert_signal_to_bits(uint8_t *b, uint32_t blen, RawSamplesBuffer *s, * specified in bytes by the caller, via the 'len' parameters). * * The decoding starts at the specified offset (in bits) 'off'. */ -uint32_t convert_from_line_code(uint8_t *buf, uint64_t buflen, uint8_t *bits, uint32_t len, uint32_t off, const char *zero_pattern, const char *one_pattern) -{ +uint32_t convert_from_line_code( + uint8_t* buf, + uint64_t buflen, + uint8_t* bits, + uint32_t len, + uint32_t off, + const char* zero_pattern, + const char* one_pattern) { uint32_t decoded = 0; /* Number of bits extracted. */ len *= 8; /* Convert bytes to bits. */ while(off < len) { bool bitval; - if (bitmap_match_bits(bits,len,off,zero_pattern)) { + if(bitmap_match_bits(bits, len, off, zero_pattern)) { bitval = false; off += strlen(zero_pattern); - } else if (bitmap_match_bits(bits,len,off,one_pattern)) { + } else if(bitmap_match_bits(bits, len, off, one_pattern)) { bitval = true; off += strlen(one_pattern); } else { break; } - bitmap_set(buf,buflen,decoded++,bitval); - if (decoded/8 == buflen) break; /* No space left on target buffer. */ + bitmap_set(buf, buflen, decoded++, bitval); + if(decoded / 8 == buflen) break; /* No space left on target buffer. */ } return decoded; } @@ -494,17 +508,22 @@ uint32_t convert_from_line_code(uint8_t *buf, uint64_t buflen, uint8_t *bits, ui * in differential codings the next bits depend on the previous one. * * Parameters and return values are like convert_from_line_code(). */ -uint32_t convert_from_diff_manchester(uint8_t *buf, uint64_t buflen, uint8_t *bits, uint32_t len, uint32_t off, bool previous) -{ +uint32_t convert_from_diff_manchester( + uint8_t* buf, + uint64_t buflen, + uint8_t* bits, + uint32_t len, + uint32_t off, + bool previous) { uint32_t decoded = 0; len *= 8; /* Conver to bits. */ - for (uint32_t j = off; j < len; j += 2) { - bool b0 = bitmap_get(bits,len,j); - bool b1 = bitmap_get(bits,len,j+1); - if (b0 == previous) break; /* Each new bit must switch value. */ - bitmap_set(buf,buflen,decoded++,b0 == b1); + for(uint32_t j = off; j < len; j += 2) { + bool b0 = bitmap_get(bits, len, j); + bool b1 = bitmap_get(bits, len, j + 1); + if(b0 == previous) break; /* Each new bit must switch value. */ + bitmap_set(buf, buflen, decoded++, b0 == b1); previous = b1; - if (decoded/8 == buflen) break; /* No space left on target buffer. */ + if(decoded / 8 == buflen) break; /* No space left on target buffer. */ } return decoded; } @@ -522,22 +541,21 @@ extern ProtoViewDecoder CitroenTPMSDecoder; extern ProtoViewDecoder FordTPMSDecoder; extern ProtoViewDecoder KeeloqDecoder; -ProtoViewDecoder *Decoders[] = { - &Oregon2Decoder, /* Oregon sensors v2.1 protocol. */ - &B4B1Decoder, /* PT, SC, ... 24 bits remotes. */ - &RenaultTPMSDecoder, /* Renault TPMS. */ - &ToyotaTPMSDecoder, /* Toyota TPMS. */ - &SchraderTPMSDecoder, /* Schrader TPMS. */ - &SchraderEG53MA4TPMSDecoder, /* Schrader EG53MA4 TPMS. */ - &CitroenTPMSDecoder, /* Citroen TPMS. */ - &FordTPMSDecoder, /* Ford TPMS. */ - &KeeloqDecoder, /* Keeloq remote. */ - NULL -}; +ProtoViewDecoder* Decoders[] = { + &Oregon2Decoder, /* Oregon sensors v2.1 protocol. */ + &B4B1Decoder, /* PT, SC, ... 24 bits remotes. */ + &RenaultTPMSDecoder, /* Renault TPMS. */ + &ToyotaTPMSDecoder, /* Toyota TPMS. */ + &SchraderTPMSDecoder, /* Schrader TPMS. */ + &SchraderEG53MA4TPMSDecoder, /* Schrader EG53MA4 TPMS. */ + &CitroenTPMSDecoder, /* Citroen TPMS. */ + &FordTPMSDecoder, /* Ford TPMS. */ + &KeeloqDecoder, /* Keeloq remote. */ + NULL}; /* Free the message info and allocated data. */ -void free_msg_info(ProtoViewMsgInfo *i) { - if (i == NULL) return; +void free_msg_info(ProtoViewMsgInfo* i) { + if(i == NULL) return; fieldset_free(i->fieldset); free(i->bits); free(i); @@ -545,9 +563,9 @@ void free_msg_info(ProtoViewMsgInfo *i) { /* Reset the message info structure before passing it to the decoding * functions. */ -void init_msg_info(ProtoViewMsgInfo *i, ProtoViewApp *app) { +void init_msg_info(ProtoViewMsgInfo* i, ProtoViewApp* app) { UNUSED(app); - memset(i,0,sizeof(ProtoViewMsgInfo)); + memset(i, 0, sizeof(ProtoViewMsgInfo)); i->bits = NULL; i->fieldset = fieldset_new(); } @@ -556,23 +574,29 @@ void init_msg_info(ProtoViewMsgInfo *i, ProtoViewApp *app) { * to a bitstream, and the calls the protocol specific functions for * decoding. If the signal was decoded correctly by some protocol, true * is returned. Otherwise false is returned. */ -bool decode_signal(RawSamplesBuffer *s, uint64_t len, ProtoViewMsgInfo *info) { - uint32_t bitmap_bits_size = 4096*8; - uint32_t bitmap_size = bitmap_bits_size/8; +bool decode_signal(RawSamplesBuffer* s, uint64_t len, ProtoViewMsgInfo* info) { + uint32_t bitmap_bits_size = 4096 * 8; + uint32_t bitmap_size = bitmap_bits_size / 8; /* We call the decoders with an offset a few samples before the actual * signal detected and for a len of a few bits after its end. */ uint32_t before_samples = 32; uint32_t after_samples = 100; - uint8_t *bitmap = malloc(bitmap_size); - uint32_t bits = convert_signal_to_bits(bitmap,bitmap_size,s,-before_samples,len+before_samples+after_samples,s->short_pulse_dur); + uint8_t* bitmap = malloc(bitmap_size); + uint32_t bits = convert_signal_to_bits( + bitmap, + bitmap_size, + s, + -before_samples, + len + before_samples + after_samples, + s->short_pulse_dur); - if (DEBUG_MSG) { /* Useful for debugging purposes. Don't remove. */ - char *str = malloc(1024); + if(DEBUG_MSG) { /* Useful for debugging purposes. Don't remove. */ + char* str = malloc(1024); uint32_t j; - for (j = 0; j < bits && j < 1023; j++) { - str[j] = bitmap_get(bitmap,bitmap_size,j) ? '1' : '0'; + for(j = 0; j < bits && j < 1023; j++) { + str[j] = bitmap_get(bitmap, bitmap_size, j) ? '1' : '0'; } str[j] = 0; FURI_LOG_E(TAG, "%lu bits sampled: %s", bits, str); @@ -585,18 +609,17 @@ bool decode_signal(RawSamplesBuffer *s, uint64_t len, ProtoViewMsgInfo *info) { bool decoded = false; while(Decoders[j]) { uint32_t start_time = furi_get_tick(); - decoded = Decoders[j]->decode(bitmap,bitmap_size,bits,info); + decoded = Decoders[j]->decode(bitmap, bitmap_size, bits, info); uint32_t delta = furi_get_tick() - start_time; - FURI_LOG_E(TAG, "Decoder %s took %lu ms", - Decoders[j]->name, (unsigned long)delta); - if (decoded) { + FURI_LOG_E(TAG, "Decoder %s took %lu ms", Decoders[j]->name, (unsigned long)delta); + if(decoded) { info->decoder = Decoders[j]; break; } j++; } - if (!decoded) { + if(!decoded) { FURI_LOG_E(TAG, "No decoding possible"); } else { FURI_LOG_E(TAG, "+++ Decoded %s", info->decoder->name); @@ -604,12 +627,17 @@ bool decode_signal(RawSamplesBuffer *s, uint64_t len, ProtoViewMsgInfo *info) { * with the decoded signal. The decoder may not implement offset/len * filling of the structure. In such case we have no info and * pulses_count will be set to zero. */ - if (info->pulses_count) { - info->bits_bytes = (info->pulses_count+7)/8; // Round to full byte. + if(info->pulses_count) { + info->bits_bytes = (info->pulses_count + 7) / 8; // Round to full byte. info->bits = malloc(info->bits_bytes); - bitmap_copy(info->bits,info->bits_bytes,0, - bitmap,bitmap_size,info->start_off, - info->pulses_count); + bitmap_copy( + info->bits, + info->bits_bytes, + 0, + bitmap, + bitmap_size, + info->start_off, + info->pulses_count); } } free(bitmap); diff --git a/applications/plugins/protoview/signal_file.c b/applications/plugins/protoview/signal_file.c index 31c8726fb..c60a6a181 100644 --- a/applications/plugins/protoview/signal_file.c +++ b/applications/plugins/protoview/signal_file.c @@ -13,57 +13,56 @@ * but it's logical representation stored in the app->msg_info bitmap, where * each 1 or 0 means a puls or gap for the specified short pulse duration time * (te). */ -bool save_signal(ProtoViewApp *app, const char *filename) { +bool save_signal(ProtoViewApp* app, const char* filename) { /* We have a message at all? */ - if (app->msg_info == NULL || app->msg_info->pulses_count == 0) return false; - - Storage *storage = furi_record_open(RECORD_STORAGE); - FlipperFormat *file = flipper_format_file_alloc(storage); - Stream *stream = flipper_format_get_raw_stream(file); - FuriString *file_content = NULL; + if(app->msg_info == NULL || app->msg_info->pulses_count == 0) return false; + + Storage* storage = furi_record_open(RECORD_STORAGE); + FlipperFormat* file = flipper_format_file_alloc(storage); + Stream* stream = flipper_format_get_raw_stream(file); + FuriString* file_content = NULL; bool success = true; - if (flipper_format_file_open_always(file, filename)) { + if(flipper_format_file_open_always(file, filename)) { /* Write the file header. */ - FuriString *file_content = furi_string_alloc(); - const char *preset_id = ProtoViewModulations[app->modulation].id; + FuriString* file_content = furi_string_alloc(); + const char* preset_id = ProtoViewModulations[app->modulation].id; - furi_string_printf(file_content, - "Filetype: Flipper SubGhz RAW File\n" - "Version: 1\n" - "Frequency: %ld\n" - "Preset: %s\n", - app->frequency, - preset_id ? preset_id : "FuriHalSubGhzPresetCustom"); + furi_string_printf( + file_content, + "Filetype: Flipper SubGhz RAW File\n" + "Version: 1\n" + "Frequency: %ld\n" + "Preset: %s\n", + app->frequency, + preset_id ? preset_id : "FuriHalSubGhzPresetCustom"); /* For custom modulations, we need to emit a set of registers. */ - if (preset_id == NULL) { - FuriString *custom = furi_string_alloc(); - uint8_t *regs = ProtoViewModulations[app->modulation].custom; - furi_string_printf(custom, + if(preset_id == NULL) { + FuriString* custom = furi_string_alloc(); + uint8_t* regs = ProtoViewModulations[app->modulation].custom; + furi_string_printf( + custom, "Custom_preset_module: CC1101\n" - "Custom_preset_data: "); - for (int j = 0; regs[j]; j += 2) { - furi_string_cat_printf(custom, "%02X %02X ", - (int)regs[j], (int)regs[j+1]); + "Custom_preset_data: "); + for(int j = 0; regs[j]; j += 2) { + furi_string_cat_printf(custom, "%02X %02X ", (int)regs[j], (int)regs[j + 1]); } size_t len = furi_string_size(file_content); - furi_string_set_char(custom,len-1,'\n'); - furi_string_cat(file_content,custom); + furi_string_set_char(custom, len - 1, '\n'); + furi_string_cat(file_content, custom); furi_string_free(custom); } /* We always save raw files. */ - furi_string_cat_printf(file_content, - "Protocol: RAW\n" - "RAW_Data: -10000\n"); // Start with 10 ms of gap + furi_string_cat_printf( + file_content, + "Protocol: RAW\n" + "RAW_Data: -10000\n"); // Start with 10 ms of gap /* Write header. */ size_t len = furi_string_size(file_content); - if (stream_write(stream, - (uint8_t*) furi_string_get_cstr(file_content), len) - != len) - { + if(stream_write(stream, (uint8_t*)furi_string_get_cstr(file_content), len) != len) { FURI_LOG_W(TAG, "Short write to file"); success = false; goto write_err; @@ -76,15 +75,13 @@ bool save_signal(ProtoViewApp *app, const char *filename) { uint32_t this_line_samples = 0; uint32_t max_line_samples = 100; uint32_t idx = 0; // Iindex in the signal bitmap. - ProtoViewMsgInfo *i = app->msg_info; + ProtoViewMsgInfo* i = app->msg_info; while(idx < i->pulses_count) { - bool level = bitmap_get(i->bits,i->bits_bytes,idx); + bool level = bitmap_get(i->bits, i->bits_bytes, idx); uint32_t te_times = 1; idx++; /* Count the duration of the current pulse/gap. */ - while(idx < i->pulses_count && - bitmap_get(i->bits,i->bits_bytes,idx) == level) - { + while(idx < i->pulses_count && bitmap_get(i->bits, i->bits_bytes, idx) == level) { te_times++; idx++; } @@ -92,32 +89,29 @@ bool save_signal(ProtoViewApp *app, const char *filename) { // next gap or pulse. int32_t dur = (int32_t)i->short_pulse_dur * te_times; - if (level == 0) dur = -dur; /* Negative is gap in raw files. */ + if(level == 0) dur = -dur; /* Negative is gap in raw files. */ /* Emit the sample. If this is the first sample of the line, * also emit the RAW_Data: field. */ - if (this_line_samples == 0) - furi_string_cat_printf(file_content,"RAW_Data: "); - furi_string_cat_printf(file_content,"%d ",(int)dur); + if(this_line_samples == 0) furi_string_cat_printf(file_content, "RAW_Data: "); + furi_string_cat_printf(file_content, "%d ", (int)dur); this_line_samples++; /* Store the current set of samples on disk, when we reach a * given number or the end of the signal. */ bool end_reached = (idx == i->pulses_count); - if (this_line_samples == max_line_samples || end_reached) { + if(this_line_samples == max_line_samples || end_reached) { /* If that's the end, terminate the signal with a long * gap. */ - if (end_reached) furi_string_cat_printf(file_content,"-10000 "); + if(end_reached) furi_string_cat_printf(file_content, "-10000 "); /* We always have a trailing space in the last sample. Make it * a newline. */ size_t len = furi_string_size(file_content); - furi_string_set_char(file_content,len-1,'\n'); + furi_string_set_char(file_content, len - 1, '\n'); - if (stream_write(stream, - (uint8_t*) furi_string_get_cstr(file_content), - len) != len) - { + if(stream_write(stream, (uint8_t*)furi_string_get_cstr(file_content), len) != + len) { FURI_LOG_W(TAG, "Short write to file"); success = false; goto write_err; @@ -136,6 +130,6 @@ bool save_signal(ProtoViewApp *app, const char *filename) { write_err: furi_record_close(RECORD_STORAGE); flipper_format_free(file); - if (file_content != NULL) furi_string_free(file_content); + if(file_content != NULL) furi_string_free(file_content); return success; } diff --git a/applications/plugins/protoview/ui.c b/applications/plugins/protoview/ui.c index 8badab5bf..b0251f09f 100644 --- a/applications/plugins/protoview/ui.c +++ b/applications/plugins/protoview/ui.c @@ -10,36 +10,31 @@ /* Return the ID of the currently selected subview, of the current * view. */ -int ui_get_current_subview(ProtoViewApp *app) { +int ui_get_current_subview(ProtoViewApp* app) { return app->current_subview[app->current_view]; } /* Called by view rendering callback that has subviews, to show small triangles * facing down/up if there are other subviews the user can access with up * and down. */ -void ui_show_available_subviews(Canvas *canvas, ProtoViewApp *app, - int last_subview) -{ +void ui_show_available_subviews(Canvas* canvas, ProtoViewApp* app, int last_subview) { int subview = ui_get_current_subview(app); - if (subview != 0) - canvas_draw_triangle(canvas,120,5,8,5,CanvasDirectionBottomToTop); - if (subview != last_subview-1) - canvas_draw_triangle(canvas,120,59,8,5,CanvasDirectionTopToBottom); + if(subview != 0) canvas_draw_triangle(canvas, 120, 5, 8, 5, CanvasDirectionBottomToTop); + if(subview != last_subview - 1) + canvas_draw_triangle(canvas, 120, 59, 8, 5, CanvasDirectionTopToBottom); } /* Handle up/down keys when we are in a subview. If the function catched * such keypress, it returns true, so that the actual view input callback * knows it can just return ASAP without doing anything. */ -bool ui_process_subview_updown(ProtoViewApp *app, InputEvent input, int last_subview) { +bool ui_process_subview_updown(ProtoViewApp* app, InputEvent input, int last_subview) { int subview = ui_get_current_subview(app); - if (input.type == InputTypePress) { - if (input.key == InputKeyUp) { - if (subview != 0) - app->current_subview[app->current_view]--; + if(input.type == InputTypePress) { + if(input.key == InputKeyUp) { + if(subview != 0) app->current_subview[app->current_view]--; return true; - } else if (input.key == InputKeyDown) { - if (subview != last_subview-1) - app->current_subview[app->current_view]++; + } else if(input.key == InputKeyDown) { + if(subview != last_subview - 1) app->current_subview[app->current_view]++; return true; } } @@ -62,16 +57,18 @@ bool ui_process_subview_updown(ProtoViewApp *app, InputEvent input, int last_sub * * Note: if the buffer is not a null-termined zero string, what it contains will * be used as initial input for the user. */ -void ui_show_keyboard(ProtoViewApp *app, char *buffer, uint32_t buflen, - void (*done_callback)(void*)) -{ +void ui_show_keyboard( + ProtoViewApp* app, + char* buffer, + uint32_t buflen, + void (*done_callback)(void*)) { app->show_text_input = true; app->text_input_buffer = buffer; app->text_input_buffer_len = buflen; app->text_input_done_callback = done_callback; } -void ui_dismiss_keyboard(ProtoViewApp *app) { +void ui_dismiss_keyboard(ProtoViewApp* app) { view_dispatcher_stop(app->view_dispatcher); } @@ -79,24 +76,24 @@ void ui_dismiss_keyboard(ProtoViewApp *app) { /* Set an alert message to be shown over any currently active view, for * the specified amount of time of 'ttl' milliseconds. */ -void ui_show_alert(ProtoViewApp *app, const char *text, uint32_t ttl) { +void ui_show_alert(ProtoViewApp* app, const char* text, uint32_t ttl) { app->alert_dismiss_time = furi_get_tick() + furi_ms_to_ticks(ttl); - snprintf(app->alert_text,ALERT_MAX_LEN,"%s",text); + snprintf(app->alert_text, ALERT_MAX_LEN, "%s", text); } /* Cancel the alert before its time has elapsed. */ -void ui_dismiss_alert(ProtoViewApp *app) { +void ui_dismiss_alert(ProtoViewApp* app) { app->alert_dismiss_time = 0; } /* Show the alert if an alert is set. This is called after the currently * active view displayed its stuff, so we overwrite the screen with the * alert message. */ -void ui_draw_alert_if_needed(Canvas *canvas, ProtoViewApp *app) { - if (app->alert_dismiss_time == 0) { +void ui_draw_alert_if_needed(Canvas* canvas, ProtoViewApp* app) { + if(app->alert_dismiss_time == 0) { /* No active alert. */ return; - } else if (app->alert_dismiss_time < furi_get_tick()) { + } else if(app->alert_dismiss_time < furi_get_tick()) { /* Alert just expired. */ ui_dismiss_alert(app); return; @@ -106,41 +103,43 @@ void ui_draw_alert_if_needed(Canvas *canvas, ProtoViewApp *app) { canvas_set_font(canvas, FontPrimary); uint8_t w = canvas_string_width(canvas, app->alert_text); uint8_t h = 8; // Font height. - uint8_t text_x = 64-(w/2); - uint8_t text_y = 32+4; + uint8_t text_x = 64 - (w / 2); + uint8_t text_y = 32 + 4; uint8_t padding = 3; - canvas_set_color(canvas,ColorBlack); - canvas_draw_box(canvas,text_x-padding,text_y-padding-h,w+padding*2,h+padding*2); - canvas_set_color(canvas,ColorWhite); - canvas_draw_box(canvas,text_x-padding+1,text_y-padding-h+1,w+padding*2-2,h+padding*2-2); - canvas_set_color(canvas,ColorBlack); - canvas_draw_str(canvas,text_x,text_y,app->alert_text); + canvas_set_color(canvas, ColorBlack); + canvas_draw_box( + canvas, text_x - padding, text_y - padding - h, w + padding * 2, h + padding * 2); + canvas_set_color(canvas, ColorWhite); + canvas_draw_box( + canvas, + text_x - padding + 1, + text_y - padding - h + 1, + w + padding * 2 - 2, + h + padding * 2 - 2); + canvas_set_color(canvas, ColorBlack); + canvas_draw_str(canvas, text_x, text_y, app->alert_text); } /* =========================== Canvas extensions ============================ */ -void canvas_draw_str_with_border(Canvas* canvas, uint8_t x, uint8_t y, const char* str, Color text_color, Color border_color) -{ +void canvas_draw_str_with_border( + Canvas* canvas, + uint8_t x, + uint8_t y, + const char* str, + Color text_color, + Color border_color) { struct { - uint8_t x; uint8_t y; - } dir[8] = { - {-1,-1}, - {0,-1}, - {1,-1}, - {1,0}, - {1,1}, - {0,1}, - {-1,1}, - {-1,0} - }; + uint8_t x; + uint8_t y; + } dir[8] = {{-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}}; /* Rotate in all the directions writing the same string to create a * border, then write the actual string in the other color in the * middle. */ canvas_set_color(canvas, border_color); - for (int j = 0; j < 8; j++) - canvas_draw_str(canvas,x+dir[j].x,y+dir[j].y,str); + for(int j = 0; j < 8; j++) canvas_draw_str(canvas, x + dir[j].x, y + dir[j].y, str); canvas_set_color(canvas, text_color); - canvas_draw_str(canvas,x,y,str); + canvas_draw_str(canvas, x, y, str); canvas_set_color(canvas, ColorBlack); } diff --git a/applications/plugins/protoview/view_build.c b/applications/plugins/protoview/view_build.c index fd276b61d..955855902 100644 --- a/applications/plugins/protoview/view_build.c +++ b/applications/plugins/protoview/view_build.c @@ -3,39 +3,38 @@ #include "app.h" -extern ProtoViewDecoder *Decoders[]; // Defined in signal.c. +extern ProtoViewDecoder* Decoders[]; // Defined in signal.c. /* Our view private data. */ #define USER_VALUE_LEN 64 typedef struct { - ProtoViewDecoder *decoder; /* Decoder we are using to create a + ProtoViewDecoder* decoder; /* Decoder we are using to create a message. */ - uint32_t cur_decoder; /* Decoder index when we are yet selecting + uint32_t cur_decoder; /* Decoder index when we are yet selecting a decoder. Used when decoder is NULL. */ - ProtoViewFieldSet *fieldset; /* The fields to populate. */ - uint32_t cur_field; /* Field we are editing right now. This + ProtoViewFieldSet* fieldset; /* The fields to populate. */ + uint32_t cur_field; /* Field we are editing right now. This is the index inside the 'fieldset' fields. */ - char *user_value; /* Keyboard input to replace the current + char* user_value; /* Keyboard input to replace the current field value goes here. */ } BuildViewPrivData; /* Not all the decoders support message bulding, so we can't just * increment / decrement the cur_decoder index here. */ -static void select_next_decoder(ProtoViewApp *app) { - BuildViewPrivData *privdata = app->view_privdata; - do { +static void select_next_decoder(ProtoViewApp* app) { + BuildViewPrivData* privdata = app->view_privdata; + do { privdata->cur_decoder++; - if (Decoders[privdata->cur_decoder] == NULL) - privdata->cur_decoder = 0; + if(Decoders[privdata->cur_decoder] == NULL) privdata->cur_decoder = 0; } while(Decoders[privdata->cur_decoder]->get_fields == NULL); } /* Like select_next_decoder() but goes backward. */ -static void select_prev_decoder(ProtoViewApp *app) { - BuildViewPrivData *privdata = app->view_privdata; +static void select_prev_decoder(ProtoViewApp* app) { + BuildViewPrivData* privdata = app->view_privdata; do { - if (privdata->cur_decoder == 0) { + if(privdata->cur_decoder == 0) { /* Go one after the last one to wrap around. */ while(Decoders[privdata->cur_decoder]) privdata->cur_decoder++; } @@ -45,69 +44,73 @@ static void select_prev_decoder(ProtoViewApp *app) { /* Render the view to select the decoder, among the ones that * support message building. */ -static void render_view_select_decoder(Canvas *const canvas, ProtoViewApp *app) { - BuildViewPrivData *privdata = app->view_privdata; +static void render_view_select_decoder(Canvas* const canvas, ProtoViewApp* app) { + BuildViewPrivData* privdata = app->view_privdata; canvas_set_font(canvas, FontPrimary); canvas_draw_str(canvas, 0, 9, "Signal creator"); canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 0, 19, "up/down: select, ok: choose"); canvas_set_font(canvas, FontPrimary); - canvas_draw_str_aligned(canvas,64,38,AlignCenter,AlignCenter, - Decoders[privdata->cur_decoder]->name); + canvas_draw_str_aligned( + canvas, 64, 38, AlignCenter, AlignCenter, Decoders[privdata->cur_decoder]->name); } /* Render the view that allows the user to populate the fields needed * for the selected decoder to build a message. */ -static void render_view_set_fields(Canvas *const canvas, ProtoViewApp *app) { - BuildViewPrivData *privdata = app->view_privdata; +static void render_view_set_fields(Canvas* const canvas, ProtoViewApp* app) { + BuildViewPrivData* privdata = app->view_privdata; char buf[32]; - snprintf(buf,sizeof(buf), "%s field %d/%d", - privdata->decoder->name, (int)privdata->cur_field+1, + snprintf( + buf, + sizeof(buf), + "%s field %d/%d", + privdata->decoder->name, + (int)privdata->cur_field + 1, (int)privdata->fieldset->numfields); - canvas_set_color(canvas,ColorBlack); - canvas_draw_box(canvas,0,0,128,21); - canvas_set_color(canvas,ColorWhite); + canvas_set_color(canvas, ColorBlack); + canvas_draw_box(canvas, 0, 0, 128, 21); + canvas_set_color(canvas, ColorWhite); canvas_set_font(canvas, FontPrimary); canvas_draw_str(canvas, 1, 9, buf); canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 1, 19, "up/down: next field, ok: edit"); /* Write the field name, type, current content. */ - canvas_set_color(canvas,ColorBlack); - ProtoViewField *field = privdata->fieldset->fields[privdata->cur_field]; - snprintf(buf,sizeof(buf), "%s %s:%d", field->name, - field_get_type_name(field), (int)field->len); + canvas_set_color(canvas, ColorBlack); + ProtoViewField* field = privdata->fieldset->fields[privdata->cur_field]; + snprintf( + buf, sizeof(buf), "%s %s:%d", field->name, field_get_type_name(field), (int)field->len); buf[0] = toupper(buf[0]); canvas_set_font(canvas, FontPrimary); - canvas_draw_str_aligned(canvas,64,30,AlignCenter,AlignCenter,buf); + canvas_draw_str_aligned(canvas, 64, 30, AlignCenter, AlignCenter, buf); canvas_set_font(canvas, FontSecondary); /* Render the current value between "" */ - unsigned int written = (unsigned int) field_to_string(buf+1,sizeof(buf)-1,field); + unsigned int written = (unsigned int)field_to_string(buf + 1, sizeof(buf) - 1, field); buf[0] = '"'; - if (written+3 < sizeof(buf)) memcpy(buf+written+1,"\"\x00",2); - canvas_draw_str_aligned(canvas,63,45,AlignCenter,AlignCenter,buf); + if(written + 3 < sizeof(buf)) memcpy(buf + written + 1, "\"\x00", 2); + canvas_draw_str_aligned(canvas, 63, 45, AlignCenter, AlignCenter, buf); /* Footer instructions. */ canvas_draw_str(canvas, 0, 62, "Long ok: create, < > incr/decr"); } /* Render the build message view. */ -void render_view_build_message(Canvas *const canvas, ProtoViewApp *app) { - BuildViewPrivData *privdata = app->view_privdata; +void render_view_build_message(Canvas* const canvas, ProtoViewApp* app) { + BuildViewPrivData* privdata = app->view_privdata; - if (privdata->decoder) - render_view_set_fields(canvas,app); + if(privdata->decoder) + render_view_set_fields(canvas, app); else - render_view_select_decoder(canvas,app); + render_view_select_decoder(canvas, app); } /* Handle input for the decoder selection. */ -static void process_input_select_decoder(ProtoViewApp *app, InputEvent input) { - BuildViewPrivData *privdata = app->view_privdata; - if (input.type == InputTypeShort) { - if (input.key == InputKeyOk) { +static void process_input_select_decoder(ProtoViewApp* app, InputEvent input) { + BuildViewPrivData* privdata = app->view_privdata; + if(input.type == InputTypeShort) { + if(input.key == InputKeyOk) { privdata->decoder = Decoders[privdata->cur_decoder]; privdata->fieldset = fieldset_new(); privdata->decoder->get_fields(privdata->fieldset); @@ -116,11 +119,8 @@ static void process_input_select_decoder(ProtoViewApp *app, InputEvent input) { * same decoder the user selected, let's populate the * defaults with the current values. So the user will * actaully edit the current message. */ - if (app->signal_decoded && - app->msg_info->decoder == privdata->decoder) - { - fieldset_copy_matching_fields(privdata->fieldset, - app->msg_info->fieldset); + if(app->signal_decoded && app->msg_info->decoder == privdata->decoder) { + fieldset_copy_matching_fields(privdata->fieldset, app->msg_info->fieldset); } /* Now we use the subview system in order to protect the @@ -128,10 +128,10 @@ static void process_input_select_decoder(ProtoViewApp *app, InputEvent input) { Since we are technically into a subview now, we'll have control of < and >. */ InputEvent ii = {.type = InputTypePress, .key = InputKeyDown}; - ui_process_subview_updown(app,ii,2); - } else if (input.key == InputKeyDown) { + ui_process_subview_updown(app, ii, 2); + } else if(input.key == InputKeyDown) { select_next_decoder(app); - } else if (input.key == InputKeyUp) { + } else if(input.key == InputKeyUp) { select_prev_decoder(app); } } @@ -140,12 +140,13 @@ static void process_input_select_decoder(ProtoViewApp *app, InputEvent input) { /* Called after the user typed the new field value in the keyboard. * Let's save it and remove the keyboard view. */ static void text_input_done_callback(void* context) { - ProtoViewApp *app = context; - BuildViewPrivData *privdata = app->view_privdata; + ProtoViewApp* app = context; + BuildViewPrivData* privdata = app->view_privdata; - if (field_set_from_string(privdata->fieldset->fields[privdata->cur_field], - privdata->user_value, strlen(privdata->user_value)) == false) - { + if(field_set_from_string( + privdata->fieldset->fields[privdata->cur_field], + privdata->user_value, + strlen(privdata->user_value)) == false) { ui_show_alert(app, "Invalid value", 1500); } @@ -160,94 +161,88 @@ static void text_input_done_callback(void* context) { * decrement the current field in a much simpler way. * * The current filed is changed by 'incr' amount. */ -static bool increment_current_field(ProtoViewApp *app, int incr) { - BuildViewPrivData *privdata = app->view_privdata; - ProtoViewFieldSet *fs = privdata->fieldset; - ProtoViewField *f = fs->fields[privdata->cur_field]; - return field_incr_value(f,incr); +static bool increment_current_field(ProtoViewApp* app, int incr) { + BuildViewPrivData* privdata = app->view_privdata; + ProtoViewFieldSet* fs = privdata->fieldset; + ProtoViewField* f = fs->fields[privdata->cur_field]; + return field_incr_value(f, incr); } /* Handle input for fields editing mode. */ -static void process_input_set_fields(ProtoViewApp *app, InputEvent input) { - BuildViewPrivData *privdata = app->view_privdata; - ProtoViewFieldSet *fs = privdata->fieldset; +static void process_input_set_fields(ProtoViewApp* app, InputEvent input) { + BuildViewPrivData* privdata = app->view_privdata; + ProtoViewFieldSet* fs = privdata->fieldset; - if (input.type == InputTypeShort && input.key == InputKeyOk) { + if(input.type == InputTypeShort && input.key == InputKeyOk) { /* Show the keyboard to let the user type the new * value. */ - if (privdata->user_value == NULL) - privdata->user_value = malloc(USER_VALUE_LEN); - field_to_string(privdata->user_value, USER_VALUE_LEN, - fs->fields[privdata->cur_field]); - ui_show_keyboard(app, privdata->user_value, USER_VALUE_LEN, - text_input_done_callback); - } else if (input.type == InputTypeShort && input.key == InputKeyDown) { - privdata->cur_field = (privdata->cur_field+1) % fs->numfields; - } else if (input.type == InputTypeShort && input.key == InputKeyUp) { - if (privdata->cur_field == 0) - privdata->cur_field = fs->numfields-1; + if(privdata->user_value == NULL) privdata->user_value = malloc(USER_VALUE_LEN); + field_to_string(privdata->user_value, USER_VALUE_LEN, fs->fields[privdata->cur_field]); + ui_show_keyboard(app, privdata->user_value, USER_VALUE_LEN, text_input_done_callback); + } else if(input.type == InputTypeShort && input.key == InputKeyDown) { + privdata->cur_field = (privdata->cur_field + 1) % fs->numfields; + } else if(input.type == InputTypeShort && input.key == InputKeyUp) { + if(privdata->cur_field == 0) + privdata->cur_field = fs->numfields - 1; else privdata->cur_field--; - } else if (input.type == InputTypeShort && input.key == InputKeyRight) { - increment_current_field(app,1); - } else if (input.type == InputTypeShort && input.key == InputKeyLeft) { - increment_current_field(app,-1); - } else if (input.type == InputTypeRepeat && input.key == InputKeyRight) { + } else if(input.type == InputTypeShort && input.key == InputKeyRight) { + increment_current_field(app, 1); + } else if(input.type == InputTypeShort && input.key == InputKeyLeft) { + increment_current_field(app, -1); + } else if(input.type == InputTypeRepeat && input.key == InputKeyRight) { // The reason why we don't use a large increment directly // is that certain field types only support +1 -1 increments. int times = 10; - while(times--) increment_current_field(app,1); - } else if (input.type == InputTypeRepeat && input.key == InputKeyLeft) { + while(times--) increment_current_field(app, 1); + } else if(input.type == InputTypeRepeat && input.key == InputKeyLeft) { int times = 10; - while(times--) increment_current_field(app,-1); - } else if (input.type == InputTypeLong && input.key == InputKeyOk) { + while(times--) increment_current_field(app, -1); + } else if(input.type == InputTypeLong && input.key == InputKeyOk) { // Build the message in a fresh raw buffer. - if (privdata->decoder->build_message) { - RawSamplesBuffer *rs = raw_samples_alloc(); - privdata->decoder->build_message(rs,privdata->fieldset); + if(privdata->decoder->build_message) { + RawSamplesBuffer* rs = raw_samples_alloc(); + privdata->decoder->build_message(rs, privdata->fieldset); app->signal_decoded = false; // So that the new signal will be - // accepted as the current signal. - scan_for_signal(app,rs); + // accepted as the current signal. + scan_for_signal(app, rs); raw_samples_free(rs); - ui_show_alert(app,"Done: press back key",3000); + ui_show_alert(app, "Done: press back key", 3000); } } } /* Handle input for the build message view. */ -void process_input_build_message(ProtoViewApp *app, InputEvent input) { - BuildViewPrivData *privdata = app->view_privdata; - if (privdata->decoder) - process_input_set_fields(app,input); +void process_input_build_message(ProtoViewApp* app, InputEvent input) { + BuildViewPrivData* privdata = app->view_privdata; + if(privdata->decoder) + process_input_set_fields(app, input); else - process_input_select_decoder(app,input); + process_input_select_decoder(app, input); } /* Enter view callback. */ -void view_enter_build_message(ProtoViewApp *app) { - BuildViewPrivData *privdata = app->view_privdata; +void view_enter_build_message(ProtoViewApp* app) { + BuildViewPrivData* privdata = app->view_privdata; // When we enter the view, the current decoder is just set to zero. // Seek the next valid if needed. - if (Decoders[privdata->cur_decoder]->get_fields == NULL) { + if(Decoders[privdata->cur_decoder]->get_fields == NULL) { select_next_decoder(app); } // However if there is currently a decoded message, and the // decoder of such message supports message building, let's // select it. - if (app->signal_decoded && - app->msg_info->decoder->get_fields && - app->msg_info->decoder->build_message) - { - while(Decoders[privdata->cur_decoder] != app->msg_info->decoder) - select_next_decoder(app); + if(app->signal_decoded && app->msg_info->decoder->get_fields && + app->msg_info->decoder->build_message) { + while(Decoders[privdata->cur_decoder] != app->msg_info->decoder) select_next_decoder(app); } } /* Called on exit for cleanup. */ -void view_exit_build_message(ProtoViewApp *app) { - BuildViewPrivData *privdata = app->view_privdata; - if (privdata->fieldset) fieldset_free(privdata->fieldset); - if (privdata->user_value) free(privdata->user_value); +void view_exit_build_message(ProtoViewApp* app) { + BuildViewPrivData* privdata = app->view_privdata; + if(privdata->fieldset) fieldset_free(privdata->fieldset); + if(privdata->user_value) free(privdata->user_value); } diff --git a/applications/plugins/protoview/view_direct_sampling.c b/applications/plugins/protoview/view_direct_sampling.c index 251a289b8..1ab90f096 100644 --- a/applications/plugins/protoview/view_direct_sampling.c +++ b/applications/plugins/protoview/view_direct_sampling.c @@ -7,47 +7,46 @@ /* Read directly from the G0 CC1101 pin, and draw a black or white * dot depending on the level. */ -void render_view_direct_sampling(Canvas *const canvas, ProtoViewApp *app) { - if (!app->direct_sampling_enabled) { +void render_view_direct_sampling(Canvas* const canvas, ProtoViewApp* app) { + if(!app->direct_sampling_enabled) { canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas,2,9,"Direct sampling is a special"); - canvas_draw_str(canvas,2,18,"mode that displays the signal"); - canvas_draw_str(canvas,2,27,"captured in real time. Like in"); - canvas_draw_str(canvas,2,36,"a old CRT TV. It's very slow."); - canvas_draw_str(canvas,2,45,"Can crash your Flipper."); + canvas_draw_str(canvas, 2, 9, "Direct sampling is a special"); + canvas_draw_str(canvas, 2, 18, "mode that displays the signal"); + canvas_draw_str(canvas, 2, 27, "captured in real time. Like in"); + canvas_draw_str(canvas, 2, 36, "a old CRT TV. It's very slow."); + canvas_draw_str(canvas, 2, 45, "Can crash your Flipper."); canvas_set_font(canvas, FontPrimary); - canvas_draw_str(canvas,14,60,"To enable press OK"); + canvas_draw_str(canvas, 14, 60, "To enable press OK"); return; } - for (int y = 0; y < 64; y++) { - for (int x = 0; x < 128; x++) { + for(int y = 0; y < 64; y++) { + for(int x = 0; x < 128; x++) { bool level = furi_hal_gpio_read(&gpio_cc1101_g0); - if (level) canvas_draw_dot(canvas,x,y); + if(level) canvas_draw_dot(canvas, x, y); /* Busy loop: this is a terrible approach as it blocks * everything else, but for now it's the best we can do * to obtain direct data with some spacing. */ - uint32_t x = 250; while(x--); + uint32_t x = 250; + while(x--) + ; } } canvas_set_font(canvas, FontSecondary); - canvas_draw_str_with_border(canvas,36,60,"Direct sampling", - ColorWhite,ColorBlack); + canvas_draw_str_with_border(canvas, 36, 60, "Direct sampling", ColorWhite, ColorBlack); } /* Handle input */ -void process_input_direct_sampling(ProtoViewApp *app, InputEvent input) { - if (input.type == InputTypePress && input.key == InputKeyOk) { +void process_input_direct_sampling(ProtoViewApp* app, InputEvent input) { + if(input.type == InputTypePress && input.key == InputKeyOk) { app->direct_sampling_enabled = !app->direct_sampling_enabled; } } /* Enter view. Stop the subghz thread to prevent access as we read * the CC1101 data directly. */ -void view_enter_direct_sampling(ProtoViewApp *app) { - if (app->txrx->txrx_state == TxRxStateRx && - !app->txrx->debug_timer_sampling) - { +void view_enter_direct_sampling(ProtoViewApp* app) { + if(app->txrx->txrx_state == TxRxStateRx && !app->txrx->debug_timer_sampling) { subghz_worker_stop(app->txrx->worker); } else { raw_sampling_worker_stop(app); @@ -55,10 +54,8 @@ void view_enter_direct_sampling(ProtoViewApp *app) { } /* Exit view. Restore the subghz thread. */ -void view_exit_direct_sampling(ProtoViewApp *app) { - if (app->txrx->txrx_state == TxRxStateRx && - !app->txrx->debug_timer_sampling) - { +void view_exit_direct_sampling(ProtoViewApp* app) { + if(app->txrx->txrx_state == TxRxStateRx && !app->txrx->debug_timer_sampling) { subghz_worker_start(app->txrx->worker); } else { raw_sampling_worker_start(app); diff --git a/applications/plugins/protoview/view_info.c b/applications/plugins/protoview/view_info.c index 6aa69739c..75fc58411 100644 --- a/applications/plugins/protoview/view_info.c +++ b/applications/plugins/protoview/view_info.c @@ -20,31 +20,29 @@ typedef struct { * so that the user can see what they are saving. With left/right * you can move to next rows. Here we store where we are. */ uint32_t signal_display_start_row; - char *filename; + char* filename; uint8_t cur_info_page; // Info page to display. Useful when there are - // too many fields populated by the decoder that - // a single page is not enough. + // too many fields populated by the decoder that + // a single page is not enough. } InfoViewPrivData; /* Draw the text label and value of the specified info field at x,y. */ -static void render_info_field(Canvas *const canvas, - ProtoViewField *f, uint8_t x, uint8_t y) -{ +static void render_info_field(Canvas* const canvas, ProtoViewField* f, uint8_t x, uint8_t y) { char buf[64]; char strval[32]; - field_to_string(strval,sizeof(strval),f); - snprintf(buf,sizeof(buf),"%s: %s", f->name, strval); + field_to_string(strval, sizeof(strval), f); + snprintf(buf, sizeof(buf), "%s: %s", f->name, strval); canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, x, y, buf); } /* Render the view with the detected message information. */ #define INFO_LINES_PER_PAGE 5 -static void render_subview_main(Canvas *const canvas, ProtoViewApp *app) { - InfoViewPrivData *privdata = app->view_privdata; - uint8_t pages = (app->msg_info->fieldset->numfields - +(INFO_LINES_PER_PAGE-1)) / INFO_LINES_PER_PAGE; +static void render_subview_main(Canvas* const canvas, ProtoViewApp* app) { + InfoViewPrivData* privdata = app->view_privdata; + uint8_t pages = + (app->msg_info->fieldset->numfields + (INFO_LINES_PER_PAGE - 1)) / INFO_LINES_PER_PAGE; privdata->cur_info_page %= pages; uint8_t current_page = privdata->cur_info_page; char buf[32]; @@ -53,9 +51,9 @@ static void render_subview_main(Canvas *const canvas, ProtoViewApp *app) { canvas_set_font(canvas, FontPrimary); uint8_t y = 8, lineheight = 10; - if (pages > 1) { - snprintf(buf,sizeof(buf),"%s %u/%u", app->msg_info->decoder->name, - current_page+1, pages); + if(pages > 1) { + snprintf( + buf, sizeof(buf), "%s %u/%u", app->msg_info->decoder->name, current_page + 1, pages); canvas_draw_str(canvas, 0, y, buf); } else { canvas_draw_str(canvas, 0, y, app->msg_info->decoder->name); @@ -64,26 +62,30 @@ static void render_subview_main(Canvas *const canvas, ProtoViewApp *app) { /* Draw the info fields. */ uint8_t max_lines = INFO_LINES_PER_PAGE; - uint32_t j = current_page*max_lines; - while (j < app->msg_info->fieldset->numfields) { - render_info_field(canvas,app->msg_info->fieldset->fields[j++],0,y); + uint32_t j = current_page * max_lines; + while(j < app->msg_info->fieldset->numfields) { + render_info_field(canvas, app->msg_info->fieldset->fields[j++], 0, y); y += lineheight; - if (--max_lines == 0) break; + if(--max_lines == 0) break; } /* Draw a vertical "save" label. Temporary solution, to switch to * something better ASAP. */ y = 37; lineheight = 7; - canvas_draw_str(canvas, 119, y, "s"); y += lineheight; - canvas_draw_str(canvas, 119, y, "a"); y += lineheight; - canvas_draw_str(canvas, 119, y, "v"); y += lineheight; - canvas_draw_str(canvas, 119, y, "e"); y += lineheight; + canvas_draw_str(canvas, 119, y, "s"); + y += lineheight; + canvas_draw_str(canvas, 119, y, "a"); + y += lineheight; + canvas_draw_str(canvas, 119, y, "v"); + y += lineheight; + canvas_draw_str(canvas, 119, y, "e"); + y += lineheight; } /* Render view with save option. */ -static void render_subview_save(Canvas *const canvas, ProtoViewApp *app) { - InfoViewPrivData *privdata = app->view_privdata; +static void render_subview_save(Canvas* const canvas, ProtoViewApp* app) { + InfoViewPrivData* privdata = app->view_privdata; /* Display our signal in digital form: here we don't show the * signal with the exact timing of the received samples, but as it @@ -92,21 +94,20 @@ static void render_subview_save(Canvas *const canvas, ProtoViewApp *app) { uint8_t rowheight = 11; uint8_t bitwidth = 4; uint8_t bitheight = 5; - uint32_t idx = privdata->signal_display_start_row * (128/4); + uint32_t idx = privdata->signal_display_start_row * (128 / 4); bool prevbit = false; - for (uint8_t y = bitheight+12; y <= rows*rowheight; y += rowheight) { - for (uint8_t x = 0; x < 128; x += 4) { - bool bit = bitmap_get(app->msg_info->bits, - app->msg_info->bits_bytes,idx); - uint8_t prevy = y + prevbit*(bitheight*-1) - 1; - uint8_t thisy = y + bit*(bitheight*-1) - 1; - canvas_draw_line(canvas,x,prevy,x,thisy); - canvas_draw_line(canvas,x,thisy,x+bitwidth-1,thisy); + for(uint8_t y = bitheight + 12; y <= rows * rowheight; y += rowheight) { + for(uint8_t x = 0; x < 128; x += 4) { + bool bit = bitmap_get(app->msg_info->bits, app->msg_info->bits_bytes, idx); + uint8_t prevy = y + prevbit * (bitheight * -1) - 1; + uint8_t thisy = y + bit * (bitheight * -1) - 1; + canvas_draw_line(canvas, x, prevy, x, thisy); + canvas_draw_line(canvas, x, thisy, x + bitwidth - 1, thisy); prevbit = bit; - if (idx >= app->msg_info->pulses_count) { + if(idx >= app->msg_info->pulses_count) { canvas_set_color(canvas, ColorWhite); - canvas_draw_dot(canvas, x+1,thisy); - canvas_draw_dot(canvas, x+3,thisy); + canvas_draw_dot(canvas, x + 1, thisy); + canvas_draw_dot(canvas, x + 3, thisy); canvas_set_color(canvas, ColorBlack); } idx++; // Draw next bit @@ -118,28 +119,32 @@ static void render_subview_save(Canvas *const canvas, ProtoViewApp *app) { } /* Render the selected subview of this view. */ -void render_view_info(Canvas *const canvas, ProtoViewApp *app) { - if (app->signal_decoded == false) { +void render_view_info(Canvas* const canvas, ProtoViewApp* app) { + if(app->signal_decoded == false) { canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas, 30,36,"No signal decoded"); + canvas_draw_str(canvas, 30, 36, "No signal decoded"); return; } - ui_show_available_subviews(canvas,app,SubViewInfoLast); + ui_show_available_subviews(canvas, app, SubViewInfoLast); switch(app->current_subview[app->current_view]) { - case SubViewInfoMain: render_subview_main(canvas,app); break; - case SubViewInfoSave: render_subview_save(canvas,app); break; + case SubViewInfoMain: + render_subview_main(canvas, app); + break; + case SubViewInfoSave: + render_subview_save(canvas, app); + break; } } /* The user typed the file name. Let's save it and remove the keyboard * view. */ static void text_input_done_callback(void* context) { - ProtoViewApp *app = context; - InfoViewPrivData *privdata = app->view_privdata; + ProtoViewApp* app = context; + InfoViewPrivData* privdata = app->view_privdata; - FuriString *save_path = furi_string_alloc_printf( - "%s/%s.sub", EXT_PATH("subghz"), privdata->filename); + FuriString* save_path = + furi_string_alloc_printf("%s/%s.sub", EXT_PATH("subghz"), privdata->filename); save_signal(app, furi_string_get_cstr(save_path)); furi_string_free(save_path); @@ -151,22 +156,22 @@ static void text_input_done_callback(void* context) { /* Replace all the occurrences of character c1 with c2 in the specified * string. */ -void str_replace(char *buf, char c1, char c2) { - char *p = buf; +void str_replace(char* buf, char c1, char c2) { + char* p = buf; while(*p) { - if (*p == c1) *p = c2; + if(*p == c1) *p = c2; p++; } } /* Set a random filename the user can edit. */ -void set_signal_random_filename(ProtoViewApp *app, char *buf, size_t buflen) { +void set_signal_random_filename(ProtoViewApp* app, char* buf, size_t buflen) { char suffix[6]; - set_random_name(suffix,sizeof(suffix)); - snprintf(buf,buflen,"%.10s-%s-%d",app->msg_info->decoder->name,suffix,rand()%1000); - str_replace(buf,' ','_'); - str_replace(buf,'-','_'); - str_replace(buf,'/','_'); + set_random_name(suffix, sizeof(suffix)); + snprintf(buf, buflen, "%.10s-%s-%d", app->msg_info->decoder->name, suffix, rand() % 1000); + str_replace(buf, ' ', '_'); + str_replace(buf, '-', '_'); + str_replace(buf, '/', '_'); } /* ========================== Signal transmission =========================== */ @@ -180,20 +185,20 @@ typedef enum { SendSignalEndTransmission } SendSignalState; -#define PROTOVIEW_SENDSIGNAL_START_GAP 10000 /* microseconds. */ -#define PROTOVIEW_SENDSIGNAL_END_GAP 10000 /* microseconds. */ +#define PROTOVIEW_SENDSIGNAL_START_GAP 10000 /* microseconds. */ +#define PROTOVIEW_SENDSIGNAL_END_GAP 10000 /* microseconds. */ typedef struct { - SendSignalState state; // Current state. - uint32_t curpos; // Current bit position of data to send. - ProtoViewApp *app; // App reference. + SendSignalState state; // Current state. + uint32_t curpos; // Current bit position of data to send. + ProtoViewApp* app; // App reference. uint32_t start_gap_dur; // Gap to send at the start. - uint32_t end_gap_dur; // Gap to send at the end. + uint32_t end_gap_dur; // Gap to send at the end. } SendSignalCtx; /* Setup the state context for the callback responsible to feed data * to the subghz async tx system. */ -static void send_signal_init(SendSignalCtx *ss, ProtoViewApp *app) { +static void send_signal_init(SendSignalCtx* ss, ProtoViewApp* app) { ss->state = SendSignalSendStartGap; ss->curpos = 0; ss->app = app; @@ -214,27 +219,26 @@ static void send_signal_init(SendSignalCtx *ss, ProtoViewApp *app) { * message we are, in ss->curoff. We also send a start and end gap in order * to make sure the transmission is clear. */ -LevelDuration radio_tx_feed_data(void *ctx) { - SendSignalCtx *ss = ctx; +LevelDuration radio_tx_feed_data(void* ctx) { + SendSignalCtx* ss = ctx; /* Send start gap. */ - if (ss->state == SendSignalSendStartGap) { + if(ss->state == SendSignalSendStartGap) { ss->state = SendSignalSendBits; - return level_duration_make(0,ss->start_gap_dur); + return level_duration_make(0, ss->start_gap_dur); } /* Send data. */ - if (ss->state == SendSignalSendBits) { + if(ss->state == SendSignalSendBits) { uint32_t dur = 0, j; uint32_t level = 0; /* Let's see how many consecutive bits we have with the same * level. */ - for (j = 0; ss->curpos+j < ss->app->msg_info->pulses_count; j++) { - uint32_t l = bitmap_get(ss->app->msg_info->bits, - ss->app->msg_info->bits_bytes, - ss->curpos+j); - if (j == 0) { + for(j = 0; ss->curpos + j < ss->app->msg_info->pulses_count; j++) { + uint32_t l = + bitmap_get(ss->app->msg_info->bits, ss->app->msg_info->bits_bytes, ss->curpos + j); + if(j == 0) { /* At the first bit of this sequence, we store the * level of the sequence. */ level = l; @@ -244,22 +248,21 @@ LevelDuration radio_tx_feed_data(void *ctx) { /* As long as the level is the same, we update the duration. * Otherwise stop the loop and return this sample. */ - if (l != level) break; + if(l != level) break; dur += ss->app->msg_info->short_pulse_dur; } ss->curpos += j; /* If this was the last set of bits, change the state to * send the final gap. */ - if (ss->curpos >= ss->app->msg_info->pulses_count) - ss->state = SendSignalSendEndGap; + if(ss->curpos >= ss->app->msg_info->pulses_count) ss->state = SendSignalSendEndGap; return level_duration_make(level, dur); } /* Send end gap. */ - if (ss->state == SendSignalSendEndGap) { + if(ss->state == SendSignalSendEndGap) { ss->state = SendSignalEndTransmission; - return level_duration_make(0,ss->end_gap_dur); + return level_duration_make(0, ss->end_gap_dur); } /* End transmission. Here state is guaranteed @@ -268,7 +271,7 @@ LevelDuration radio_tx_feed_data(void *ctx) { } /* Vibrate and produce a click sound when a signal is sent. */ -void notify_signal_sent(ProtoViewApp *app) { +void notify_signal_sent(ProtoViewApp* app) { static const NotificationSequence sent_seq = { &message_blue_255, &message_vibro_on, @@ -277,59 +280,53 @@ void notify_signal_sent(ProtoViewApp *app) { &message_sound_off, &message_vibro_off, &message_blue_0, - NULL - }; + NULL}; notification_message(app->notification, &sent_seq); } /* Handle input for the info view. */ -void process_input_info(ProtoViewApp *app, InputEvent input) { +void process_input_info(ProtoViewApp* app, InputEvent input) { /* If we don't have a decoded signal, we don't allow to go up/down * in the subviews: they are only useful when a loaded signal. */ - if (app->signal_decoded && - ui_process_subview_updown(app,input,SubViewInfoLast)) return; + if(app->signal_decoded && ui_process_subview_updown(app, input, SubViewInfoLast)) return; - InfoViewPrivData *privdata = app->view_privdata; + InfoViewPrivData* privdata = app->view_privdata; int subview = ui_get_current_subview(app); /* Main subview. */ - if (subview == SubViewInfoMain) { - if (input.type == InputTypeLong && input.key == InputKeyOk) { + if(subview == SubViewInfoMain) { + if(input.type == InputTypeLong && input.key == InputKeyOk) { /* Reset the current sample to capture the next. */ reset_current_signal(app); - } else if (input.type == InputTypeShort && input.key == InputKeyOk) { + } else if(input.type == InputTypeShort && input.key == InputKeyOk) { /* Show next info page. */ privdata->cur_info_page++; } - } else if (subview == SubViewInfoSave) { - /* Save subview. */ - if (input.type == InputTypePress && input.key == InputKeyRight) { + } else if(subview == SubViewInfoSave) { + /* Save subview. */ + if(input.type == InputTypePress && input.key == InputKeyRight) { privdata->signal_display_start_row++; - } else if (input.type == InputTypePress && input.key == InputKeyLeft) { - if (privdata->signal_display_start_row != 0) - privdata->signal_display_start_row--; - } else if (input.type == InputTypeLong && input.key == InputKeyOk) - { + } else if(input.type == InputTypePress && input.key == InputKeyLeft) { + if(privdata->signal_display_start_row != 0) privdata->signal_display_start_row--; + } else if(input.type == InputTypeLong && input.key == InputKeyOk) { // We have have the buffer already allocated, in case the // user aborted with BACK a previous saving. - if (privdata->filename == NULL) - privdata->filename = malloc(SAVE_FILENAME_LEN); - set_signal_random_filename(app,privdata->filename,SAVE_FILENAME_LEN); - ui_show_keyboard(app, privdata->filename, SAVE_FILENAME_LEN, - text_input_done_callback); - } else if (input.type == InputTypeShort && input.key == InputKeyOk) { + if(privdata->filename == NULL) privdata->filename = malloc(SAVE_FILENAME_LEN); + set_signal_random_filename(app, privdata->filename, SAVE_FILENAME_LEN); + ui_show_keyboard(app, privdata->filename, SAVE_FILENAME_LEN, text_input_done_callback); + } else if(input.type == InputTypeShort && input.key == InputKeyOk) { SendSignalCtx send_state; - send_signal_init(&send_state,app); - radio_tx_signal(app,radio_tx_feed_data,&send_state); + send_signal_init(&send_state, app); + radio_tx_signal(app, radio_tx_feed_data, &send_state); notify_signal_sent(app); } } } /* Called on view exit. */ -void view_exit_info(ProtoViewApp *app) { - InfoViewPrivData *privdata = app->view_privdata; +void view_exit_info(ProtoViewApp* app) { + InfoViewPrivData* privdata = app->view_privdata; // When the user aborts the keyboard input, we are left with the // filename buffer allocated. - if (privdata->filename) free(privdata->filename); + if(privdata->filename) free(privdata->filename); } diff --git a/applications/plugins/protoview/view_raw_signal.c b/applications/plugins/protoview/view_raw_signal.c index 023e986f9..38354bef9 100644 --- a/applications/plugins/protoview/view_raw_signal.c +++ b/applications/plugins/protoview/view_raw_signal.c @@ -12,7 +12,7 @@ * * The 'idx' argument is the first sample to render in the circular * buffer. */ -void render_signal(ProtoViewApp *app, Canvas *const canvas, RawSamplesBuffer *buf, uint32_t idx) { +void render_signal(ProtoViewApp* app, Canvas* const canvas, RawSamplesBuffer* buf, uint32_t idx) { canvas_set_color(canvas, ColorBlack); int rows = 8; @@ -20,31 +20,29 @@ void render_signal(ProtoViewApp *app, Canvas *const canvas, RawSamplesBuffer *bu uint32_t start_idx = idx; bool level = 0; uint32_t dur = 0, sample_num = 0; - for (int row = 0; row < rows ; row++) { - for (int x = 0; x < 128; x++) { - int y = 3 + row*8; - if (dur < time_per_pixel/2) { + for(int row = 0; row < rows; row++) { + for(int x = 0; x < 128; x++) { + int y = 3 + row * 8; + if(dur < time_per_pixel / 2) { /* Get more data. */ raw_samples_get(buf, idx++, &level, &dur); sample_num++; } - canvas_draw_line(canvas, x,y,x,y-(level*3)); + canvas_draw_line(canvas, x, y, x, y - (level * 3)); /* Write a small triangle under the last sample detected. */ - if (app->signal_bestlen != 0 && - sample_num+start_idx == app->signal_bestlen+1) - { - canvas_draw_dot(canvas,x,y+2); - canvas_draw_dot(canvas,x-1,y+3); - canvas_draw_dot(canvas,x,y+3); - canvas_draw_dot(canvas,x+1,y+3); + if(app->signal_bestlen != 0 && sample_num + start_idx == app->signal_bestlen + 1) { + canvas_draw_dot(canvas, x, y + 2); + canvas_draw_dot(canvas, x - 1, y + 3); + canvas_draw_dot(canvas, x, y + 3); + canvas_draw_dot(canvas, x + 1, y + 3); sample_num++; /* Make sure we don't mark the next, too. */ } /* Remove from the current level duration the time we * just plot. */ - if (dur > time_per_pixel) + if(dur > time_per_pixel) dur -= time_per_pixel; else dur = 0; @@ -53,61 +51,63 @@ void render_signal(ProtoViewApp *app, Canvas *const canvas, RawSamplesBuffer *bu } /* Raw pulses rendering. This is our default view. */ -void render_view_raw_pulses(Canvas *const canvas, ProtoViewApp *app) { +void render_view_raw_pulses(Canvas* const canvas, ProtoViewApp* app) { /* Show signal. */ render_signal(app, canvas, DetectedSamples, app->signal_offset); /* Show signal information. */ char buf[64]; - snprintf(buf,sizeof(buf),"%luus", - (unsigned long)DetectedSamples->short_pulse_dur); + snprintf(buf, sizeof(buf), "%luus", (unsigned long)DetectedSamples->short_pulse_dur); canvas_set_font(canvas, FontSecondary); canvas_draw_str_with_border(canvas, 97, 63, buf, ColorWhite, ColorBlack); - if (app->signal_decoded) { + if(app->signal_decoded) { canvas_set_font(canvas, FontPrimary); - canvas_draw_str_with_border(canvas, 1, 61, app->msg_info->decoder->name, ColorWhite, ColorBlack); + canvas_draw_str_with_border( + canvas, 1, 61, app->msg_info->decoder->name, ColorWhite, ColorBlack); } } /* Handle input for the raw pulses view. */ -void process_input_raw_pulses(ProtoViewApp *app, InputEvent input) { - if (input.type == InputTypeRepeat) { +void process_input_raw_pulses(ProtoViewApp* app, InputEvent input) { + if(input.type == InputTypeRepeat) { /* Handle panning of the signal window. Long pressing * right will show successive samples, long pressing left * previous samples. */ - if (input.key == InputKeyRight) app->signal_offset++; - else if (input.key == InputKeyLeft) app->signal_offset--; - } else if (input.type == InputTypeLong) { - if (input.key == InputKeyOk) { + if(input.key == InputKeyRight) + app->signal_offset++; + else if(input.key == InputKeyLeft) + app->signal_offset--; + } else if(input.type == InputTypeLong) { + if(input.key == InputKeyOk) { /* Reset the current sample to capture the next. */ reset_current_signal(app); } - } else if (input.type == InputTypeShort) { - if (input.key == InputKeyOk) { + } else if(input.type == InputTypeShort) { + if(input.key == InputKeyOk) { app->signal_offset = 0; - adjust_raw_view_scale(app,DetectedSamples->short_pulse_dur); - } else if (input.key == InputKeyDown) { + adjust_raw_view_scale(app, DetectedSamples->short_pulse_dur); + } else if(input.key == InputKeyDown) { /* Rescaling. The set becomes finer under 50us per pixel. */ uint32_t scale_step = app->us_scale >= 50 ? 50 : 10; - if (app->us_scale < 500) app->us_scale += scale_step; - } else if (input.key == InputKeyUp) { + if(app->us_scale < 500) app->us_scale += scale_step; + } else if(input.key == InputKeyUp) { uint32_t scale_step = app->us_scale > 50 ? 50 : 10; - if (app->us_scale > 10) app->us_scale -= scale_step; + if(app->us_scale > 10) app->us_scale -= scale_step; } } } /* Adjust raw view scale depending on short pulse duration. */ -void adjust_raw_view_scale(ProtoViewApp *app, uint32_t short_pulse_dur) { - if (short_pulse_dur == 0) +void adjust_raw_view_scale(ProtoViewApp* app, uint32_t short_pulse_dur) { + if(short_pulse_dur == 0) app->us_scale = PROTOVIEW_RAW_VIEW_DEFAULT_SCALE; - else if (short_pulse_dur < 75) + else if(short_pulse_dur < 75) app->us_scale = 10; - else if (short_pulse_dur < 145) + else if(short_pulse_dur < 145) app->us_scale = 30; - else if (short_pulse_dur < 400) + else if(short_pulse_dur < 400) app->us_scale = 100; - else if (short_pulse_dur < 1000) + else if(short_pulse_dur < 1000) app->us_scale = 200; else app->us_scale = PROTOVIEW_RAW_VIEW_DEFAULT_SCALE; diff --git a/applications/plugins/protoview/view_settings.c b/applications/plugins/protoview/view_settings.c index 1e2dce226..09abf5a2a 100644 --- a/applications/plugins/protoview/view_settings.c +++ b/applications/plugins/protoview/view_settings.c @@ -6,30 +6,30 @@ /* Renders a single view with frequency and modulation setting. However * this are logically two different views, and only one of the settings * will be highlighted. */ -void render_view_settings(Canvas *const canvas, ProtoViewApp *app) { +void render_view_settings(Canvas* const canvas, ProtoViewApp* app) { canvas_set_font(canvas, FontPrimary); - if (app->current_view == ViewFrequencySettings) - canvas_draw_str_with_border(canvas,1,10,"Frequency",ColorWhite,ColorBlack); + if(app->current_view == ViewFrequencySettings) + canvas_draw_str_with_border(canvas, 1, 10, "Frequency", ColorWhite, ColorBlack); else - canvas_draw_str(canvas,1,10,"Frequency"); + canvas_draw_str(canvas, 1, 10, "Frequency"); - if (app->current_view == ViewModulationSettings) - canvas_draw_str_with_border(canvas,70,10,"Modulation",ColorWhite,ColorBlack); + if(app->current_view == ViewModulationSettings) + canvas_draw_str_with_border(canvas, 70, 10, "Modulation", ColorWhite, ColorBlack); else - canvas_draw_str(canvas,70,10,"Modulation"); + canvas_draw_str(canvas, 70, 10, "Modulation"); canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas,10,61,"Use up and down to modify"); + canvas_draw_str(canvas, 10, 61, "Use up and down to modify"); - if (app->txrx->debug_timer_sampling) - canvas_draw_str(canvas,3,52,"(DEBUG timer sampling is ON)"); + if(app->txrx->debug_timer_sampling) + canvas_draw_str(canvas, 3, 52, "(DEBUG timer sampling is ON)"); /* Show frequency. We can use big numbers font since it's just a number. */ - if (app->current_view == ViewFrequencySettings) { + if(app->current_view == ViewFrequencySettings) { char buf[16]; - snprintf(buf,sizeof(buf),"%.2f",(double)app->frequency/1000000); + snprintf(buf, sizeof(buf), "%.2f", (double)app->frequency / 1000000); canvas_set_font(canvas, FontBigNumbers); canvas_draw_str(canvas, 30, 40, buf); - } else if (app->current_view == ViewModulationSettings) { + } else if(app->current_view == ViewModulationSettings) { int current = app->modulation; canvas_set_font(canvas, FontPrimary); canvas_draw_str(canvas, 33, 39, ProtoViewModulations[current].name); @@ -37,13 +37,13 @@ void render_view_settings(Canvas *const canvas, ProtoViewApp *app) { } /* Handle input for the settings view. */ -void process_input_settings(ProtoViewApp *app, InputEvent input) { - if (input.type == InputTypeLong && input.key == InputKeyOk) { +void process_input_settings(ProtoViewApp* app, InputEvent input) { + if(input.type == InputTypeLong && input.key == InputKeyOk) { /* Long pressing to OK sets the default frequency and * modulation. */ app->frequency = subghz_setting_get_default_frequency(app->setting); app->modulation = 0; - } else if (0 && input.type == InputTypeLong && input.key == InputKeyDown) { + } else if(0 && input.type == InputTypeLong && input.key == InputKeyDown) { /* Long pressing to down switches between normal and debug * timer sampling mode. NOTE: this feature is disabled for users, * only useful for devs (if useful at all). */ @@ -55,42 +55,40 @@ void process_input_settings(ProtoViewApp *app, InputEvent input) { app->txrx->debug_timer_sampling = !app->txrx->debug_timer_sampling; radio_begin(app); radio_rx(app); - } else if (input.type == InputTypePress && - (input.key != InputKeyDown || input.key != InputKeyUp)) - { + } else if(input.type == InputTypePress && (input.key != InputKeyDown || input.key != InputKeyUp)) { /* Handle up and down to change frequency or modulation. */ - if (app->current_view == ViewFrequencySettings) { + if(app->current_view == ViewFrequencySettings) { size_t curidx = 0, i; size_t count = subghz_setting_get_frequency_count(app->setting); /* Scan the list of frequencies to check for the index of the * currently set frequency. */ for(i = 0; i < count; i++) { - uint32_t freq = subghz_setting_get_frequency(app->setting,i); - if (freq == app->frequency) { + uint32_t freq = subghz_setting_get_frequency(app->setting, i); + if(freq == app->frequency) { curidx = i; break; } } - if (i == count) return; /* Should never happen. */ + if(i == count) return; /* Should never happen. */ - if (input.key == InputKeyUp) { - curidx = curidx == 0 ? count-1 : curidx-1; - } else if (input.key == InputKeyDown) { - curidx = (curidx+1) % count; + if(input.key == InputKeyUp) { + curidx = curidx == 0 ? count - 1 : curidx - 1; + } else if(input.key == InputKeyDown) { + curidx = (curidx + 1) % count; } else { return; } - app->frequency = subghz_setting_get_frequency(app->setting,curidx); - } else if (app->current_view == ViewModulationSettings) { + app->frequency = subghz_setting_get_frequency(app->setting, curidx); + } else if(app->current_view == ViewModulationSettings) { uint32_t count = 0; uint32_t modid = app->modulation; while(ProtoViewModulations[count].name != NULL) count++; - if (input.key == InputKeyUp) { - modid = modid == 0 ? count-1 : modid-1; - } else if (input.key == InputKeyDown) { - modid = (modid+1) % count; + if(input.key == InputKeyUp) { + modid = modid == 0 ? count - 1 : modid - 1; + } else if(input.key == InputKeyDown) { + modid = (modid + 1) % count; } else { return; } @@ -106,9 +104,13 @@ void process_input_settings(ProtoViewApp *app, InputEvent input) { /* When the user switches to some other view, if they changed the parameters * we need to restart the radio with the right frequency and modulation. */ -void view_exit_settings(ProtoViewApp *app) { - if (app->txrx->freq_mod_changed) { - FURI_LOG_E(TAG, "Setting view, setting frequency/modulation to %lu %s", app->frequency, ProtoViewModulations[app->modulation].name); +void view_exit_settings(ProtoViewApp* app) { + if(app->txrx->freq_mod_changed) { + FURI_LOG_E( + TAG, + "Setting view, setting frequency/modulation to %lu %s", + app->frequency, + ProtoViewModulations[app->modulation].name); radio_rx_end(app); radio_begin(app); radio_rx(app); diff --git a/applications/plugins/tama_p1/hal.c b/applications/plugins/tama_p1/hal.c index 211457803..585cd88c4 100644 --- a/applications/plugins/tama_p1/hal.c +++ b/applications/plugins/tama_p1/hal.c @@ -40,7 +40,7 @@ static void tama_p1_hal_log(log_level_t level, char* buff, ...) { va_list args; va_start(args, buff); furi_string_cat_vprintf(string, buff, args); - va_end(args); + va_end(args); switch(level) { case LOG_ERROR: diff --git a/applications/plugins/tama_p1/tama.h b/applications/plugins/tama_p1/tama.h index e2a267443..e8eecc945 100644 --- a/applications/plugins/tama_p1/tama.h +++ b/applications/plugins/tama_p1/tama.h @@ -13,7 +13,6 @@ #define STATE_FILE_VERSION 2 #define TAMA_SAVE_PATH EXT_PATH("tama_p1/save.bin") - typedef struct { FuriThread* thread; hal_t hal; diff --git a/applications/plugins/tama_p1/tama_p1.c b/applications/plugins/tama_p1/tama_p1.c index 7184638d7..0e7686a06 100644 --- a/applications/plugins/tama_p1/tama_p1.c +++ b/applications/plugins/tama_p1/tama_p1.c @@ -52,7 +52,6 @@ static void tama_p1_draw_callback(Canvas* const canvas, void* cb_ctx) { uint16_t lcd_icon_lower_left = lcd_matrix_left; uint16_t lcd_icon_spacing_horiz = (lcd_matrix_scaled_width - (4 * TAMA_LCD_ICON_SIZE)) / 3 + TAMA_LCD_ICON_SIZE; - uint16_t y = lcd_matrix_top; for(uint8_t row = 0; row < 16; ++row) { @@ -71,7 +70,7 @@ static void tama_p1_draw_callback(Canvas* const canvas, void* cb_ctx) { // Start drawing icons uint8_t lcd_icons = g_ctx->icons; - + // Draw top icons y = lcd_icon_upper_top; // y = 64 - TAMA_LCD_ICON_SIZE; @@ -114,135 +113,134 @@ static void tama_p1_update_timer_callback(FuriMessageQueue* event_queue) { TamaEvent event = {.type = EventTypeTick}; furi_message_queue_put(event_queue, &event, 0); } - -static void tama_p1_load_state() { - state_t *state; + +static void tama_p1_load_state() { + state_t* state; uint8_t buf[4]; - bool error = false; + bool error = false; state = tamalib_get_state(); - Storage* storage = furi_record_open(RECORD_STORAGE); - File* file = storage_file_alloc(storage); - if(storage_file_open(file, TAMA_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) { - - storage_file_read(file, &buf, 4); - if (buf[0] != (uint8_t) STATE_FILE_MAGIC[0] || buf[1] != (uint8_t) STATE_FILE_MAGIC[1] || - buf[2] != (uint8_t) STATE_FILE_MAGIC[2] || buf[3] != (uint8_t) STATE_FILE_MAGIC[3]) { + Storage* storage = furi_record_open(RECORD_STORAGE); + File* file = storage_file_alloc(storage); + if(storage_file_open(file, TAMA_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) { + storage_file_read(file, &buf, 4); + if(buf[0] != (uint8_t)STATE_FILE_MAGIC[0] || buf[1] != (uint8_t)STATE_FILE_MAGIC[1] || + buf[2] != (uint8_t)STATE_FILE_MAGIC[2] || buf[3] != (uint8_t)STATE_FILE_MAGIC[3]) { FURI_LOG_E(TAG, "FATAL: Wrong state file magic in \"%s\" !\n", TAMA_SAVE_PATH); error = true; } - storage_file_read(file, &buf, 1); - if (buf[0] != STATE_FILE_VERSION) { + storage_file_read(file, &buf, 1); + if(buf[0] != STATE_FILE_VERSION) { FURI_LOG_E(TAG, "FATAL: Unsupported version"); error = true; } - if (!error) { + if(!error) { FURI_LOG_D(TAG, "Reading save.bin"); - storage_file_read(file, &buf, 2); - *(state->pc) = buf[0] | ((buf[1] & 0x1F) << 8); - - storage_file_read(file, &buf, 2); - *(state->x) = buf[0] | ((buf[1] & 0xF) << 8); + storage_file_read(file, &buf, 2); + *(state->pc) = buf[0] | ((buf[1] & 0x1F) << 8); - storage_file_read(file, &buf, 2); - *(state->y) = buf[0] | ((buf[1] & 0xF) << 8); + storage_file_read(file, &buf, 2); + *(state->x) = buf[0] | ((buf[1] & 0xF) << 8); - storage_file_read(file, &buf, 1); - *(state->a) = buf[0] & 0xF; + storage_file_read(file, &buf, 2); + *(state->y) = buf[0] | ((buf[1] & 0xF) << 8); - storage_file_read(file, &buf, 1); - *(state->b) = buf[0] & 0xF; + storage_file_read(file, &buf, 1); + *(state->a) = buf[0] & 0xF; - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); + *(state->b) = buf[0] & 0xF; + + storage_file_read(file, &buf, 1); *(state->np) = buf[0] & 0x1F; - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); *(state->sp) = buf[0]; - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); *(state->flags) = buf[0] & 0xF; - storage_file_read(file, &buf, 4); + storage_file_read(file, &buf, 4); *(state->tick_counter) = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); - storage_file_read(file, &buf, 4); - *(state->clk_timer_timestamp) = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); + storage_file_read(file, &buf, 4); + *(state->clk_timer_timestamp) = buf[0] | (buf[1] << 8) | (buf[2] << 16) | + (buf[3] << 24); - storage_file_read(file, &buf, 4); - *(state->prog_timer_timestamp) = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); + storage_file_read(file, &buf, 4); + *(state->prog_timer_timestamp) = buf[0] | (buf[1] << 8) | (buf[2] << 16) | + (buf[3] << 24); - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); *(state->prog_timer_enabled) = buf[0] & 0x1; - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); *(state->prog_timer_data) = buf[0]; - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); *(state->prog_timer_rld) = buf[0]; - storage_file_read(file, &buf, 4); + storage_file_read(file, &buf, 4); *(state->call_depth) = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); FURI_LOG_D(TAG, "Restoring Interupts"); - for (uint32_t i = 0; i < INT_SLOT_NUM; i++) { - storage_file_read(file, &buf, 1); + for(uint32_t i = 0; i < INT_SLOT_NUM; i++) { + storage_file_read(file, &buf, 1); state->interrupts[i].factor_flag_reg = buf[0] & 0xF; - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); state->interrupts[i].mask_reg = buf[0] & 0xF; - storage_file_read(file, &buf, 1); + storage_file_read(file, &buf, 1); state->interrupts[i].triggered = buf[0] & 0x1; } /* First 640 half bytes correspond to the RAM */ FURI_LOG_D(TAG, "Restoring RAM"); - for (uint32_t i = 0; i < MEM_RAM_SIZE; i++) { - storage_file_read(file, &buf, 1); + for(uint32_t i = 0; i < MEM_RAM_SIZE; i++) { + storage_file_read(file, &buf, 1); SET_RAM_MEMORY(state->memory, i + MEM_RAM_ADDR, buf[0] & 0xF); } /* I/Os are from 0xF00 to 0xF7F */ FURI_LOG_D(TAG, "Restoring I/O"); - for (uint32_t i = 0; i < MEM_IO_SIZE; i++) { - storage_file_read(file, &buf, 1); + for(uint32_t i = 0; i < MEM_IO_SIZE; i++) { + storage_file_read(file, &buf, 1); SET_IO_MEMORY(state->memory, i + MEM_IO_ADDR, buf[0] & 0xF); - } - FURI_LOG_D(TAG, "Refreshing Hardware"); - tamalib_refresh_hw(); - } + } + FURI_LOG_D(TAG, "Refreshing Hardware"); + tamalib_refresh_hw(); + } } - + storage_file_close(file); storage_file_free(file); - furi_record_close(RECORD_STORAGE); + furi_record_close(RECORD_STORAGE); } - static void tama_p1_save_state() { - // Saving state FURI_LOG_D(TAG, "Saving Gamestate"); uint8_t buf[4]; - state_t *state; + state_t* state; uint32_t offset = 0; state = tamalib_get_state(); - - Storage* storage = furi_record_open(RECORD_STORAGE); - File* file = storage_file_alloc(storage); + + Storage* storage = furi_record_open(RECORD_STORAGE); + File* file = storage_file_alloc(storage); if(storage_file_open(file, TAMA_SAVE_PATH, FSAM_WRITE, FSOM_CREATE_ALWAYS)) { - buf[0] = (uint8_t) STATE_FILE_MAGIC[0]; - buf[1] = (uint8_t) STATE_FILE_MAGIC[1]; - buf[2] = (uint8_t) STATE_FILE_MAGIC[2]; - buf[3] = (uint8_t) STATE_FILE_MAGIC[3]; + buf[0] = (uint8_t)STATE_FILE_MAGIC[0]; + buf[1] = (uint8_t)STATE_FILE_MAGIC[1]; + buf[2] = (uint8_t)STATE_FILE_MAGIC[2]; + buf[3] = (uint8_t)STATE_FILE_MAGIC[3]; offset += storage_file_write(file, &buf, sizeof(buf)); - + buf[0] = STATE_FILE_VERSION & 0xFF; offset += storage_file_write(file, &buf, 1); - + buf[0] = *(state->pc) & 0xFF; buf[1] = (*(state->pc) >> 8) & 0x1F; offset += storage_file_write(file, &buf, 2); @@ -303,7 +301,7 @@ static void tama_p1_save_state() { buf[3] = (*(state->call_depth) >> 24) & 0xFF; offset += storage_file_write(file, &buf, sizeof(buf)); - for (uint32_t i = 0; i < INT_SLOT_NUM; i++) { + for(uint32_t i = 0; i < INT_SLOT_NUM; i++) { buf[0] = state->interrupts[i].factor_flag_reg & 0xF; offset += storage_file_write(file, &buf, 1); @@ -315,17 +313,17 @@ static void tama_p1_save_state() { } /* First 640 half bytes correspond to the RAM */ - for (uint32_t i = 0; i < MEM_RAM_SIZE; i++) { + for(uint32_t i = 0; i < MEM_RAM_SIZE; i++) { buf[0] = GET_RAM_MEMORY(state->memory, i + MEM_RAM_ADDR) & 0xF; offset += storage_file_write(file, &buf, 1); } /* I/Os are from 0xF00 to 0xF7F */ - for (uint32_t i = 0; i < MEM_IO_SIZE; i++) { + for(uint32_t i = 0; i < MEM_IO_SIZE; i++) { buf[0] = GET_IO_MEMORY(state->memory, i + MEM_IO_ADDR) & 0xF; offset += storage_file_write(file, &buf, 1); } - } + } storage_file_close(file); storage_file_free(file); furi_record_close(RECORD_STORAGE); @@ -333,7 +331,6 @@ static void tama_p1_save_state() { FURI_LOG_D(TAG, "Finished Writing %lu", offset); } - static int32_t tama_p1_worker(void* context) { bool running = true; FuriMutex* mutex = context; @@ -357,8 +354,6 @@ static int32_t tama_p1_worker(void* context) { furi_mutex_release(mutex); return 0; } - - static void tama_p1_init(TamaApp* const ctx) { g_ctx = ctx; @@ -485,9 +480,9 @@ int32_t tama_p1_app(void* p) { tamalib_set_button(BTN_MIDDLE, tama_btn_state); } else if(event.input.key == InputKeyRight) { tamalib_set_button(BTN_RIGHT, tama_btn_state); - } else if(event.input.key == InputKeyDown && event.input.type == InputTypeShort) { + } else if(event.input.key == InputKeyDown && event.input.type == InputTypeShort) { // TODO: pause or fast-forward tamagotchi - tama_p1_save_state(); + tama_p1_save_state(); } else if(event.input.key == InputKeyUp) { // mute tamagotchi tamalib_set_button(BTN_LEFT, tama_btn_state); tamalib_set_button(BTN_RIGHT, tama_btn_state); @@ -500,7 +495,7 @@ int32_t tama_p1_app(void* p) { furi_timer_stop(timer); running = false; - tama_p1_save_state(); + tama_p1_save_state(); } } diff --git a/applications/services/bt/bt_service/bt.c b/applications/services/bt/bt_service/bt.c index a993b6cae..ad3ae71c9 100644 --- a/applications/services/bt/bt_service/bt.c +++ b/applications/services/bt/bt_service/bt.c @@ -370,8 +370,8 @@ static void bt_close_connection(Bt* bt) { furi_event_flag_set(bt->api_event, BT_API_UNLOCK_EVENT); } -static void bt_restart(Bt *bt) { - if (bt->profile == BtProfileHidKeyboard) { +static void bt_restart(Bt* bt) { + if(bt->profile == BtProfileHidKeyboard) { furi_hal_bt_change_app(FuriHalBtProfileHidKeyboard, bt_on_gap_event_callback, bt); } else { furi_hal_bt_change_app(FuriHalBtProfileSerial, bt_on_gap_event_callback, bt); @@ -379,7 +379,7 @@ static void bt_restart(Bt *bt) { furi_hal_bt_start_advertising(); } -void bt_set_profile_adv_name(Bt *bt, const char* fmt, ...) { +void bt_set_profile_adv_name(Bt* bt, const char* fmt, ...) { furi_assert(bt); furi_assert(fmt); @@ -388,7 +388,7 @@ void bt_set_profile_adv_name(Bt *bt, const char* fmt, ...) { va_start(args, fmt); vsnprintf(name, sizeof(name), fmt, args); va_end(args); - if (bt->profile == BtProfileHidKeyboard) { + if(bt->profile == BtProfileHidKeyboard) { furi_hal_bt_set_profile_adv_name(FuriHalBtProfileHidKeyboard, name); } else { furi_hal_bt_set_profile_adv_name(FuriHalBtProfileSerial, name); @@ -397,46 +397,45 @@ void bt_set_profile_adv_name(Bt *bt, const char* fmt, ...) { bt_restart(bt); } -const char *bt_get_profile_adv_name(Bt *bt) { +const char* bt_get_profile_adv_name(Bt* bt) { furi_assert(bt); - if (bt->profile == BtProfileHidKeyboard) { + if(bt->profile == BtProfileHidKeyboard) { return furi_hal_bt_get_profile_adv_name(FuriHalBtProfileHidKeyboard); } else { return furi_hal_bt_get_profile_adv_name(FuriHalBtProfileSerial); } } -void bt_set_profile_mac_address(Bt *bt, const uint8_t mac[6]) { +void bt_set_profile_mac_address(Bt* bt, const uint8_t mac[6]) { furi_assert(bt); furi_assert(mac); - if (bt->profile == BtProfileHidKeyboard) { + if(bt->profile == BtProfileHidKeyboard) { furi_hal_bt_set_profile_mac_addr(FuriHalBtProfileHidKeyboard, mac); } else { furi_hal_bt_set_profile_mac_addr(FuriHalBtProfileSerial, mac); } - + bt_restart(bt); } -const uint8_t *bt_get_profile_mac_address(Bt *bt) { +const uint8_t* bt_get_profile_mac_address(Bt* bt) { furi_assert(bt); - if (bt->profile == BtProfileHidKeyboard) { + if(bt->profile == BtProfileHidKeyboard) { return furi_hal_bt_get_profile_mac_addr(FuriHalBtProfileHidKeyboard); } else { return furi_hal_bt_get_profile_mac_addr(FuriHalBtProfileSerial); } } -bool bt_remote_rssi(Bt *bt, BtRssi *rssi) { +bool bt_remote_rssi(Bt* bt, BtRssi* rssi) { furi_assert(bt); UNUSED(rssi); uint8_t rssi_val; uint32_t since = furi_hal_bt_get_conn_rssi(&rssi_val); - if (since == 0) - return false; + if(since == 0) return false; rssi->rssi = rssi_val; rssi->since = since; diff --git a/applications/services/bt/bt_service/bt.h b/applications/services/bt/bt_service/bt.h index 2e6bbf1bb..60420a7f7 100644 --- a/applications/services/bt/bt_service/bt.h +++ b/applications/services/bt/bt_service/bt.h @@ -28,7 +28,6 @@ typedef struct { uint32_t since; } BtRssi; - typedef void (*BtStatusChangedCallback)(BtStatus status, void* context); /** Change BLE Profile @@ -41,15 +40,13 @@ typedef void (*BtStatusChangedCallback)(BtStatus status, void* context); */ bool bt_set_profile(Bt* bt, BtProfile profile); +void bt_set_profile_adv_name(Bt* bt, const char* fmt, ...); +const char* bt_get_profile_adv_name(Bt* bt); -void bt_set_profile_adv_name(Bt *bt, const char* fmt, ...); -const char *bt_get_profile_adv_name(Bt *bt); - -void bt_set_profile_mac_address(Bt *bt, const uint8_t mac[6]); -const uint8_t *bt_get_profile_mac_address(Bt *bt); - -bool bt_remote_rssi(Bt *bt, BtRssi *rssi); +void bt_set_profile_mac_address(Bt* bt, const uint8_t mac[6]); +const uint8_t* bt_get_profile_mac_address(Bt* bt); +bool bt_remote_rssi(Bt* bt, BtRssi* rssi); /** Disconnect from Central * diff --git a/applications/services/desktop/animations/animation_manager.c b/applications/services/desktop/animations/animation_manager.c index c1eb50d59..5239d72d5 100644 --- a/applications/services/desktop/animations/animation_manager.c +++ b/applications/services/desktop/animations/animation_manager.c @@ -145,7 +145,8 @@ void animation_manager_check_blocking_process(AnimationManager* animation_manage const StorageAnimationManifestInfo* manifest_info = animation_storage_get_meta(animation_manager->current_animation); - bool valid = animation_manager_is_valid_idle_animation(manifest_info, &stats, XTREME_SETTINGS()->unlock_anims); + bool valid = animation_manager_is_valid_idle_animation( + manifest_info, &stats, XTREME_SETTINGS()->unlock_anims); if(!valid) { animation_manager_start_new_idle(animation_manager); @@ -201,8 +202,10 @@ static void animation_manager_start_new_idle(AnimationManager* animation_manager animation_storage_get_bubble_animation(animation_manager->current_animation); animation_manager->state = AnimationManagerStateIdle; XtremeSettings* xtreme_settings = XTREME_SETTINGS(); - int32_t duration = (xtreme_settings->cycle_anims == 0) ? (bubble_animation->duration) : (xtreme_settings->cycle_anims); - furi_timer_start(animation_manager->idle_animation_timer, (duration > 0) ? (duration * 1000) : 0); + int32_t duration = (xtreme_settings->cycle_anims == 0) ? (bubble_animation->duration) : + (xtreme_settings->cycle_anims); + furi_timer_start( + animation_manager->idle_animation_timer, (duration > 0) ? (duration * 1000) : 0); } static bool animation_manager_check_blocking(AnimationManager* animation_manager) { @@ -355,7 +358,7 @@ static bool animation_manager_is_valid_idle_animation( result = (sd_status == FSE_NOT_READY); } - if (!unlock) { + if(!unlock) { if((stats->butthurt < info->min_butthurt) || (stats->butthurt > info->max_butthurt)) { result = false; } @@ -370,8 +373,9 @@ static bool animation_manager_is_valid_idle_animation( static StorageAnimation* animation_manager_select_idle_animation(AnimationManager* animation_manager) { const char* old_animation_name = NULL; - if (animation_manager->current_animation) { - old_animation_name = animation_storage_get_meta(animation_manager->current_animation)->name; + if(animation_manager->current_animation) { + old_animation_name = + animation_storage_get_meta(animation_manager->current_animation)->name; } StorageAnimationList_t animation_list; @@ -391,8 +395,8 @@ static StorageAnimation* animation_storage_get_meta(storage_animation); bool valid = animation_manager_is_valid_idle_animation(manifest_info, &stats, unlock); - if (old_animation_name != NULL) { - if (strcmp(manifest_info->name, old_animation_name) == 0) { + if(old_animation_name != NULL) { + if(strcmp(manifest_info->name, old_animation_name) == 0) { valid = false; } } @@ -512,7 +516,8 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m furi_record_close(RECORD_DOLPHIN); const StorageAnimationManifestInfo* manifest_info = animation_storage_get_meta(restore_animation); - bool valid = animation_manager_is_valid_idle_animation(manifest_info, &stats, XTREME_SETTINGS()->unlock_anims); + bool valid = animation_manager_is_valid_idle_animation( + manifest_info, &stats, XTREME_SETTINGS()->unlock_anims); if(valid) { animation_manager_replace_current_animation( animation_manager, restore_animation); @@ -523,12 +528,16 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m animation_manager->idle_animation_timer, animation_manager->freezed_animation_time_left); } else { - const BubbleAnimation* bubble_animation = animation_storage_get_bubble_animation( - animation_manager->current_animation); + const BubbleAnimation* bubble_animation = + animation_storage_get_bubble_animation( + animation_manager->current_animation); XtremeSettings* xtreme_settings = XTREME_SETTINGS(); - int32_t duration = (xtreme_settings->cycle_anims == 0) ? (bubble_animation->duration) : (xtreme_settings->cycle_anims); + int32_t duration = (xtreme_settings->cycle_anims == 0) ? + (bubble_animation->duration) : + (xtreme_settings->cycle_anims); furi_timer_start( - animation_manager->idle_animation_timer, (duration > 0) ? (duration * 1000) : 0); + animation_manager->idle_animation_timer, + (duration > 0) ? (duration * 1000) : 0); } } } else { diff --git a/applications/services/desktop/animations/animation_storage.c b/applications/services/desktop/animations/animation_storage.c index 28cdfe810..c717b0c36 100644 --- a/applications/services/desktop/animations/animation_storage.c +++ b/applications/services/desktop/animations/animation_storage.c @@ -35,18 +35,18 @@ void animation_handler_select_manifest() { FuriString* anim_dir = furi_string_alloc(); FuriString* manifest = furi_string_alloc(); bool use_asset_pack = xtreme_settings->asset_pack[0] != '\0'; - if (use_asset_pack) { + if(use_asset_pack) { furi_string_printf(anim_dir, "%s/%s/Anims", PACKS_DIR, xtreme_settings->asset_pack); furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir)); Storage* storage = furi_record_open(RECORD_STORAGE); - if (storage_common_stat(storage, furi_string_get_cstr(manifest), NULL) == FSE_OK) { + if(storage_common_stat(storage, furi_string_get_cstr(manifest), NULL) == FSE_OK) { FURI_LOG_I(TAG, "Custom Manifest selected"); } else { use_asset_pack = false; } furi_record_close(RECORD_STORAGE); } - if (!use_asset_pack) { + if(!use_asset_pack) { furi_string_set(anim_dir, BASE_ANIMATION_DIR); if(xtreme_settings->nsfw_mode) { furi_string_cat_str(anim_dir, "/nsfw"); @@ -58,7 +58,8 @@ void animation_handler_select_manifest() { furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir)); } strlcpy(ANIMATION_DIR, furi_string_get_cstr(anim_dir), sizeof(ANIMATION_DIR)); - strlcpy(ANIMATION_MANIFEST_FILE, furi_string_get_cstr(manifest), sizeof(ANIMATION_MANIFEST_FILE)); + strlcpy( + ANIMATION_MANIFEST_FILE, furi_string_get_cstr(manifest), sizeof(ANIMATION_MANIFEST_FILE)); furi_string_free(manifest); furi_string_free(anim_dir); } diff --git a/applications/services/desktop/views/desktop_view_lock_menu.c b/applications/services/desktop/views/desktop_view_lock_menu.c index 4cdfa54da..594676c28 100644 --- a/applications/services/desktop/views/desktop_view_lock_menu.c +++ b/applications/services/desktop/views/desktop_view_lock_menu.c @@ -68,7 +68,7 @@ void desktop_lock_menu_draw_callback(Canvas* canvas, void* model) { str = "Set PIN + Off"; } } else if(i == DesktopLockMenuIndexXtremeSettings) { - str = "Xtreme Settings"; + str = "Xtreme Settings"; } if(str) //-V547 diff --git a/applications/services/dolphin/helpers/dolphin_state.c b/applications/services/dolphin/helpers/dolphin_state.c index 72fa75ac0..419245a7c 100644 --- a/applications/services/dolphin/helpers/dolphin_state.c +++ b/applications/services/dolphin/helpers/dolphin_state.c @@ -15,9 +15,10 @@ #define DOLPHIN_STATE_HEADER_MAGIC 0xD0 #define DOLPHIN_STATE_HEADER_VERSION 0x01 -const int DOLPHIN_LEVELS[DOLPHIN_LEVEL_COUNT] = {100, 200, 300, 450, 600, 750, 950, 1150, 1350, 1600, - 1850, 2100, 2400, 2700, 3000, 3350, 3700, 4050, 4450, 4850, - 5250, 5700, 6150, 6600, 7100, 7600, 8100, 8650, 9200}; +const int DOLPHIN_LEVELS[DOLPHIN_LEVEL_COUNT] = {100, 200, 300, 450, 600, 750, 950, 1150, + 1350, 1600, 1850, 2100, 2400, 2700, 3000, 3350, + 3700, 4050, 4450, 4850, 5250, 5700, 6150, 6600, + 7100, 7600, 8100, 8650, 9200}; #define BUTTHURT_MAX 14 #define BUTTHURT_MIN 0 diff --git a/applications/services/power/power_service/power.c b/applications/services/power/power_service/power.c index f0f7735fb..e52cb4e10 100644 --- a/applications/services/power/power_service/power.c +++ b/applications/services/power/power_service/power.c @@ -26,7 +26,7 @@ void power_draw_battery_callback(Canvas* canvas, void* context) { snprintf(batteryPercentile, sizeof(batteryPercentile), "%d", power->info.charge); if((battery_style == BatteryStylePercent) && - (power->state != + (power->state != PowerStateCharging)) { //if display battery percentage, black background white text canvas_set_font(canvas, FontBatteryPercent); canvas_set_color(canvas, ColorBlack); @@ -36,7 +36,7 @@ void power_draw_battery_callback(Canvas* canvas, void* context) { } else if( (battery_style == BatteryStyleInvertedPercent) && (power->state != - PowerStateCharging)) { //if display inverted percentage, white background black text + PowerStateCharging)) { //if display inverted percentage, white background black text canvas_set_font(canvas, FontBatteryPercent); canvas_set_color(canvas, ColorBlack); canvas_draw_str_aligned(canvas, 11, 4, AlignCenter, AlignCenter, batteryPercentile); @@ -74,7 +74,7 @@ void power_draw_battery_callback(Canvas* canvas, void* context) { (battery_style == BatteryStyleBarPercent) && (power->state != PowerStateCharging) && // Default bar display with percentage (power->info.voltage_battery_charging >= - 4.2)) { // not looking nice with low voltage indicator + 4.2)) { // not looking nice with low voltage indicator canvas_set_font(canvas, FontBatteryPercent); // align charge dispaly value with digits to draw @@ -145,8 +145,7 @@ void power_draw_battery_callback(Canvas* canvas, void* context) { if(power->state == PowerStateCharging) { canvas_set_bitmap_mode(canvas, 1); // TODO: replace -1 magic for uint8_t with re-framing - if(battery_style == BatteryStylePercent || - battery_style == BatteryStyleBarPercent) { + if(battery_style == BatteryStylePercent || battery_style == BatteryStyleBarPercent) { canvas_set_color(canvas, ColorBlack); canvas_draw_box(canvas, 1, 1, 22, 6); canvas_draw_icon(canvas, 2, -1, &I_Charging_lightning_9x10); diff --git a/applications/settings/about/about.c b/applications/settings/about/about.c index 42712bc9c..918083265 100644 --- a/applications/settings/about/about.c +++ b/applications/settings/about/about.c @@ -222,9 +222,9 @@ static void draw_battery(Canvas* canvas, PowerInfo* info, int x, int y) { snprintf(header, sizeof(header), "Charged!"); } - if (!strcmp(value, "")) { + if(!strcmp(value, "")) { canvas_draw_str_aligned(canvas, x + 92, y + 14, AlignCenter, AlignCenter, header); - } else if (!strcmp(header, "")) { + } else if(!strcmp(header, "")) { canvas_draw_str_aligned(canvas, x + 92, y + 14, AlignCenter, AlignCenter, value); } else { canvas_draw_str_aligned(canvas, x + 92, y + 9, AlignCenter, AlignCenter, header); @@ -298,7 +298,6 @@ const AboutDialogScreen about_screens[] = { const int about_screens_count = sizeof(about_screens) / sizeof(AboutDialogScreen); - int32_t about_settings_app(void* p) { bool battery_info = false; if(p && strlen(p) && !strcmp(p, "batt")) { @@ -324,24 +323,19 @@ int32_t about_settings_app(void* p) { DialogMessageButton screen_result; // draw empty screen to prevent menu flickering - view_dispatcher_add_view( - view_dispatcher, battery_info_index, battery_view); + view_dispatcher_add_view(view_dispatcher, battery_info_index, battery_view); view_dispatcher_add_view( view_dispatcher, empty_screen_index, empty_screen_get_view(empty_screen)); view_dispatcher_attach_to_gui(view_dispatcher, gui, ViewDispatcherTypeFullscreen); screen_index = -1 + !battery_info; while(screen_index > -2) { - - if (screen_index == -1) { - if (!battery_info) { + if(screen_index == -1) { + if(!battery_info) { break; } with_view_model( - battery_view, - PowerInfo * model, - { power_get_info(power, model); }, - true); + battery_view, PowerInfo * model, { power_get_info(power, model); }, true); view_dispatcher_switch_to_view(view_dispatcher, battery_info_index); furi_semaphore_acquire(semaphore, 2000); } else { @@ -360,7 +354,6 @@ int32_t about_settings_app(void* p) { screen_index = -2; } } - } dialog_message_free(message); diff --git a/applications/settings/dolphin_passport/passport.c b/applications/settings/dolphin_passport/passport.c index 3bea705ac..f0430de5d 100644 --- a/applications/settings/dolphin_passport/passport.c +++ b/applications/settings/dolphin_passport/passport.c @@ -67,7 +67,7 @@ static void render_callback(Canvas* canvas, void* _ctx) { uint32_t xp_need = dolphin_state_xp_to_levelup(stats->icounter); uint32_t xp_above_last_levelup = dolphin_state_xp_above_last_levelup(stats->icounter); uint32_t xp_levelup = 0; - if (ctx->progress_total) { + if(ctx->progress_total) { xp_levelup = xp_need + stats->icounter; } else { xp_levelup = xp_need + xp_above_last_levelup; diff --git a/applications/settings/xtreme_settings/scenes/xtreme_settings_scene_start.c b/applications/settings/xtreme_settings/scenes/xtreme_settings_scene_start.c index 90bdde83f..53d679efb 100644 --- a/applications/settings/xtreme_settings/scenes/xtreme_settings_scene_start.c +++ b/applications/settings/xtreme_settings/scenes/xtreme_settings_scene_start.c @@ -15,8 +15,12 @@ static void xtreme_settings_scene_start_base_graphics_changed(VariableItem* item static void xtreme_settings_scene_start_asset_pack_changed(VariableItem* item) { XtremeSettingsApp* app = variable_item_get_context(item); uint8_t index = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, index == 0 ? "OFF" : *asset_packs_get(app->asset_packs, index - 1)); - strlcpy(XTREME_SETTINGS()->asset_pack, index == 0 ? "" : *asset_packs_get(app->asset_packs, index - 1), MAX_PACK_NAME_LEN); + variable_item_set_current_value_text( + item, index == 0 ? "OFF" : *asset_packs_get(app->asset_packs, index - 1)); + strlcpy( + XTREME_SETTINGS()->asset_pack, + index == 0 ? "" : *asset_packs_get(app->asset_packs, index - 1), + MAX_PACK_NAME_LEN); app->settings_changed = true; app->assets_changed = true; } @@ -33,8 +37,20 @@ static void xtreme_settings_scene_start_anim_speed_changed(VariableItem* item) { app->settings_changed = true; } -const char* const cycle_anims_names[] = - {"OFF", "Meta.txt", "30 S", "1 M", "5 M", "10 M", "15 M", "30 M", "1 H", "2 H", "6 H", "12 H", "24 H"}; +const char* const cycle_anims_names[] = { + "OFF", + "Meta.txt", + "30 S", + "1 M", + "5 M", + "10 M", + "15 M", + "30 M", + "1 H", + "2 H", + "6 H", + "12 H", + "24 H"}; const int32_t cycle_anims_values[COUNT_OF(cycle_anims_names)] = {-1, 0, 30, 60, 300, 600, 900, 1800, 3600, 7200, 21600, 43200, 86400}; static void xtreme_settings_scene_start_cycle_anims_changed(VariableItem* item) { @@ -62,8 +78,7 @@ const int32_t battery_style_values[COUNT_OF(battery_style_names)] = { BatteryStyleInvertedPercent, BatteryStyleRetro3, BatteryStyleRetro5, - BatteryStyleBarPercent -}; + BatteryStyleBarPercent}; static void xtreme_settings_scene_start_battery_style_changed(VariableItem* item) { XtremeSettingsApp* app = variable_item_get_context(item); uint8_t index = variable_item_get_current_value_index(item); @@ -112,7 +127,8 @@ void xtreme_settings_scene_start_on_enter(void* context) { app->subghz_extend = false; app->subghz_bypass = false; if(flipper_format_file_open_existing(subghz_range, "/ext/subghz/assets/extend_range.txt")) { - flipper_format_read_bool(subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); + flipper_format_read_bool( + subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); flipper_format_read_bool(subghz_range, "ignore_default_tx_region", &app->subghz_bypass, 1); } flipper_format_free(subghz_range); @@ -123,14 +139,15 @@ void xtreme_settings_scene_start_on_enter(void* context) { FileInfo info; char* name = malloc(MAX_PACK_NAME_LEN); do { - if (!storage_dir_open(folder, PACKS_DIR)) break; + if(!storage_dir_open(folder, PACKS_DIR)) break; while(true) { - if (!storage_dir_read(folder, &info, name, MAX_PACK_NAME_LEN)) break; + if(!storage_dir_read(folder, &info, name, MAX_PACK_NAME_LEN)) break; if(info.flags & FSF_DIRECTORY) { char* copy = malloc(MAX_PACK_NAME_LEN); strlcpy(copy, name, MAX_PACK_NAME_LEN); asset_packs_push_back(app->asset_packs, copy); - if (strcmp(name, xtreme_settings->asset_pack) == 0) current_pack = asset_packs_size(app->asset_packs); + if(strcmp(name, xtreme_settings->asset_pack) == 0) + current_pack = asset_packs_size(app->asset_packs); } } } while(false); @@ -139,11 +156,7 @@ void xtreme_settings_scene_start_on_enter(void* context) { furi_record_close(RECORD_STORAGE); item = variable_item_list_add( - var_item_list, - "Base Graphics", - 2, - xtreme_settings_scene_start_base_graphics_changed, - app); + var_item_list, "Base Graphics", 2, xtreme_settings_scene_start_base_graphics_changed, app); variable_item_set_current_value_index(item, xtreme_settings->nsfw_mode); variable_item_set_current_value_text(item, xtreme_settings->nsfw_mode ? "NSFW" : "SFW"); @@ -154,7 +167,8 @@ void xtreme_settings_scene_start_on_enter(void* context) { xtreme_settings_scene_start_asset_pack_changed, app); variable_item_set_current_value_index(item, current_pack); - variable_item_set_current_value_text(item, current_pack == 0 ? "OFF" : *asset_packs_get(app->asset_packs, current_pack - 1)); + variable_item_set_current_value_text( + item, current_pack == 0 ? "OFF" : *asset_packs_get(app->asset_packs, current_pack - 1)); item = variable_item_list_add( var_item_list, @@ -179,11 +193,7 @@ void xtreme_settings_scene_start_on_enter(void* context) { variable_item_set_current_value_text(item, cycle_anims_names[value_index]); item = variable_item_list_add( - var_item_list, - "Unlock Anims", - 2, - xtreme_settings_scene_start_unlock_anims_changed, - app); + var_item_list, "Unlock Anims", 2, xtreme_settings_scene_start_unlock_anims_changed, app); variable_item_set_current_value_index(item, xtreme_settings->unlock_anims); variable_item_set_current_value_text(item, xtreme_settings->unlock_anims ? "ON" : "OFF"); @@ -210,30 +220,18 @@ void xtreme_settings_scene_start_on_enter(void* context) { variable_item_set_current_value_text(item, level_str); item = variable_item_list_add( - var_item_list, - "SubGHz Extend", - 2, - xtreme_settings_scene_start_subghz_extend_changed, - app); + var_item_list, "SubGHz Extend", 2, xtreme_settings_scene_start_subghz_extend_changed, app); variable_item_set_current_value_index(item, app->subghz_extend); variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF"); item = variable_item_list_add( - var_item_list, - "SubGHz Bypass", - 2, - xtreme_settings_scene_start_subghz_bypass_changed, - app); + var_item_list, "SubGHz Bypass", 2, xtreme_settings_scene_start_subghz_bypass_changed, app); variable_item_set_current_value_index(item, app->subghz_bypass); variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF"); - FuriString* version_tag = furi_string_alloc_printf("%s %s", version_get_gitbranchnum(NULL), version_get_builddate(NULL)); - item = variable_item_list_add( - var_item_list, - furi_string_get_cstr(version_tag), - 0, - NULL, - app); + FuriString* version_tag = furi_string_alloc_printf( + "%s %s", version_get_gitbranchnum(NULL), version_get_builddate(NULL)); + item = variable_item_list_add(var_item_list, furi_string_get_cstr(version_tag), 0, NULL, app); view_dispatcher_switch_to_view(app->view_dispatcher, XtremeSettingsAppViewVarItemList); } @@ -248,7 +246,7 @@ bool xtreme_settings_scene_start_on_event(void* context, SceneManagerEvent event void xtreme_settings_scene_start_on_exit(void* context) { XtremeSettingsApp* app = context; asset_packs_it_t it; - for (asset_packs_it(it, app->asset_packs); !asset_packs_end_p(it); asset_packs_next(it)) { + for(asset_packs_it(it, app->asset_packs); !asset_packs_end_p(it); asset_packs_next(it)) { free(*asset_packs_cref(it)); } asset_packs_clear(app->asset_packs); diff --git a/applications/settings/xtreme_settings/xtreme_assets.c b/applications/settings/xtreme_settings/xtreme_assets.c index 444b50951..0f6ab998d 100644 --- a/applications/settings/xtreme_settings/xtreme_assets.c +++ b/applications/settings/xtreme_settings/xtreme_assets.c @@ -5,94 +5,158 @@ XtremeAssets* xtreme_assets = NULL; XtremeAssets* XTREME_ASSETS() { - if (xtreme_assets == NULL) { + if(xtreme_assets == NULL) { XTREME_ASSETS_LOAD(); } return xtreme_assets; } void XTREME_ASSETS_LOAD() { - if (xtreme_assets != NULL) return; + if(xtreme_assets != NULL) return; xtreme_assets = malloc(sizeof(XtremeAssets)); XtremeSettings* xtreme_settings = XTREME_SETTINGS(); - if (xtreme_settings->nsfw_mode) { - xtreme_assets->I_BLE_Pairing_128x64 = &I_BLE_Pairing_128x64; - xtreme_assets->I_DolphinCommon_56x48 = &I_DolphinCommon_56x48; - xtreme_assets->I_DolphinMafia_115x62 = &I_DolphinMafia_115x62; - xtreme_assets->I_DolphinNice_96x59 = &I_DolphinNice_96x59; - xtreme_assets->I_DolphinWait_61x59 = &I_DolphinWait_61x59; + if(xtreme_settings->nsfw_mode) { + xtreme_assets->I_BLE_Pairing_128x64 = &I_BLE_Pairing_128x64; + xtreme_assets->I_DolphinCommon_56x48 = &I_DolphinCommon_56x48; + xtreme_assets->I_DolphinMafia_115x62 = &I_DolphinMafia_115x62; + xtreme_assets->I_DolphinNice_96x59 = &I_DolphinNice_96x59; + xtreme_assets->I_DolphinWait_61x59 = &I_DolphinWait_61x59; xtreme_assets->I_iButtonDolphinVerySuccess_108x52 = &I_iButtonDolphinVerySuccess_108x52; - xtreme_assets->I_DolphinReadingSuccess_59x63 = &I_DolphinReadingSuccess_59x63; - xtreme_assets->I_NFC_dolphin_emulation_47x61 = &I_NFC_dolphin_emulation_47x61; - xtreme_assets->I_passport_bad_46x49 = &I_flipper; - xtreme_assets->I_passport_DB = &I_passport_DB; - xtreme_assets->I_passport_happy_46x49 = &I_flipper; - xtreme_assets->I_passport_okay_46x49 = &I_flipper; - xtreme_assets->I_RFIDDolphinReceive_97x61 = &I_RFIDDolphinReceive_97x61; - xtreme_assets->I_RFIDDolphinSend_97x61 = &I_RFIDDolphinSend_97x61; - xtreme_assets->I_RFIDDolphinSuccess_108x57 = &I_RFIDDolphinSuccess_108x57; - xtreme_assets->I_Cry_dolph_55x52 = &I_Cry_dolph_55x52; - xtreme_assets->I_Scanning_123x52 = &I_Scanning_123x52; - xtreme_assets->I_Auth_62x31 = &I_Auth_62x31; - xtreme_assets->I_Connect_me_62x31 = &I_Connect_me_62x31; - xtreme_assets->I_Connected_62x31 = &I_Connected_62x31; - xtreme_assets->I_Error_62x31 = &I_Error_62x31; + xtreme_assets->I_DolphinReadingSuccess_59x63 = &I_DolphinReadingSuccess_59x63; + xtreme_assets->I_NFC_dolphin_emulation_47x61 = &I_NFC_dolphin_emulation_47x61; + xtreme_assets->I_passport_bad_46x49 = &I_flipper; + xtreme_assets->I_passport_DB = &I_passport_DB; + xtreme_assets->I_passport_happy_46x49 = &I_flipper; + xtreme_assets->I_passport_okay_46x49 = &I_flipper; + xtreme_assets->I_RFIDDolphinReceive_97x61 = &I_RFIDDolphinReceive_97x61; + xtreme_assets->I_RFIDDolphinSend_97x61 = &I_RFIDDolphinSend_97x61; + xtreme_assets->I_RFIDDolphinSuccess_108x57 = &I_RFIDDolphinSuccess_108x57; + xtreme_assets->I_Cry_dolph_55x52 = &I_Cry_dolph_55x52; + xtreme_assets->I_Scanning_123x52 = &I_Scanning_123x52; + xtreme_assets->I_Auth_62x31 = &I_Auth_62x31; + xtreme_assets->I_Connect_me_62x31 = &I_Connect_me_62x31; + xtreme_assets->I_Connected_62x31 = &I_Connected_62x31; + xtreme_assets->I_Error_62x31 = &I_Error_62x31; } else { - xtreme_assets->I_BLE_Pairing_128x64 = &I_BLE_Pairing_128x64_sfw; - xtreme_assets->I_DolphinCommon_56x48 = &I_DolphinCommon_56x48_sfw; - xtreme_assets->I_DolphinMafia_115x62 = &I_DolphinMafia_115x62_sfw; - xtreme_assets->I_DolphinNice_96x59 = &I_DolphinNice_96x59_sfw; - xtreme_assets->I_DolphinWait_61x59 = &I_DolphinWait_61x59_sfw; - xtreme_assets->I_iButtonDolphinVerySuccess_108x52 = &I_iButtonDolphinVerySuccess_108x52_sfw; - xtreme_assets->I_DolphinReadingSuccess_59x63 = &I_DolphinReadingSuccess_59x63_sfw; - xtreme_assets->I_NFC_dolphin_emulation_47x61 = &I_NFC_dolphin_emulation_47x61_sfw; - xtreme_assets->I_passport_bad_46x49 = &I_passport_bad1_46x49_sfw; - xtreme_assets->I_passport_DB = &I_passport_DB_sfw; - xtreme_assets->I_passport_happy_46x49 = &I_passport_happy1_46x49_sfw; - xtreme_assets->I_passport_okay_46x49 = &I_passport_okay1_46x49_sfw; - xtreme_assets->I_RFIDDolphinReceive_97x61 = &I_RFIDDolphinReceive_97x61_sfw; - xtreme_assets->I_RFIDDolphinSend_97x61 = &I_RFIDDolphinSend_97x61_sfw; - xtreme_assets->I_RFIDDolphinSuccess_108x57 = &I_RFIDDolphinSuccess_108x57_sfw; - xtreme_assets->I_Cry_dolph_55x52 = &I_Cry_dolph_55x52_sfw; - xtreme_assets->I_Scanning_123x52 = &I_Scanning_123x52_sfw; - xtreme_assets->I_Auth_62x31 = &I_Auth_62x31_sfw; - xtreme_assets->I_Connect_me_62x31 = &I_Connect_me_62x31_sfw; - xtreme_assets->I_Connected_62x31 = &I_Connected_62x31_sfw; - xtreme_assets->I_Error_62x31 = &I_Error_62x31_sfw; + xtreme_assets->I_BLE_Pairing_128x64 = &I_BLE_Pairing_128x64_sfw; + xtreme_assets->I_DolphinCommon_56x48 = &I_DolphinCommon_56x48_sfw; + xtreme_assets->I_DolphinMafia_115x62 = &I_DolphinMafia_115x62_sfw; + xtreme_assets->I_DolphinNice_96x59 = &I_DolphinNice_96x59_sfw; + xtreme_assets->I_DolphinWait_61x59 = &I_DolphinWait_61x59_sfw; + xtreme_assets->I_iButtonDolphinVerySuccess_108x52 = + &I_iButtonDolphinVerySuccess_108x52_sfw; + xtreme_assets->I_DolphinReadingSuccess_59x63 = &I_DolphinReadingSuccess_59x63_sfw; + xtreme_assets->I_NFC_dolphin_emulation_47x61 = &I_NFC_dolphin_emulation_47x61_sfw; + xtreme_assets->I_passport_bad_46x49 = &I_passport_bad1_46x49_sfw; + xtreme_assets->I_passport_DB = &I_passport_DB_sfw; + xtreme_assets->I_passport_happy_46x49 = &I_passport_happy1_46x49_sfw; + xtreme_assets->I_passport_okay_46x49 = &I_passport_okay1_46x49_sfw; + xtreme_assets->I_RFIDDolphinReceive_97x61 = &I_RFIDDolphinReceive_97x61_sfw; + xtreme_assets->I_RFIDDolphinSend_97x61 = &I_RFIDDolphinSend_97x61_sfw; + xtreme_assets->I_RFIDDolphinSuccess_108x57 = &I_RFIDDolphinSuccess_108x57_sfw; + xtreme_assets->I_Cry_dolph_55x52 = &I_Cry_dolph_55x52_sfw; + xtreme_assets->I_Scanning_123x52 = &I_Scanning_123x52_sfw; + xtreme_assets->I_Auth_62x31 = &I_Auth_62x31_sfw; + xtreme_assets->I_Connect_me_62x31 = &I_Connect_me_62x31_sfw; + xtreme_assets->I_Connected_62x31 = &I_Connected_62x31_sfw; + xtreme_assets->I_Error_62x31 = &I_Error_62x31_sfw; } - if (xtreme_settings->asset_pack[0] == '\0') return; + if(xtreme_settings->asset_pack[0] == '\0') return; FileInfo info; FuriString* path = furi_string_alloc(); const char* pack = xtreme_settings->asset_pack; furi_string_printf(path, PACKS_DIR "/%s", pack); Storage* storage = furi_record_open(RECORD_STORAGE); - if (storage_common_stat(storage, furi_string_get_cstr(path), &info) == FSE_OK && info.flags & FSF_DIRECTORY) { + if(storage_common_stat(storage, furi_string_get_cstr(path), &info) == FSE_OK && + info.flags & FSF_DIRECTORY) { File* file = storage_file_alloc(storage); - swap_bmx_icon(&xtreme_assets->I_BLE_Pairing_128x64, pack, "BLE/BLE_Pairing_128x64.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_DolphinCommon_56x48, pack, "Dolphin/DolphinCommon_56x48.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_DolphinMafia_115x62, pack, "iButton/DolphinMafia_115x62.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_DolphinNice_96x59, pack, "iButton/DolphinNice_96x59.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_DolphinWait_61x59, pack, "iButton/DolphinWait_61x59.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_iButtonDolphinVerySuccess_108x52, pack, "iButton/iButtonDolphinVerySuccess_108x52.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_DolphinReadingSuccess_59x63, pack, "Infrared/DolphinReadingSuccess_59x63.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_NFC_dolphin_emulation_47x61, pack, "NFC/NFC_dolphin_emulation_47x61.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_passport_bad_46x49, pack, "Passport/passport_bad_46x49.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_passport_DB, pack, "Passport/passport_DB.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_passport_happy_46x49, pack, "Passport/passport_happy_46x49.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_passport_okay_46x49, pack, "Passport/passport_okay_46x49.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_RFIDDolphinReceive_97x61, pack, "RFID/RFIDDolphinReceive_97x61.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_RFIDDolphinSend_97x61, pack, "RFID/RFIDDolphinSend_97x61.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_RFIDDolphinSuccess_108x57, pack, "RFID/RFIDDolphinSuccess_108x57.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_Cry_dolph_55x52, pack, "Settings/Cry_dolph_55x52.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_Scanning_123x52, pack, "SubGhz/Scanning_123x52.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_Auth_62x31, pack, "U2F/Auth_62x31.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_Connect_me_62x31, pack, "U2F/Connect_me_62x31.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_Connected_62x31, pack, "U2F/Connected_62x31.bmx", path, file); - swap_bmx_icon(&xtreme_assets->I_Error_62x31, pack, "U2F/Error_62x31.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_BLE_Pairing_128x64, pack, "BLE/BLE_Pairing_128x64.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_DolphinCommon_56x48, + pack, + "Dolphin/DolphinCommon_56x48.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_DolphinMafia_115x62, + pack, + "iButton/DolphinMafia_115x62.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_DolphinNice_96x59, pack, "iButton/DolphinNice_96x59.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_DolphinWait_61x59, pack, "iButton/DolphinWait_61x59.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_iButtonDolphinVerySuccess_108x52, + pack, + "iButton/iButtonDolphinVerySuccess_108x52.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_DolphinReadingSuccess_59x63, + pack, + "Infrared/DolphinReadingSuccess_59x63.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_NFC_dolphin_emulation_47x61, + pack, + "NFC/NFC_dolphin_emulation_47x61.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_passport_bad_46x49, + pack, + "Passport/passport_bad_46x49.bmx", + path, + file); + swap_bmx_icon(&xtreme_assets->I_passport_DB, pack, "Passport/passport_DB.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_passport_happy_46x49, + pack, + "Passport/passport_happy_46x49.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_passport_okay_46x49, + pack, + "Passport/passport_okay_46x49.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_RFIDDolphinReceive_97x61, + pack, + "RFID/RFIDDolphinReceive_97x61.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_RFIDDolphinSend_97x61, + pack, + "RFID/RFIDDolphinSend_97x61.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_RFIDDolphinSuccess_108x57, + pack, + "RFID/RFIDDolphinSuccess_108x57.bmx", + path, + file); + swap_bmx_icon( + &xtreme_assets->I_Cry_dolph_55x52, pack, "Settings/Cry_dolph_55x52.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_Scanning_123x52, pack, "SubGhz/Scanning_123x52.bmx", path, file); + swap_bmx_icon(&xtreme_assets->I_Auth_62x31, pack, "U2F/Auth_62x31.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_Connect_me_62x31, pack, "U2F/Connect_me_62x31.bmx", path, file); + swap_bmx_icon( + &xtreme_assets->I_Connected_62x31, pack, "U2F/Connected_62x31.bmx", path, file); + swap_bmx_icon(&xtreme_assets->I_Error_62x31, pack, "U2F/Error_62x31.bmx", path, file); storage_file_free(file); } @@ -100,9 +164,14 @@ void XTREME_ASSETS_LOAD() { furi_string_free(path); } -void swap_bmx_icon(const Icon** replace, const char* pack, const char* name, FuriString* path, File* file) { +void swap_bmx_icon( + const Icon** replace, + const char* pack, + const char* name, + FuriString* path, + File* file) { furi_string_printf(path, PACKS_DIR "/%s/Icons/%s", pack, name); - if (storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { + if(storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { uint64_t size = storage_file_size(file) - 8; int32_t width, height; storage_file_read(file, &width, 4); diff --git a/applications/settings/xtreme_settings/xtreme_assets.h b/applications/settings/xtreme_settings/xtreme_assets.h index df618c47d..c49f5b590 100644 --- a/applications/settings/xtreme_settings/xtreme_assets.h +++ b/applications/settings/xtreme_settings/xtreme_assets.h @@ -34,6 +34,11 @@ XtremeAssets* XTREME_ASSETS(); void XTREME_ASSETS_LOAD(); -void swap_bmx_icon(const Icon** replace, const char* base, const char* name, FuriString* path, File* file); +void swap_bmx_icon( + const Icon** replace, + const char* base, + const char* name, + FuriString* path, + File* file); void free_bmx_icon(Icon* icon); diff --git a/applications/settings/xtreme_settings/xtreme_settings.c b/applications/settings/xtreme_settings/xtreme_settings.c index 84018bcf0..3db0a4c1c 100644 --- a/applications/settings/xtreme_settings/xtreme_settings.c +++ b/applications/settings/xtreme_settings/xtreme_settings.c @@ -3,17 +3,21 @@ XtremeSettings* xtreme_settings = NULL; XtremeSettings* XTREME_SETTINGS() { - if (xtreme_settings == NULL) { + if(xtreme_settings == NULL) { XTREME_SETTINGS_LOAD(); } return xtreme_settings; } bool XTREME_SETTINGS_LOAD() { - if (xtreme_settings == NULL) { + if(xtreme_settings == NULL) { xtreme_settings = malloc(sizeof(XtremeSettings)); bool loaded = saved_struct_load( - XTREME_SETTINGS_PATH, xtreme_settings, sizeof(XtremeSettings), XTREME_SETTINGS_MAGIC, XTREME_SETTINGS_VERSION); + XTREME_SETTINGS_PATH, + xtreme_settings, + sizeof(XtremeSettings), + XTREME_SETTINGS_MAGIC, + XTREME_SETTINGS_VERSION); if(!loaded) { memset(xtreme_settings, 0, sizeof(XtremeSettings)); loaded = XTREME_SETTINGS_SAVE(); @@ -24,9 +28,13 @@ bool XTREME_SETTINGS_LOAD() { } bool XTREME_SETTINGS_SAVE() { - if (xtreme_settings == NULL) { + if(xtreme_settings == NULL) { XTREME_SETTINGS_LOAD(); } return saved_struct_save( - XTREME_SETTINGS_PATH, xtreme_settings, sizeof(XtremeSettings), XTREME_SETTINGS_MAGIC, XTREME_SETTINGS_VERSION); + XTREME_SETTINGS_PATH, + xtreme_settings, + sizeof(XtremeSettings), + XTREME_SETTINGS_MAGIC, + XTREME_SETTINGS_VERSION); } diff --git a/applications/settings/xtreme_settings/xtreme_settings_app.c b/applications/settings/xtreme_settings/xtreme_settings_app.c index 780e76730..6b0a12f1c 100644 --- a/applications/settings/xtreme_settings/xtreme_settings_app.c +++ b/applications/settings/xtreme_settings/xtreme_settings_app.c @@ -15,10 +15,10 @@ static bool xtreme_settings_back_event_callback(void* context) { furi_assert(context); XtremeSettingsApp* app = context; - if (app->level_changed) { + if(app->level_changed) { Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN); DolphinStats stats = dolphin_stats(dolphin); - if (app->dolphin_level != stats.level) { + if(app->dolphin_level != stats.level) { int xp = app->dolphin_level > 1 ? dolphin_get_levels()[app->dolphin_level - 2] : 0; dolphin->state->data.icounter = xp + 1; dolphin->state->dirty = true; @@ -27,20 +27,22 @@ static bool xtreme_settings_back_event_callback(void* context) { furi_record_close(RECORD_DOLPHIN); } - if (app->subghz_changed) { + if(app->subghz_changed) { Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* subghz_range = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(subghz_range, "/ext/subghz/assets/extend_range.txt")) { - flipper_format_insert_or_update_bool(subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); - flipper_format_insert_or_update_bool(subghz_range, "ignore_default_tx_region", &app->subghz_bypass, 1); + flipper_format_insert_or_update_bool( + subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); + flipper_format_insert_or_update_bool( + subghz_range, "ignore_default_tx_region", &app->subghz_bypass, 1); } flipper_format_free(subghz_range); furi_record_close(RECORD_STORAGE); } - if (app->settings_changed) { + if(app->settings_changed) { XTREME_SETTINGS_SAVE(); - if (app->assets_changed) { + if(app->assets_changed) { popup_set_header(app->popup, "Rebooting...", 64, 26, AlignCenter, AlignCenter); popup_set_text(app->popup, "Swapping assets...", 64, 40, AlignCenter, AlignCenter); popup_set_callback(app->popup, xtreme_settings_reboot); @@ -81,9 +83,7 @@ XtremeSettingsApp* xtreme_settings_app_alloc() { app->popup = popup_alloc(); view_dispatcher_add_view( - app->view_dispatcher, - XtremeSettingsAppViewPopup, - popup_get_view(app->popup)); + app->view_dispatcher, XtremeSettingsAppViewPopup, popup_get_view(app->popup)); // Set first scene scene_manager_next_scene(app->scene_manager, XtremeSettingsAppSceneStart); diff --git a/firmware/targets/f7/ble_glue/gap.c b/firmware/targets/f7/ble_glue/gap.c index 8023b8915..725a69dfb 100644 --- a/firmware/targets/f7/ble_glue/gap.c +++ b/firmware/targets/f7/ble_glue/gap.c @@ -56,8 +56,8 @@ static Gap* gap = NULL; static inline void fetch_rssi() { uint8_t ret_rssi = 127; - if (hci_read_rssi(gap->service.connection_handle, &ret_rssi) == BLE_STATUS_SUCCESS) { - gap->conn_rssi = (int8_t) ret_rssi; + if(hci_read_rssi(gap->service.connection_handle, &ret_rssi) == BLE_STATUS_SUCCESS) { + gap->conn_rssi = (int8_t)ret_rssi; gap->time_rssi_sample = furi_get_tick(); return; } @@ -166,7 +166,6 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void* pckt) { gap->connection_params.slave_latency = event->Conn_Latency; gap->connection_params.supervisor_timeout = event->Supervision_Timeout; - // Stop advertising as connection completed furi_timer_stop(gap->advertise_timer); @@ -383,7 +382,7 @@ static void gap_init_svc(Gap* gap) { keypress_supported, CFG_ENCRYPTION_KEY_SIZE_MIN, CFG_ENCRYPTION_KEY_SIZE_MAX, - CFG_USED_FIXED_PIN, // 0x0 for no pin + CFG_USED_FIXED_PIN, // 0x0 for no pin 0, PUBLIC_ADDR); // Configure whitelist @@ -504,9 +503,15 @@ bool gap_init(GapConfig* config, GapEventCallback on_event_cb, void* context) { // Initialization of GATT & GAP layer gap->service.adv_name = config->adv_name; FURI_LOG_I(TAG, "Advertising name: %s", &(gap->service.adv_name[1])); - FURI_LOG_I(TAG, "MAC @ : %02X:%02X:%02X:%02X:%02X:%02X", - config->mac_address[0], config->mac_address[1], config->mac_address[2], - config->mac_address[3], config->mac_address[4], config->mac_address[5]); + FURI_LOG_I( + TAG, + "MAC @ : %02X:%02X:%02X:%02X:%02X:%02X", + config->mac_address[0], + config->mac_address[1], + config->mac_address[2], + config->mac_address[3], + config->mac_address[4], + config->mac_address[5]); gap_init_svc(gap); // Initialization of the BLE Services SVCCTL_Init(); @@ -538,15 +543,12 @@ bool gap_init(GapConfig* config, GapEventCallback on_event_cb, void* context) { return true; } -uint32_t gap_get_remote_conn_rssi(int8_t *rssi) { - if (gap && gap->state == GapStateConnected) { +uint32_t gap_get_remote_conn_rssi(int8_t* rssi) { + if(gap && gap->state == GapStateConnected) { fetch_rssi(); *rssi = gap->conn_rssi; - FURI_LOG_D(TAG, "RSSI: %d", *rssi); - - if (gap->time_rssi_sample) - return furi_get_tick() - gap->time_rssi_sample; + if(gap->time_rssi_sample) return furi_get_tick() - gap->time_rssi_sample; } return 0; } diff --git a/firmware/targets/f7/ble_glue/gap.h b/firmware/targets/f7/ble_glue/gap.h index 3b9ca5b28..7b317e06c 100644 --- a/firmware/targets/f7/ble_glue/gap.h +++ b/firmware/targets/f7/ble_glue/gap.h @@ -81,7 +81,7 @@ GapState gap_get_state(); void gap_thread_stop(); -uint32_t gap_get_remote_conn_rssi(int8_t *rssi); +uint32_t gap_get_remote_conn_rssi(int8_t* rssi); #ifdef __cplusplus } diff --git a/firmware/targets/f7/furi_hal/furi_hal_bt.c b/firmware/targets/f7/furi_hal/furi_hal_bt.c index f01b66d14..1e7b80040 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_bt.c +++ b/firmware/targets/f7/furi_hal/furi_hal_bt.c @@ -429,15 +429,13 @@ float furi_hal_bt_get_rssi() { * the beginning of the connection * */ -uint32_t furi_hal_bt_get_conn_rssi(uint8_t *rssi) { - +uint32_t furi_hal_bt_get_conn_rssi(uint8_t* rssi) { int8_t ret_rssi = 0; uint32_t since = gap_get_remote_conn_rssi(&ret_rssi); - if (ret_rssi == 127 || since == 0) - return 0; + if(ret_rssi == 127 || since == 0) return 0; - *rssi = (uint8_t) abs(ret_rssi); + *rssi = (uint8_t)abs(ret_rssi); return since; } @@ -469,12 +467,14 @@ bool furi_hal_bt_ensure_c2_mode(BleGlueC2Mode mode) { void furi_hal_bt_set_profile_adv_name( FuriHalBtProfile profile, - const char name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH-1]) { + const char name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH - 1]) { furi_assert(profile < FuriHalBtProfileNumber); furi_assert(name); memcpy( - &(profile_config[profile].config.adv_name[1]), name, FURI_HAL_VERSION_DEVICE_NAME_LENGTH-1); + &(profile_config[profile].config.adv_name[1]), + name, + FURI_HAL_VERSION_DEVICE_NAME_LENGTH - 1); } const char* furi_hal_bt_get_profile_adv_name(FuriHalBtProfile profile) { diff --git a/firmware/targets/f7/furi_hal/furi_hal_bt_hid.c b/firmware/targets/f7/furi_hal/furi_hal_bt_hid.c index 501704420..424999fc0 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_bt_hid.c +++ b/firmware/targets/f7/furi_hal/furi_hal_bt_hid.c @@ -199,8 +199,7 @@ bool furi_hal_bt_hid_kb_press(uint16_t button) { bool furi_hal_bt_hid_kb_free_slots(uint8_t n_empty_slots) { furi_assert(kb_report); for(uint8_t i = 0; n_empty_slots > 0 && i < FURI_HAL_BT_HID_KB_MAX_KEYS; i++) { - if(kb_report->key[i] == 0) - n_empty_slots--; + if(kb_report->key[i] == 0) n_empty_slots--; } return (n_empty_slots == 0); } diff --git a/firmware/targets/furi_hal_include/furi_hal_bt.h b/firmware/targets/furi_hal_include/furi_hal_bt.h index 45d2a4261..fb17436f4 100644 --- a/firmware/targets/furi_hal_include/furi_hal_bt.h +++ b/firmware/targets/furi_hal_include/furi_hal_bt.h @@ -228,19 +228,23 @@ bool furi_hal_bt_ensure_c2_mode(BleGlueC2Mode mode); * @param[in] profile profile type * @param[in] name new adv name */ -void furi_hal_bt_set_profile_adv_name(FuriHalBtProfile profile, const char name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH-1]); +void furi_hal_bt_set_profile_adv_name( + FuriHalBtProfile profile, + const char name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH - 1]); -const char *furi_hal_bt_get_profile_adv_name(FuriHalBtProfile profile); +const char* furi_hal_bt_get_profile_adv_name(FuriHalBtProfile profile); /** Modify profile mac address and restart bluetooth * @param[in] profile profile type * @param[in] mac new mac address */ -void furi_hal_bt_set_profile_mac_addr(FuriHalBtProfile profile, const uint8_t mac_addr[GAP_MAC_ADDR_SIZE]); +void furi_hal_bt_set_profile_mac_addr( + FuriHalBtProfile profile, + const uint8_t mac_addr[GAP_MAC_ADDR_SIZE]); -const uint8_t *furi_hal_bt_get_profile_mac_addr(FuriHalBtProfile profile); +const uint8_t* furi_hal_bt_get_profile_mac_addr(FuriHalBtProfile profile); -uint32_t furi_hal_bt_get_conn_rssi(uint8_t *rssi); +uint32_t furi_hal_bt_get_conn_rssi(uint8_t* rssi); #ifdef __cplusplus } diff --git a/flipper.log b/flipper.log deleted file mode 100644 index f267750c0..000000000 --- a/flipper.log +++ /dev/null @@ -1,3146 +0,0 @@ - - _.-------.._ -, - .-"```"--..,,_/ /`-, -, \ - .:" /:/ /'\ \ ,_..., `. | | - / ,----/:/ /`\ _\~`_-"` _; - ' / /`"""'\ \ \.~`_-' ,-"'/ - | | | 0 | | .-' ,/` / - | ,..\ \ ,.-"` ,/` / - ; : `/`""\` ,/--==,/-----, - | `-...| -.___-Z:_______J...---; - : ` _-' - _L_ _ ___ ___ ___ ___ ____--"`___ _ ___ -| __|| | |_ _|| _ \| _ \| __|| _ \ / __|| | |_ _| -| _| | |__ | | | _/| _/| _| | / | (__ | |__ | | -|_| |____||___||_| |_| |___||_|_\ \___||____||___| - -Welcome to Flipper Zero Command Line Interface! -Read Manual https://docs.flipperzero.one - -Firmware version: dev 0.74.3 (XFW-0040 built on 26-01-2023) - ->: log -Press CTRL+C to stop... -218220 [D][BrowserWorker] End -218233 [I][BtGap] Stop advertising -218237 [D][BtGap] set_non_discoverable success -218252 [I][SavedStruct] Loading "/int/.desktop.settings" -218390 [I][SavedStruct] Loading "/int/.desktop.settings" -218442 [I][FuriHalBt] Disconnect and stop advertising -218444 [I][FuriHalBt] Stop current profile services -218453 [I][FuriHalBt] Stop BLE related RTOS threads -218479 [I][FuriHalBt] Reset SHCI -218590 [I][SavedStruct] Loading "/int/.desktop.settings" -218594 [I][FuriHalBt] Start BT initialization -218601 [I][Core2] Core2 started -218604 [I][Core2] C2 boot completed, mode: Stack -218608 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -218612 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -218619 [I][Core2] Radio stack started -218623 [I][Core2] Flash activity control switched to SEM7 -218626 [I][BtGap] Advertising name: Keyboard -218629 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -218646 [D][BtBatterySvc] Updating power state characteristic -218651 [I][BtGap] Start advertising -218654 [I][SavedStruct] Loading "/int/.bt.settings" -218671 [I][SavedStruct] Loading "/ext/apps/Tools/.bt_hid.keys" -218681 [I][FuriHalBt] Disconnect and stop advertising -218683 [I][BtGap] Stop advertising -218686 [D][BtGap] set_non_discoverable success -218689 [I][FuriHalBt] Stop current profile services -218698 [I][FuriHalBt] Stop BLE related RTOS threads -218723 [I][FuriHalBt] Reset SHCI -218748 [I][SavedStruct] Loading "/int/.desktop.settings" -218790 [I][SavedStruct] Loading "/int/.desktop.settings" -218837 [I][FuriHalBt] Start BT initialization -218842 [I][Core2] Core2 started -218844 [I][Core2] C2 boot completed, mode: Stack -218847 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -218849 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -218854 [I][Core2] Radio stack started -218856 [I][Core2] Flash activity control switched to SEM7 -218859 [I][BtGap] Advertising name: Rumik1 -218861 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -218879 [D][BtBatterySvc] Updating power state characteristic -218889 [I][BtSrv] Bt App started -218891 [I][BtGap] Start advertising -218894 [I][BadBleWorker] Init -218896 [I][SavedStruct] Loading "/int/.desktop.settings" -218923 [I][BadBleWorker] BLE Key timeout : 16 -218990 [I][SavedStruct] Loading "/int/.desktop.settings" -219190 [I][SavedStruct] Loading "/int/.desktop.settings" -219248 [I][SavedStruct] Loading "/int/.desktop.settings" -219285 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -219287 [I][BtGap] Rssi: 295 -219390 [D][BtGap] Slave security initiated -219392 [I][SavedStruct] Loading "/int/.desktop.settings" -219508 [I][BtGap] Pairing complete -219511 [D][BtBatterySvc] Updating battery level characteristic -219515 [I][BadBleWorker] BLE Key timeout : 16 -219590 [I][SavedStruct] Loading "/int/.desktop.settings" -219687 [I][BtGap] Rx MTU size: 414 -219748 [I][SavedStruct] Loading "/int/.desktop.settings" -219790 [I][SavedStruct] Loading "/int/.desktop.settings" -219990 [I][SavedStruct] Loading "/int/.desktop.settings" -220190 [I][SavedStruct] Loading "/int/.desktop.settings" -220248 [I][SavedStruct] Loading "/int/.desktop.settings" -220282 [I][BtGap] Connection parameters event complete -220284 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -220287 [W][BtGap] Unsupported connection interval. Request connection parameters update -220290 [I][BtGap] Rssi: 298 -220335 [D][BtGap] Connection parameters accepted -220390 [I][SavedStruct] Loading "/int/.desktop.settings" -220498 [I][BtGap] Connection parameters event complete -220500 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -220506 [I][BtGap] Rssi: 293 -220590 [I][SavedStruct] Loading "/int/.desktop.settings" -220748 [I][SavedStruct] Loading "/int/.desktop.settings" -220790 [I][SavedStruct] Loading "/int/.desktop.settings" -220990 [I][SavedStruct] Loading "/int/.desktop.settings" -221190 [I][SavedStruct] Loading "/int/.desktop.settings" -221248 [I][SavedStruct] Loading "/int/.desktop.settings" -221390 [I][SavedStruct] Loading "/int/.desktop.settings" -221590 [I][SavedStruct] Loading "/int/.desktop.settings" -221748 [I][SavedStruct] Loading "/int/.desktop.settings" -221790 [I][SavedStruct] Loading "/int/.desktop.settings" -221990 [I][SavedStruct] Loading "/int/.desktop.settings" -222190 [I][SavedStruct] Loading "/int/.desktop.settings" -222248 [I][SavedStruct] Loading "/int/.desktop.settings" -222390 [I][SavedStruct] Loading "/int/.desktop.settings" -222590 [I][SavedStruct] Loading "/int/.desktop.settings" -222748 [I][SavedStruct] Loading "/int/.desktop.settings" -222790 [I][SavedStruct] Loading "/int/.desktop.settings" -222990 [I][SavedStruct] Loading "/int/.desktop.settings" -223190 [I][SavedStruct] Loading "/int/.desktop.settings" -223248 [I][SavedStruct] Loading "/int/.desktop.settings" -223390 [I][SavedStruct] Loading "/int/.desktop.settings" -223590 [I][SavedStruct] Loading "/int/.desktop.settings" -223748 [I][SavedStruct] Loading "/int/.desktop.settings" -223790 [I][SavedStruct] Loading "/int/.desktop.settings" -223990 [I][SavedStruct] Loading "/int/.desktop.settings" -224190 [I][SavedStruct] Loading "/int/.desktop.settings" -224248 [I][SavedStruct] Loading "/int/.desktop.settings" -224390 [I][SavedStruct] Loading "/int/.desktop.settings" -224590 [I][SavedStruct] Loading "/int/.desktop.settings" -224748 [I][SavedStruct] Loading "/int/.desktop.settings" -224790 [I][SavedStruct] Loading "/int/.desktop.settings" -224990 [I][SavedStruct] Loading "/int/.desktop.settings" -225190 [I][SavedStruct] Loading "/int/.desktop.settings" -225248 [I][SavedStruct] Loading "/int/.desktop.settings" -225390 [I][SavedStruct] Loading "/int/.desktop.settings" -225590 [I][SavedStruct] Loading "/int/.desktop.settings" -225748 [I][SavedStruct] Loading "/int/.desktop.settings" -225790 [I][SavedStruct] Loading "/int/.desktop.settings" -225990 [I][SavedStruct] Loading "/int/.desktop.settings" -226190 [I][SavedStruct] Loading "/int/.desktop.settings" -226248 [I][SavedStruct] Loading "/int/.desktop.settings" -226390 [I][SavedStruct] Loading "/int/.desktop.settings" -226596 [I][SavedStruct] Loading "/int/.desktop.settings" -226748 [I][SavedStruct] Loading "/int/.desktop.settings" -226790 [I][SavedStruct] Loading "/int/.desktop.settings" -226990 [I][SavedStruct] Loading "/int/.desktop.settings" -227190 [I][SavedStruct] Loading "/int/.desktop.settings" -227248 [I][SavedStruct] Loading "/int/.desktop.settings" -227390 [I][SavedStruct] Loading "/int/.desktop.settings" -227590 [I][SavedStruct] Loading "/int/.desktop.settings" -227748 [I][SavedStruct] Loading "/int/.desktop.settings" -227790 [I][SavedStruct] Loading "/int/.desktop.settings" -227990 [I][SavedStruct] Loading "/int/.desktop.settings" -228190 [I][SavedStruct] Loading "/int/.desktop.settings" -228248 [I][SavedStruct] Loading "/int/.desktop.settings" -228390 [I][SavedStruct] Loading "/int/.desktop.settings" -228590 [I][SavedStruct] Loading "/int/.desktop.settings" -228748 [I][SavedStruct] Loading "/int/.desktop.settings" -228790 [I][SavedStruct] Loading "/int/.desktop.settings" -234485 [I][FuriHalBt] Disconnect and stop advertising -234489 [I][BtGap] Stop advertising -234493 [D][BtGap] terminate success -234497 [E][BtGap] set_non_discoverable failed 12 -234502 [I][FuriHalBt] Stop current profile services -234507 [I][BadBleWorker] BLE Key timeout : 16 -234526 [I][FuriHalBt] Stop BLE related RTOS threads -234551 [I][FuriHalBt] Reset SHCI -234665 [I][FuriHalBt] Start BT initialization -234670 [I][Core2] Core2 started -234672 [I][Core2] C2 boot completed, mode: Stack -234675 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -234677 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -234681 [I][Core2] Radio stack started -234683 [I][Core2] Flash activity control switched to SEM7 -234685 [I][BtGap] Advertising name: Mmm_ -234687 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -234711 [D][BtBatterySvc] Updating power state characteristic -234721 [I][BtGap] Start advertising -235977 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -235982 [I][BtGap] Rssi: 308 -236066 [D][BtGap] Slave security initiated -236187 [I][BtGap] Pairing complete -236190 [D][BtBatterySvc] Updating battery level characteristic -236195 [I][BadBleWorker] BLE Key timeout : 16 -236366 [I][BtGap] Rx MTU size: 414 -236935 [I][BtGap] Connection parameters event complete -236938 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -236941 [W][BtGap] Unsupported connection interval. Request connection parameters update -236944 [I][BtGap] Rssi: 314 -236975 [D][BtGap] Connection parameters accepted -237139 [I][BtGap] Connection parameters event complete -237141 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -237144 [I][BtGap] Rssi: 326 -240985 [I][FuriHalBt] Disconnect and stop advertising -240989 [I][BtGap] Stop advertising -240993 [D][BtGap] terminate success -240997 [E][BtGap] set_non_discoverable failed 12 -241002 [I][FuriHalBt] Stop current profile services -241007 [I][BadBleWorker] BLE Key timeout : 16 -241028 [I][FuriHalBt] Stop BLE related RTOS threads -241054 [I][FuriHalBt] Reset SHCI -241168 [I][FuriHalBt] Start BT initialization -241173 [I][Core2] Core2 started -241175 [I][Core2] C2 boot completed, mode: Stack -241178 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -241180 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -241184 [I][Core2] Radio stack started -241186 [I][Core2] Flash activity control switched to SEM7 -241188 [I][BtGap] Advertising name: Mmm_ -241190 [I][BtGap] MAC @ : 35:F2:47:26:81:88 -241212 [D][BtBatterySvc] Updating power state characteristic -241222 [I][BtGap] Start advertising -242157 [D][ViewDispatcher] View changed while key press 20010600 -> 20010708. Sending key: Back, type: Release, sequence: 0000002C to previous view port -242161 [I][SavedStruct] Loading "/int/.desktop.settings" -242190 [I][SavedStruct] Loading "/int/.desktop.settings" -242390 [I][SavedStruct] Loading "/int/.desktop.settings" -242590 [I][SavedStruct] Loading "/int/.desktop.settings" -242662 [I][SavedStruct] Loading "/int/.desktop.settings" -242790 [I][SavedStruct] Loading "/int/.desktop.settings" -242836 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -242839 [I][BtGap] Rssi: 305 -242929 [D][BtGap] Slave security initiated -242990 [I][SavedStruct] Loading "/int/.desktop.settings" -243018 [I][BtGap] Rx MTU size: 414 -243162 [I][SavedStruct] Loading "/int/.desktop.settings" -243190 [I][SavedStruct] Loading "/int/.desktop.settings" -243390 [I][SavedStruct] Loading "/int/.desktop.settings" -243524 [D][BtGap] Bond lost event. Start rebonding -243590 [I][SavedStruct] Loading "/int/.desktop.settings" -243662 [I][SavedStruct] Loading "/int/.desktop.settings" -243702 [I][BtGap] Verify numeric comparison: 382889 -243829 [I][SavedStruct] Loading "/int/.desktop.settings" -245253 [I][SavedStruct] Loading "/int/.desktop.settings" -245274 [I][SavedStruct] Loading "/int/.desktop.settings" -245390 [I][SavedStruct] Loading "/int/.desktop.settings" -245590 [I][SavedStruct] Loading "/int/.desktop.settings" -245662 [I][SavedStruct] Loading "/int/.desktop.settings" -245679 [I][BtGap] Pairing complete -245683 [D][BtBatterySvc] Updating battery level characteristic -245687 [I][BadBleWorker] BLE Key timeout : 16 -245790 [I][SavedStruct] Loading "/int/.desktop.settings" -245990 [I][SavedStruct] Loading "/int/.desktop.settings" -246162 [I][SavedStruct] Loading "/int/.desktop.settings" -246190 [I][SavedStruct] Loading "/int/.desktop.settings" -246390 [I][SavedStruct] Loading "/int/.desktop.settings" -246590 [I][SavedStruct] Loading "/int/.desktop.settings" -246660 [I][BtGap] Connection parameters event complete -246663 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -246667 [W][BtGap] Unsupported connection interval. Request connection parameters update -246670 [I][SavedStruct] Loading "/int/.desktop.settings" -246673 [I][BtGap] Rssi: 304 -246699 [D][BtGap] Connection parameters accepted -246790 [I][SavedStruct] Loading "/int/.desktop.settings" -246862 [I][BtGap] Connection parameters event complete -246866 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -246871 [I][BtGap] Rssi: 303 -246990 [I][SavedStruct] Loading "/int/.desktop.settings" -247162 [I][SavedStruct] Loading "/int/.desktop.settings" -247190 [I][SavedStruct] Loading "/int/.desktop.settings" -247390 [I][SavedStruct] Loading "/int/.desktop.settings" -247590 [I][SavedStruct] Loading "/int/.desktop.settings" -247662 [I][SavedStruct] Loading "/int/.desktop.settings" -247790 [I][SavedStruct] Loading "/int/.desktop.settings" -247990 [I][SavedStruct] Loading "/int/.desktop.settings" -248162 [I][SavedStruct] Loading "/int/.desktop.settings" -248190 [I][SavedStruct] Loading "/int/.desktop.settings" -248390 [I][SavedStruct] Loading "/int/.desktop.settings" -248590 [I][SavedStruct] Loading "/int/.desktop.settings" -248747 [D][DolphinState] icounter 1325, butthurt 0 -248750 [I][BadBleWorker] BLE Key timeout : 16 -248754 [D][BadBleWorker] line:REM Troll scrip to open vx-underground on an iphone -248757 [I][BadBleWorker] BLE Key timeout : 16 -248759 [D][BadBleWorker] line:DELAY 1000 -248763 [I][BadBleWorker] BLE Key timeout : 16 -248790 [I][SavedStruct] Loading "/int/.desktop.settings" -248990 [I][SavedStruct] Loading "/int/.desktop.settings" -249190 [I][SavedStruct] Loading "/int/.desktop.settings" -249248 [I][SavedStruct] Loading "/int/.desktop.settings" -249390 [I][SavedStruct] Loading "/int/.desktop.settings" -249590 [I][SavedStruct] Loading "/int/.desktop.settings" -249748 [I][SavedStruct] Loading "/int/.desktop.settings" -249766 [D][BadBleWorker] line:GUI SPACE -249768 [I][BadBleWorker] Special key pressed 82c - -249773 [I][BadBleWorker] BT RSSI: 0.000000 -249790 [I][SavedStruct] Loading "/int/.desktop.settings" -249794 [I][BadBleWorker] BLE Key timeout : 16 -249800 [D][BadBleWorker] line:DELAY 500 -249804 [I][BadBleWorker] BLE Key timeout : 16 -249990 [I][SavedStruct] Loading "/int/.desktop.settings" -250190 [I][SavedStruct] Loading "/int/.desktop.settings" -250248 [I][SavedStruct] Loading "/int/.desktop.settings" -250308 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -250312 [I][BadBleWorker] BT RSSI: 0.000000 -250332 [I][BadBleWorker] BT RSSI: 0.000000 -250351 [I][BadBleWorker] BT RSSI: 0.000000 -250371 [I][BadBleWorker] BT RSSI: 0.000000 -250390 [I][SavedStruct] Loading "/int/.desktop.settings" -250392 [I][BadBleWorker] BT RSSI: 0.000000 -250414 [I][BadBleWorker] BT RSSI: 0.000000 -250434 [I][BadBleWorker] BT RSSI: 0.000000 -250454 [I][BadBleWorker] BT RSSI: 0.000000 -250474 [I][BadBleWorker] BT RSSI: 0.000000 -250494 [I][BadBleWorker] BT RSSI: 0.000000 -250514 [I][BadBleWorker] BT RSSI: 0.000000 -250534 [I][BadBleWorker] BT RSSI: 0.000000 -250554 [I][BadBleWorker] BT RSSI: 0.000000 -250574 [I][BadBleWorker] BT RSSI: 0.000000 -250590 [I][SavedStruct] Loading "/int/.desktop.settings" -250596 [I][BadBleWorker] BT RSSI: 0.000000 -250618 [I][BadBleWorker] BT RSSI: 0.000000 -250638 [I][BadBleWorker] BT RSSI: 0.000000 -250658 [I][BadBleWorker] BT RSSI: 0.000000 -250678 [I][BadBleWorker] BT RSSI: 0.000000 -250698 [I][BadBleWorker] BT RSSI: 0.000000 -250718 [I][BadBleWorker] BT RSSI: 0.000000 -250737 [I][BadBleWorker] BT RSSI: 0.000000 -250748 [I][SavedStruct] Loading "/int/.desktop.settings" -250760 [I][BadBleWorker] BT RSSI: 0.000000 -250781 [I][BadBleWorker] BT RSSI: 0.000000 -250790 [I][SavedStruct] Loading "/int/.desktop.settings" -250803 [I][BadBleWorker] BT RSSI: 0.000000 -250824 [I][BadBleWorker] BT RSSI: 0.000000 -250844 [I][BadBleWorker] BT RSSI: 0.000000 -250864 [I][BadBleWorker] BT RSSI: 0.000000 -250884 [I][BadBleWorker] BT RSSI: 0.000000 -250904 [I][BadBleWorker] BT RSSI: 0.000000 -250926 [I][BadBleWorker] BT RSSI: 0.000000 -250947 [I][BadBleWorker] BT RSSI: 0.000000 -250967 [I][BadBleWorker] BT RSSI: 0.000000 -250987 [I][BadBleWorker] BT RSSI: 0.000000 -250990 [I][SavedStruct] Loading "/int/.desktop.settings" -251008 [I][BadBleWorker] BT RSSI: 0.000000 -251028 [I][BadBleWorker] BT RSSI: 0.000000 -251048 [I][BadBleWorker] BT RSSI: 0.000000 -251068 [I][BadBleWorker] BT RSSI: 0.000000 -251088 [I][BadBleWorker] BT RSSI: 0.000000 -251108 [I][BadBleWorker] BT RSSI: 0.000000 -251128 [I][BadBleWorker] BT RSSI: 0.000000 -251147 [I][BadBleWorker] BLE Key timeout : 16 -251150 [D][BadBleWorker] line:DELAY 200 -251152 [I][BadBleWorker] BLE Key timeout : 16 -251190 [I][SavedStruct] Loading "/int/.desktop.settings" -251248 [I][SavedStruct] Loading "/int/.desktop.settings" -251355 [D][BadBleWorker] line:ENTER -251357 [I][BadBleWorker] Special key pressed 28 - -251360 [I][BadBleWorker] BT RSSI: 0.000000 -251379 [I][BadBleWorker] BLE Key timeout : 16 -251382 [D][BadBleWorker] line:GUI SPACE -251384 [I][BadBleWorker] Special key pressed 82c - -251387 [I][BadBleWorker] BT RSSI: 0.000000 -251391 [I][SavedStruct] Loading "/int/.desktop.settings" -251408 [I][BadBleWorker] BLE Key timeout : 16 -251411 [D][BadBleWorker] line:DELAY 500 -251413 [I][BadBleWorker] BLE Key timeout : 16 -251590 [I][SavedStruct] Loading "/int/.desktop.settings" -251748 [I][SavedStruct] Loading "/int/.desktop.settings" -251790 [I][SavedStruct] Loading "/int/.desktop.settings" -251915 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -251919 [I][BadBleWorker] BT RSSI: 0.000000 -251941 [I][BadBleWorker] BT RSSI: 0.000000 -251962 [I][BadBleWorker] BT RSSI: 0.000000 -251982 [I][BadBleWorker] BT RSSI: 0.000000 -251990 [I][SavedStruct] Loading "/int/.desktop.settings" -252004 [I][BadBleWorker] BT RSSI: 0.000000 -252026 [I][BadBleWorker] BT RSSI: 0.000000 -252046 [I][BadBleWorker] BT RSSI: 0.000000 -252066 [I][BadBleWorker] BT RSSI: 0.000000 -252086 [I][BadBleWorker] BT RSSI: 0.000000 -252106 [I][BadBleWorker] BT RSSI: 0.000000 -252126 [I][BadBleWorker] BT RSSI: 0.000000 -252146 [I][BadBleWorker] BT RSSI: 0.000000 -252166 [I][BadBleWorker] BT RSSI: 0.000000 -252186 [I][BadBleWorker] BT RSSI: 0.000000 -252190 [I][SavedStruct] Loading "/int/.desktop.settings" -252207 [I][BadBleWorker] BT RSSI: 0.000000 -252227 [I][BadBleWorker] BT RSSI: 0.000000 -252248 [I][BadBleWorker] BT RSSI: 0.000000 -252251 [I][SavedStruct] Loading "/int/.desktop.settings" -252269 [I][BadBleWorker] BT RSSI: 0.000000 -252289 [I][BadBleWorker] BT RSSI: 0.000000 -252309 [I][BadBleWorker] BT RSSI: 0.000000 -252329 [I][BadBleWorker] BT RSSI: 0.000000 -252348 [I][BadBleWorker] BT RSSI: 0.000000 -252368 [I][BadBleWorker] BT RSSI: 0.000000 -252388 [I][BadBleWorker] BT RSSI: 0.000000 -252391 [I][SavedStruct] Loading "/int/.desktop.settings" -252409 [I][BadBleWorker] BT RSSI: 0.000000 -252429 [I][BadBleWorker] BT RSSI: 0.000000 -252449 [I][BadBleWorker] BT RSSI: 0.000000 -252469 [I][BadBleWorker] BT RSSI: 0.000000 -252489 [I][BadBleWorker] BT RSSI: 0.000000 -252509 [I][BadBleWorker] BT RSSI: 0.000000 -252529 [I][BadBleWorker] BT RSSI: 0.000000 -252549 [I][BadBleWorker] BT RSSI: 0.000000 -252569 [I][BadBleWorker] BT RSSI: 0.000000 -252590 [I][SavedStruct] Loading "/int/.desktop.settings" -252592 [I][BadBleWorker] BT RSSI: 0.000000 -252614 [I][BadBleWorker] BT RSSI: 0.000000 -252634 [I][BadBleWorker] BT RSSI: 0.000000 -252654 [I][BadBleWorker] BT RSSI: 0.000000 -252674 [I][BadBleWorker] BT RSSI: 0.000000 -252694 [I][BadBleWorker] BT RSSI: 0.000000 -252714 [I][BadBleWorker] BT RSSI: 0.000000 -252733 [I][BadBleWorker] BT RSSI: 0.000000 -252748 [I][SavedStruct] Loading "/int/.desktop.settings" -252754 [I][BadBleWorker] BLE Key timeout : 16 -252758 [D][BadBleWorker] line:DELAY 200 -252763 [I][BadBleWorker] BLE Key timeout : 16 -252790 [I][SavedStruct] Loading "/int/.desktop.settings" -252967 [D][BadBleWorker] line:ENTER -252969 [I][BadBleWorker] Special key pressed 28 - -252972 [I][BadBleWorker] BT RSSI: 0.000000 -252990 [I][SavedStruct] Loading "/int/.desktop.settings" -252993 [I][BadBleWorker] BLE Key timeout : 16 -253000 [D][BadBleWorker] line:GUI SPACE -253002 [I][BadBleWorker] Special key pressed 82c - -253007 [I][BadBleWorker] BT RSSI: 0.000000 -253028 [I][BadBleWorker] BLE Key timeout : 16 -253031 [D][BadBleWorker] line:DELAY 500 -253033 [I][BadBleWorker] BLE Key timeout : 16 -253190 [I][SavedStruct] Loading "/int/.desktop.settings" -253248 [I][SavedStruct] Loading "/int/.desktop.settings" -253390 [I][SavedStruct] Loading "/int/.desktop.settings" -253536 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -253540 [I][BadBleWorker] BT RSSI: 0.000000 -253560 [I][BadBleWorker] BT RSSI: 0.000000 -253580 [I][BadBleWorker] BT RSSI: 0.000000 -253590 [I][SavedStruct] Loading "/int/.desktop.settings" -253602 [I][BadBleWorker] BT RSSI: 0.000000 -253624 [I][BadBleWorker] BT RSSI: 0.000000 -253644 [I][BadBleWorker] BT RSSI: 0.000000 -253664 [I][BadBleWorker] BT RSSI: 0.000000 -253684 [I][BadBleWorker] BT RSSI: 0.000000 -253704 [I][BadBleWorker] BT RSSI: 0.000000 -253724 [I][BadBleWorker] BT RSSI: 0.000000 -253743 [I][BadBleWorker] BT RSSI: 0.000000 -253748 [I][SavedStruct] Loading "/int/.desktop.settings" -253765 [I][BadBleWorker] BT RSSI: 0.000000 -253785 [I][BadBleWorker] BT RSSI: 0.000000 -253790 [I][SavedStruct] Loading "/int/.desktop.settings" -253807 [I][BadBleWorker] BT RSSI: 0.000000 -253827 [I][BadBleWorker] BT RSSI: 0.000000 -253847 [I][BadBleWorker] BT RSSI: 0.000000 -253867 [I][BadBleWorker] BT RSSI: 0.000000 -253887 [I][BadBleWorker] BT RSSI: 0.000000 -253907 [I][BadBleWorker] BT RSSI: 0.000000 -253927 [I][BadBleWorker] BT RSSI: 0.000000 -253947 [I][BadBleWorker] BT RSSI: 0.000000 -253969 [I][BadBleWorker] BT RSSI: 0.000000 -253990 [I][SavedStruct] Loading "/int/.desktop.settings" -253993 [I][BadBleWorker] BT RSSI: 0.000000 -254015 [I][BadBleWorker] BT RSSI: 0.000000 -254035 [I][BadBleWorker] BT RSSI: 0.000000 -254055 [I][BadBleWorker] BT RSSI: 0.000000 -254075 [I][BadBleWorker] BT RSSI: 0.000000 -254095 [I][BadBleWorker] BT RSSI: 0.000000 -254115 [I][BadBleWorker] BT RSSI: 0.000000 -254135 [I][BadBleWorker] BT RSSI: 0.000000 -254155 [I][BadBleWorker] BT RSSI: 0.000000 -254174 [I][BadBleWorker] BT RSSI: 0.000000 -254190 [I][SavedStruct] Loading "/int/.desktop.settings" -254196 [I][BadBleWorker] BT RSSI: 0.000000 -254217 [I][BadBleWorker] BT RSSI: 0.000000 -254237 [I][BadBleWorker] BT RSSI: 0.000000 -254248 [I][SavedStruct] Loading "/int/.desktop.settings" -254259 [I][BadBleWorker] BT RSSI: 0.000000 -254281 [I][BadBleWorker] BT RSSI: 0.000000 -254300 [I][BadBleWorker] BT RSSI: 0.000000 -254320 [I][BadBleWorker] BT RSSI: 0.000000 -254340 [I][BadBleWorker] BT RSSI: 0.000000 -254360 [I][BadBleWorker] BT RSSI: 0.000000 -254379 [I][BadBleWorker] BLE Key timeout : 16 -254383 [D][BadBleWorker] line:DELAY 200 -254386 [I][BadBleWorker] BLE Key timeout : 16 -254390 [I][SavedStruct] Loading "/int/.desktop.settings" -254588 [D][BadBleWorker] line:ENTER -254590 [I][BadBleWorker] Special key pressed 28 - -254593 [I][SavedStruct] Loading "/int/.desktop.settings" -254596 [I][BadBleWorker] BT RSSI: 0.000000 -254617 [I][BadBleWorker] BLE Key timeout : 16 -254621 [D][BadBleWorker] line:GUI SPACE -254623 [I][BadBleWorker] Special key pressed 82c - -254627 [I][BadBleWorker] BT RSSI: 0.000000 -254646 [I][BadBleWorker] BLE Key timeout : 16 -254650 [D][BadBleWorker] line:DELAY 500 -254653 [I][BadBleWorker] BLE Key timeout : 16 -254748 [I][SavedStruct] Loading "/int/.desktop.settings" -254790 [I][SavedStruct] Loading "/int/.desktop.settings" -254990 [I][SavedStruct] Loading "/int/.desktop.settings" -255155 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -255159 [I][BadBleWorker] BT RSSI: 0.000000 -255179 [I][BadBleWorker] BT RSSI: 0.000000 -255190 [I][SavedStruct] Loading "/int/.desktop.settings" -255201 [I][BadBleWorker] BT RSSI: 0.000000 -255223 [I][BadBleWorker] BT RSSI: 0.000000 -255243 [I][BadBleWorker] BT RSSI: 0.000000 -255248 [I][SavedStruct] Loading "/int/.desktop.settings" -255265 [I][BadBleWorker] BT RSSI: 0.000000 -255286 [I][BadBleWorker] BT RSSI: 0.000000 -255306 [I][BadBleWorker] BT RSSI: 0.000000 -255326 [I][BadBleWorker] BT RSSI: 0.000000 -255346 [I][BadBleWorker] BT RSSI: 0.000000 -255366 [I][BadBleWorker] BT RSSI: 0.000000 -255386 [I][BadBleWorker] BT RSSI: 0.000000 -255390 [I][SavedStruct] Loading "/int/.desktop.settings" -255407 [I][BadBleWorker] BT RSSI: 0.000000 -255427 [I][BadBleWorker] BT RSSI: 0.000000 -255446 [I][BadBleWorker] BT RSSI: 0.000000 -255466 [I][BadBleWorker] BT RSSI: 0.000000 -255485 [I][BadBleWorker] BT RSSI: 0.000000 -255505 [I][BadBleWorker] BT RSSI: 0.000000 -255525 [I][BadBleWorker] BT RSSI: 0.000000 -255545 [I][BadBleWorker] BT RSSI: 0.000000 -255565 [I][BadBleWorker] BT RSSI: 0.000000 -255585 [I][BadBleWorker] BT RSSI: 0.000000 -255590 [I][SavedStruct] Loading "/int/.desktop.settings" -255607 [I][BadBleWorker] BT RSSI: 0.000000 -255628 [I][BadBleWorker] BT RSSI: 0.000000 -255648 [I][BadBleWorker] BT RSSI: 0.000000 -255668 [I][BadBleWorker] BT RSSI: 0.000000 -255688 [I][BadBleWorker] BT RSSI: 0.000000 -255708 [I][BadBleWorker] BT RSSI: 0.000000 -255728 [I][BadBleWorker] BT RSSI: 0.000000 -255748 [I][SavedStruct] Loading "/int/.desktop.settings" -255750 [I][BadBleWorker] BT RSSI: 0.000000 -255772 [I][BadBleWorker] BT RSSI: 0.000000 -255790 [I][SavedStruct] Loading "/int/.desktop.settings" -255794 [I][BadBleWorker] BT RSSI: 0.000000 -255816 [I][BadBleWorker] BT RSSI: 0.000000 -255836 [I][BadBleWorker] BT RSSI: 0.000000 -255856 [I][BadBleWorker] BT RSSI: 0.000000 -255876 [I][BadBleWorker] BT RSSI: 0.000000 -255896 [I][BadBleWorker] BT RSSI: 0.000000 -255915 [I][BadBleWorker] BT RSSI: 0.000000 -255935 [I][BadBleWorker] BT RSSI: 0.000000 -255955 [I][BadBleWorker] BT RSSI: 0.000000 -255975 [I][BadBleWorker] BT RSSI: 0.000000 -255996 [I][BadBleWorker] BLE Key timeout : 16 -256000 [D][BadBleWorker] line:DELAY 200 -256003 [I][BadBleWorker] BLE Key timeout : 16 -256006 [I][SavedStruct] Loading "/int/.desktop.settings" -256190 [I][SavedStruct] Loading "/int/.desktop.settings" -256207 [D][BadBleWorker] line:ENTER -256209 [I][BadBleWorker] Special key pressed 28 - -256213 [I][BadBleWorker] BT RSSI: 0.000000 -256232 [I][BadBleWorker] BLE Key timeout : 16 -256236 [I][BadBleWorker] BLE Key timeout : 16 -256248 [I][SavedStruct] Loading "/int/.desktop.settings" -256390 [I][SavedStruct] Loading "/int/.desktop.settings" -256590 [I][SavedStruct] Loading "/int/.desktop.settings" -256748 [I][SavedStruct] Loading "/int/.desktop.settings" -256790 [I][SavedStruct] Loading "/int/.desktop.settings" -256990 [I][SavedStruct] Loading "/int/.desktop.settings" -257190 [I][SavedStruct] Loading "/int/.desktop.settings" -257248 [I][SavedStruct] Loading "/int/.desktop.settings" -257390 [I][SavedStruct] Loading "/int/.desktop.settings" -257436 [I][BtGap] Stop advertising -257439 [D][BtGap] terminate success -257442 [E][BtGap] set_non_discoverable failed 12 -257446 [I][SavedStruct] Loading "/int/.desktop.settings" -257590 [I][SavedStruct] Loading "/int/.desktop.settings" -257646 [I][SavedStruct] Loading "/int/.bt.settings" -257659 [I][SavedStruct] Loading "/int/.bt.keys" -257669 [I][FuriHalBt] Disconnect and stop advertising -257671 [I][FuriHalBt] Stop current profile services -257683 [I][FuriHalBt] Stop BLE related RTOS threads -257707 [I][FuriHalBt] Reset SHCI -257790 [I][SavedStruct] Loading "/int/.desktop.settings" -257821 [I][FuriHalBt] Start BT initialization -257826 [I][Core2] Core2 started -257828 [I][Core2] C2 boot completed, mode: Stack -257831 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -257833 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -257837 [I][Core2] Radio stack started -257839 [I][Core2] Flash activity control switched to SEM7 -257841 [I][BtGap] Advertising name: Keyboard -257843 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -257860 [D][BtBatterySvc] Updating power state characteristic -257866 [I][BtSrv] Bt App started -257868 [I][BtGap] Start advertising -257871 [I][BadBleWorker] End -257873 [I][SavedStruct] Loading "/int/.desktop.settings" -257893 [D][BrowserWorker] Start -257909 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: 4 -257911 [D][BrowserWorker] Load offset: 0 cnt: 50 -257983 [D][GuiSrv] ViewPort changed while key press 2000D718 -> 20010BD0. Discarding key: Back, type: Short, sequence: 00000031 -257987 [D][GuiSrv] ViewPort changed while key press 2000D718 -> 20010BD0. Sending key: Back, type: Release, sequence: 00000031 to previous view port -258434 [D][BrowserWorker] Exit to: /any/BadUsb items: 10 idx: -1 -258438 [D][BrowserWorker] Load offset: 0 cnt: 50 -278749 [I][Dolphin] Flush stats -278751 [I][SavedStruct] Saving "/int/.dolphin.state" -278762 [D][StorageInt] Device erase: page 2, translated page: cf -278771 [D][StorageInt] Device sync: skipping -278774 [I][DolphinState] State saved -317982 [D][BtGap] set_non_discoverable success -377984 [D][BtGap] set_non_discoverable success - - _.-------.._ -, - .-"```"--..,,_/ /`-, -, \ - .:" /:/ /'\ \ ,_..., `. | | - / ,----/:/ /`\ _\~`_-"` _; - ' / /`"""'\ \ \.~`_-' ,-"'/ - | | | 0 | | .-' ,/` / - | ,..\ \ ,.-"` ,/` / - ; : `/`""\` ,/--==,/-----, - | `-...| -.___-Z:_______J...---; - : ` _-' - _L_ _ ___ ___ ___ ___ ____--"`___ _ ___ -| __|| | |_ _|| _ \| _ \| __|| _ \ / __|| | |_ _| -| _| | |__ | | | _/| _/| _| | / | (__ | |__ | | -|_| |____||___||_| |_| |___||_|_\ \___||____||___| - -Welcome to Flipper Zero Command Line Interface! -Read Manual https://docs.flipperzero.one - -Firmware version: dev 0.74.3 (XFW-0040 built on 26-01-2023) - ->: log -Press CTRL+C to stop... -48839 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: -1 -48842 [D][BrowserWorker] Load offset: 0 cnt: 50 -51685 [D][BrowserWorker] End -51698 [I][BtGap] Stop advertising -51702 [D][BtGap] set_non_discoverable success -51716 [I][SavedStruct] Loading "/int/.desktop.settings" -51843 [I][SavedStruct] Loading "/int/.desktop.settings" -51908 [I][FuriHalBt] Disconnect and stop advertising -51910 [I][FuriHalBt] Stop current profile services -51919 [I][FuriHalBt] Stop BLE related RTOS threads -51943 [I][FuriHalBt] Reset SHCI -52043 [I][SavedStruct] Loading "/int/.desktop.settings" -52057 [I][FuriHalBt] Start BT initialization -52063 [I][Core2] Core2 started -52065 [I][Core2] C2 boot completed, mode: Stack -52068 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -52070 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -52074 [I][Core2] Radio stack started -52077 [I][Core2] Flash activity control switched to SEM7 -52079 [I][BtGap] Advertising name: Keyboard -52082 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -52098 [D][BtBatterySvc] Updating power state characteristic -52104 [I][BtGap] Start advertising -52106 [I][SavedStruct] Loading "/int/.bt.settings" -52124 [I][SavedStruct] Loading "/ext/apps/Tools/.bt_hid.keys" -52134 [I][FuriHalBt] Disconnect and stop advertising -52136 [I][BtGap] Stop advertising -52139 [D][BtGap] set_non_discoverable success -52142 [I][FuriHalBt] Stop current profile services -52152 [I][FuriHalBt] Stop BLE related RTOS threads -52177 [I][FuriHalBt] Reset SHCI -52212 [I][SavedStruct] Loading "/int/.desktop.settings" -52243 [I][SavedStruct] Loading "/int/.desktop.settings" -52291 [I][FuriHalBt] Start BT initialization -52296 [I][Core2] Core2 started -52298 [I][Core2] C2 boot completed, mode: Stack -52301 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -52303 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -52308 [I][Core2] Radio stack started -52310 [I][Core2] Flash activity control switched to SEM7 -52314 [I][BtGap] Advertising name: Rumik1 -52316 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -52333 [D][BtBatterySvc] Updating power state characteristic -52342 [I][BtSrv] Bt App started -52343 [I][BtGap] Start advertising -52347 [I][BadBleWorker] Init -52351 [I][SavedStruct] Loading "/int/.desktop.settings" -52378 [I][BadBleWorker] BLE Key timeout : 16 -52443 [I][SavedStruct] Loading "/int/.desktop.settings" -52643 [I][SavedStruct] Loading "/int/.desktop.settings" -52712 [I][SavedStruct] Loading "/int/.desktop.settings" -52843 [I][SavedStruct] Loading "/int/.desktop.settings" -53043 [I][SavedStruct] Loading "/int/.desktop.settings" -53243 [I][SavedStruct] Loading "/int/.desktop.settings" -53861 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -53865 [I][BtGap] Rssi: 302 -53954 [D][BtGap] Slave security initiated -54073 [I][BtGap] Pairing complete -54076 [D][BtBatterySvc] Updating battery level characteristic -54079 [I][BadBleWorker] BLE Key timeout : 16 -54252 [I][BtGap] Rx MTU size: 414 -54822 [I][BtGap] Connection parameters event complete -54824 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -54826 [W][BtGap] Unsupported connection interval. Request connection parameters update -54829 [I][BtGap] Rssi: 290 -54859 [D][BtGap] Connection parameters accepted -55022 [I][BtGap] Connection parameters event complete -55025 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -55027 [I][BtGap] Rssi: 293 -59176 [I][FuriHalBt] Disconnect and stop advertising -59180 [I][BtGap] Stop advertising -59184 [D][BtGap] terminate success -59188 [E][BtGap] set_non_discoverable failed 12 -59193 [I][FuriHalBt] Stop current profile services -59198 [I][BadBleWorker] BLE Key timeout : 16 -59216 [I][FuriHalBt] Stop BLE related RTOS threads -59240 [I][FuriHalBt] Reset SHCI -59354 [I][FuriHalBt] Start BT initialization -59360 [I][Core2] Core2 started -59363 [I][Core2] C2 boot completed, mode: Stack -59366 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -59368 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -59372 [I][Core2] Radio stack started -59375 [I][Core2] Flash activity control switched to SEM7 -59377 [I][BtGap] Advertising name: Kkk -59380 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -59397 [D][BtBatterySvc] Updating power state characteristic -59407 [I][BtGap] Start advertising -60280 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -60282 [I][BtGap] Rssi: 302 -60374 [D][BtGap] Slave security initiated -60495 [I][BtGap] Pairing complete -60498 [D][BtBatterySvc] Updating battery level characteristic -60500 [I][BadBleWorker] BLE Key timeout : 16 -60673 [I][BtGap] Rx MTU size: 414 -61244 [I][BtGap] Connection parameters event complete -61248 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -61252 [W][BtGap] Unsupported connection interval. Request connection parameters update -61258 [I][BtGap] Rssi: 297 -61284 [D][BtGap] Connection parameters accepted -61448 [I][BtGap] Connection parameters event complete -61452 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -61456 [I][BtGap] Rssi: 298 -66066 [I][BtGap] Disconnect from client. Reason: 13 -66069 [I][BadBleWorker] BLE Key timeout : 16 -69485 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -69489 [I][BtGap] Rssi: 297 -69600 [D][BtGap] Slave security initiated -69720 [I][BtGap] Pairing complete -69723 [D][BtBatterySvc] Updating battery level characteristic -69727 [I][BadBleWorker] BLE Key timeout : 16 -69900 [I][BtGap] Rx MTU size: 414 -71400 [I][BtGap] Connection parameters event complete -71402 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -71405 [W][BtGap] Unsupported connection interval. Request connection parameters update -71408 [I][BtGap] Rssi: 296 -71438 [D][BtGap] Connection parameters accepted -71603 [I][BtGap] Connection parameters event complete -71605 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -71609 [I][BtGap] Rssi: 299 -73790 [I][BtGap] Disconnect from client. Reason: 13 -73792 [I][BadBleWorker] BLE Key timeout : 16 -80587 [I][FuriHalBt] Disconnect and stop advertising -80591 [I][BtGap] Stop advertising -80595 [D][BtGap] set_non_discoverable success -80600 [I][FuriHalBt] Stop current profile services -80621 [I][FuriHalBt] Stop BLE related RTOS threads -80647 [I][FuriHalBt] Reset SHCI -80762 [I][FuriHalBt] Start BT initialization -80767 [I][Core2] Core2 started -80769 [I][Core2] C2 boot completed, mode: Stack -80772 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -80774 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -80778 [I][Core2] Radio stack started -80781 [I][Core2] Flash activity control switched to SEM7 -80783 [I][BtGap] Advertising name: Kkk -80786 [I][BtGap] MAC @ : 35:F2:47:26:11:11 -80803 [D][BtBatterySvc] Updating power state characteristic -80813 [I][BtGap] Start advertising -81988 [D][ViewDispatcher] View changed while key press 200101B0 -> 200102B8. Sending key: Back, type: Release, sequence: 00000028 to previous view port -81992 [I][SavedStruct] Loading "/int/.desktop.settings" -82043 [I][SavedStruct] Loading "/int/.desktop.settings" -82243 [I][SavedStruct] Loading "/int/.desktop.settings" -82443 [I][SavedStruct] Loading "/int/.desktop.settings" -82493 [I][SavedStruct] Loading "/int/.desktop.settings" -82643 [I][SavedStruct] Loading "/int/.desktop.settings" -82843 [I][SavedStruct] Loading "/int/.desktop.settings" -82993 [I][SavedStruct] Loading "/int/.desktop.settings" -83043 [I][SavedStruct] Loading "/int/.desktop.settings" -83243 [I][SavedStruct] Loading "/int/.desktop.settings" -83443 [I][SavedStruct] Loading "/int/.desktop.settings" -83493 [I][SavedStruct] Loading "/int/.desktop.settings" -83643 [I][SavedStruct] Loading "/int/.desktop.settings" -83843 [I][SavedStruct] Loading "/int/.desktop.settings" -83993 [I][SavedStruct] Loading "/int/.desktop.settings" -84043 [I][SavedStruct] Loading "/int/.desktop.settings" -84243 [I][SavedStruct] Loading "/int/.desktop.settings" -84443 [I][SavedStruct] Loading "/int/.desktop.settings" -84493 [I][SavedStruct] Loading "/int/.desktop.settings" -84643 [I][SavedStruct] Loading "/int/.desktop.settings" -84843 [I][SavedStruct] Loading "/int/.desktop.settings" -84993 [I][SavedStruct] Loading "/int/.desktop.settings" -85043 [I][SavedStruct] Loading "/int/.desktop.settings" -85243 [I][SavedStruct] Loading "/int/.desktop.settings" -85443 [I][SavedStruct] Loading "/int/.desktop.settings" -85493 [I][SavedStruct] Loading "/int/.desktop.settings" -85643 [I][SavedStruct] Loading "/int/.desktop.settings" -85843 [I][SavedStruct] Loading "/int/.desktop.settings" -85993 [I][SavedStruct] Loading "/int/.desktop.settings" -86043 [I][SavedStruct] Loading "/int/.desktop.settings" -86243 [I][SavedStruct] Loading "/int/.desktop.settings" -86443 [I][SavedStruct] Loading "/int/.desktop.settings" -86493 [I][SavedStruct] Loading "/int/.desktop.settings" -86643 [I][SavedStruct] Loading "/int/.desktop.settings" -86843 [I][SavedStruct] Loading "/int/.desktop.settings" -86993 [I][SavedStruct] Loading "/int/.desktop.settings" -87043 [I][SavedStruct] Loading "/int/.desktop.settings" -87243 [I][SavedStruct] Loading "/int/.desktop.settings" -87443 [I][SavedStruct] Loading "/int/.desktop.settings" -87493 [I][SavedStruct] Loading "/int/.desktop.settings" -87643 [I][SavedStruct] Loading "/int/.desktop.settings" -87843 [I][SavedStruct] Loading "/int/.desktop.settings" -87993 [I][SavedStruct] Loading "/int/.desktop.settings" -88043 [I][SavedStruct] Loading "/int/.desktop.settings" -88243 [I][SavedStruct] Loading "/int/.desktop.settings" -88443 [I][SavedStruct] Loading "/int/.desktop.settings" -88493 [I][SavedStruct] Loading "/int/.desktop.settings" -88643 [I][SavedStruct] Loading "/int/.desktop.settings" -88843 [I][SavedStruct] Loading "/int/.desktop.settings" -88993 [I][SavedStruct] Loading "/int/.desktop.settings" -89043 [I][SavedStruct] Loading "/int/.desktop.settings" -89243 [I][SavedStruct] Loading "/int/.desktop.settings" -89443 [I][SavedStruct] Loading "/int/.desktop.settings" -89493 [I][SavedStruct] Loading "/int/.desktop.settings" -89643 [I][SavedStruct] Loading "/int/.desktop.settings" -89843 [I][SavedStruct] Loading "/int/.desktop.settings" -89993 [I][SavedStruct] Loading "/int/.desktop.settings" -90043 [I][SavedStruct] Loading "/int/.desktop.settings" -90243 [I][SavedStruct] Loading "/int/.desktop.settings" -90443 [I][SavedStruct] Loading "/int/.desktop.settings" -90493 [I][SavedStruct] Loading "/int/.desktop.settings" -90643 [I][SavedStruct] Loading "/int/.desktop.settings" -90843 [I][SavedStruct] Loading "/int/.desktop.settings" -90993 [I][SavedStruct] Loading "/int/.desktop.settings" -91043 [I][SavedStruct] Loading "/int/.desktop.settings" -91243 [I][SavedStruct] Loading "/int/.desktop.settings" -91443 [I][SavedStruct] Loading "/int/.desktop.settings" -91493 [I][SavedStruct] Loading "/int/.desktop.settings" -91643 [I][SavedStruct] Loading "/int/.desktop.settings" -91843 [I][SavedStruct] Loading "/int/.desktop.settings" -91993 [I][SavedStruct] Loading "/int/.desktop.settings" -92043 [I][SavedStruct] Loading "/int/.desktop.settings" -92243 [I][SavedStruct] Loading "/int/.desktop.settings" -92443 [I][SavedStruct] Loading "/int/.desktop.settings" -92493 [I][SavedStruct] Loading "/int/.desktop.settings" -92643 [I][SavedStruct] Loading "/int/.desktop.settings" -92843 [I][SavedStruct] Loading "/int/.desktop.settings" -92993 [I][SavedStruct] Loading "/int/.desktop.settings" -93043 [I][SavedStruct] Loading "/int/.desktop.settings" -93243 [I][SavedStruct] Loading "/int/.desktop.settings" -93443 [I][SavedStruct] Loading "/int/.desktop.settings" -93493 [I][SavedStruct] Loading "/int/.desktop.settings" -93643 [I][SavedStruct] Loading "/int/.desktop.settings" -93843 [I][SavedStruct] Loading "/int/.desktop.settings" -93993 [I][SavedStruct] Loading "/int/.desktop.settings" -94043 [I][SavedStruct] Loading "/int/.desktop.settings" -94243 [I][SavedStruct] Loading "/int/.desktop.settings" -94443 [I][SavedStruct] Loading "/int/.desktop.settings" -94493 [I][SavedStruct] Loading "/int/.desktop.settings" -94643 [I][SavedStruct] Loading "/int/.desktop.settings" -94843 [I][SavedStruct] Loading "/int/.desktop.settings" -94993 [I][SavedStruct] Loading "/int/.desktop.settings" -95043 [I][SavedStruct] Loading "/int/.desktop.settings" -95243 [I][SavedStruct] Loading "/int/.desktop.settings" -95443 [I][SavedStruct] Loading "/int/.desktop.settings" -95493 [I][SavedStruct] Loading "/int/.desktop.settings" -95643 [I][SavedStruct] Loading "/int/.desktop.settings" -95843 [I][SavedStruct] Loading "/int/.desktop.settings" -95993 [I][SavedStruct] Loading "/int/.desktop.settings" -96043 [I][SavedStruct] Loading "/int/.desktop.settings" -96243 [I][SavedStruct] Loading "/int/.desktop.settings" -96443 [I][SavedStruct] Loading "/int/.desktop.settings" -96493 [I][SavedStruct] Loading "/int/.desktop.settings" -96643 [I][SavedStruct] Loading "/int/.desktop.settings" -96846 [I][SavedStruct] Loading "/int/.desktop.settings" -96913 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -96916 [I][BtGap] Rssi: 324 -96993 [I][SavedStruct] Loading "/int/.desktop.settings" -97006 [D][BtGap] Slave security initiated -97043 [I][SavedStruct] Loading "/int/.desktop.settings" -97094 [I][BtGap] Rx MTU size: 414 -97243 [I][SavedStruct] Loading "/int/.desktop.settings" -97443 [I][SavedStruct] Loading "/int/.desktop.settings" -97493 [I][SavedStruct] Loading "/int/.desktop.settings" -97601 [D][BtGap] Bond lost event. Start rebonding -97643 [I][SavedStruct] Loading "/int/.desktop.settings" -97780 [I][BtGap] Verify numeric comparison: 898056 -100222 [I][SavedStruct] Loading "/int/.desktop.settings" -100243 [I][SavedStruct] Loading "/int/.desktop.settings" -100264 [I][SavedStruct] Loading "/int/.desktop.settings" -100443 [I][SavedStruct] Loading "/int/.desktop.settings" -100493 [I][SavedStruct] Loading "/int/.desktop.settings" -100643 [I][SavedStruct] Loading "/int/.desktop.settings" -100657 [I][BtGap] Pairing complete -100661 [D][BtBatterySvc] Updating battery level characteristic -100666 [I][BadBleWorker] BLE Key timeout : 16 -100843 [I][SavedStruct] Loading "/int/.desktop.settings" -100993 [I][SavedStruct] Loading "/int/.desktop.settings" -101043 [I][SavedStruct] Loading "/int/.desktop.settings" -101243 [I][SavedStruct] Loading "/int/.desktop.settings" -101443 [I][SavedStruct] Loading "/int/.desktop.settings" -101493 [I][SavedStruct] Loading "/int/.desktop.settings" -101643 [I][SavedStruct] Loading "/int/.desktop.settings" -101668 [I][BtGap] Connection parameters event complete -101670 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -101673 [W][BtGap] Unsupported connection interval. Request connection parameters update -101677 [I][BtGap] Rssi: 345 -101707 [D][BtGap] Connection parameters accepted -101843 [I][SavedStruct] Loading "/int/.desktop.settings" -101870 [I][BtGap] Connection parameters event complete -101873 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -101875 [I][BtGap] Rssi: 337 -101993 [I][SavedStruct] Loading "/int/.desktop.settings" -102043 [I][SavedStruct] Loading "/int/.desktop.settings" -102243 [I][SavedStruct] Loading "/int/.desktop.settings" -102443 [I][SavedStruct] Loading "/int/.desktop.settings" -102493 [I][SavedStruct] Loading "/int/.desktop.settings" -102643 [I][SavedStruct] Loading "/int/.desktop.settings" -102843 [I][SavedStruct] Loading "/int/.desktop.settings" -102993 [I][SavedStruct] Loading "/int/.desktop.settings" -103043 [I][SavedStruct] Loading "/int/.desktop.settings" -103243 [I][SavedStruct] Loading "/int/.desktop.settings" -103443 [I][SavedStruct] Loading "/int/.desktop.settings" -103493 [I][SavedStruct] Loading "/int/.desktop.settings" -103643 [I][SavedStruct] Loading "/int/.desktop.settings" -103843 [I][SavedStruct] Loading "/int/.desktop.settings" -103993 [I][SavedStruct] Loading "/int/.desktop.settings" -104043 [I][SavedStruct] Loading "/int/.desktop.settings" -104243 [I][SavedStruct] Loading "/int/.desktop.settings" -104443 [I][SavedStruct] Loading "/int/.desktop.settings" -104493 [I][SavedStruct] Loading "/int/.desktop.settings" -104643 [I][SavedStruct] Loading "/int/.desktop.settings" -104843 [I][SavedStruct] Loading "/int/.desktop.settings" -104993 [I][SavedStruct] Loading "/int/.desktop.settings" -105043 [I][SavedStruct] Loading "/int/.desktop.settings" -105243 [I][SavedStruct] Loading "/int/.desktop.settings" -105443 [I][SavedStruct] Loading "/int/.desktop.settings" -105493 [I][SavedStruct] Loading "/int/.desktop.settings" -105643 [I][SavedStruct] Loading "/int/.desktop.settings" -105843 [I][SavedStruct] Loading "/int/.desktop.settings" -105993 [I][SavedStruct] Loading "/int/.desktop.settings" -106043 [I][SavedStruct] Loading "/int/.desktop.settings" -106243 [I][SavedStruct] Loading "/int/.desktop.settings" -106443 [I][SavedStruct] Loading "/int/.desktop.settings" -106493 [I][SavedStruct] Loading "/int/.desktop.settings" -106643 [I][SavedStruct] Loading "/int/.desktop.settings" -106843 [I][SavedStruct] Loading "/int/.desktop.settings" -106993 [I][SavedStruct] Loading "/int/.desktop.settings" -107043 [I][SavedStruct] Loading "/int/.desktop.settings" -107243 [I][SavedStruct] Loading "/int/.desktop.settings" -107443 [I][SavedStruct] Loading "/int/.desktop.settings" -107493 [I][SavedStruct] Loading "/int/.desktop.settings" -107643 [I][SavedStruct] Loading "/int/.desktop.settings" -107843 [I][SavedStruct] Loading "/int/.desktop.settings" -107995 [I][SavedStruct] Loading "/int/.desktop.settings" -108043 [I][SavedStruct] Loading "/int/.desktop.settings" -108243 [I][SavedStruct] Loading "/int/.desktop.settings" -108443 [I][SavedStruct] Loading "/int/.desktop.settings" -108493 [I][SavedStruct] Loading "/int/.desktop.settings" -108643 [I][SavedStruct] Loading "/int/.desktop.settings" -108843 [I][SavedStruct] Loading "/int/.desktop.settings" -108993 [I][SavedStruct] Loading "/int/.desktop.settings" -109043 [I][SavedStruct] Loading "/int/.desktop.settings" -109243 [I][SavedStruct] Loading "/int/.desktop.settings" -109443 [I][SavedStruct] Loading "/int/.desktop.settings" -109536 [D][DolphinState] icounter 1325, butthurt 0 -109539 [I][BadBleWorker] BLE Key timeout : 16 -109543 [D][BadBleWorker] line:REM Troll scrip to open vx-underground on an iphone -109546 [I][BadBleWorker] BLE Key timeout : 16 -109549 [D][BadBleWorker] line:DELAY 1000 -109552 [I][BadBleWorker] BLE Key timeout : 16 -109643 [I][SavedStruct] Loading "/int/.desktop.settings" -109843 [I][SavedStruct] Loading "/int/.desktop.settings" -110037 [I][SavedStruct] Loading "/int/.desktop.settings" -110055 [I][SavedStruct] Loading "/int/.desktop.settings" -110243 [I][SavedStruct] Loading "/int/.desktop.settings" -110443 [I][SavedStruct] Loading "/int/.desktop.settings" -110537 [I][SavedStruct] Loading "/int/.desktop.settings" -110555 [D][BadBleWorker] line:GUI SPACE -110557 [I][BadBleWorker] Special key pressed 82c - -110578 [I][BadBleWorker] BLE Key timeout : 16 -110582 [D][BadBleWorker] line:DELAY 500 -110585 [I][BadBleWorker] BLE Key timeout : 16 -110643 [I][SavedStruct] Loading "/int/.desktop.settings" -110843 [I][SavedStruct] Loading "/int/.desktop.settings" -111039 [I][SavedStruct] Loading "/int/.desktop.settings" -111066 [I][SavedStruct] Loading "/int/.desktop.settings" -111088 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -111243 [I][SavedStruct] Loading "/int/.desktop.settings" -111443 [I][SavedStruct] Loading "/int/.desktop.settings" -111537 [I][SavedStruct] Loading "/int/.desktop.settings" -111643 [I][SavedStruct] Loading "/int/.desktop.settings" -111792 [E][BtHid] Failed updating report characteristic: 100 -111811 [E][BtHid] Failed updating report characteristic: 100 -111814 [E][BtHid] Failed updating report characteristic: 100 -111833 [E][BtHid] Failed updating report characteristic: 100 -111836 [I][BadBleWorker] BLE Key timeout : 16 -111838 [D][BadBleWorker] line:DELAY 200 -111840 [I][BadBleWorker] BLE Key timeout : 16 -111843 [I][SavedStruct] Loading "/int/.desktop.settings" -112037 [I][SavedStruct] Loading "/int/.desktop.settings" -112044 [D][BadBleWorker] line:ENTER -112046 [I][BadBleWorker] Special key pressed 28 - -112069 [I][BadBleWorker] BLE Key timeout : 16 -112072 [D][BadBleWorker] line:GUI SPACE -112074 [I][BadBleWorker] Special key pressed 82c - -112077 [I][SavedStruct] Loading "/int/.desktop.settings" -112095 [I][BadBleWorker] BLE Key timeout : 16 -112099 [D][BadBleWorker] line:DELAY 500 -112102 [I][BadBleWorker] BLE Key timeout : 16 -112243 [I][SavedStruct] Loading "/int/.desktop.settings" -112443 [I][SavedStruct] Loading "/int/.desktop.settings" -112537 [I][SavedStruct] Loading "/int/.desktop.settings" -112605 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -112643 [I][SavedStruct] Loading "/int/.desktop.settings" -112843 [I][SavedStruct] Loading "/int/.desktop.settings" -113037 [I][SavedStruct] Loading "/int/.desktop.settings" -113055 [I][SavedStruct] Loading "/int/.desktop.settings" -113243 [I][SavedStruct] Loading "/int/.desktop.settings" -113347 [I][BadBleWorker] BLE Key timeout : 16 -113351 [D][BadBleWorker] line:DELAY 200 -113354 [I][BadBleWorker] BLE Key timeout : 16 -113443 [I][SavedStruct] Loading "/int/.desktop.settings" -113537 [I][SavedStruct] Loading "/int/.desktop.settings" -113557 [D][BadBleWorker] line:ENTER -113559 [I][BadBleWorker] Special key pressed 28 - -113579 [I][BadBleWorker] BLE Key timeout : 16 -113583 [D][BadBleWorker] line:GUI SPACE -113585 [I][BadBleWorker] Special key pressed 82c - -113605 [I][BadBleWorker] BLE Key timeout : 16 -113608 [D][BadBleWorker] line:DELAY 500 -113610 [I][BadBleWorker] BLE Key timeout : 16 -113643 [I][SavedStruct] Loading "/int/.desktop.settings" -113843 [I][SavedStruct] Loading "/int/.desktop.settings" -114037 [I][SavedStruct] Loading "/int/.desktop.settings" -114055 [I][SavedStruct] Loading "/int/.desktop.settings" -114113 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -114243 [I][SavedStruct] Loading "/int/.desktop.settings" -114443 [I][SavedStruct] Loading "/int/.desktop.settings" -114537 [I][SavedStruct] Loading "/int/.desktop.settings" -114643 [I][SavedStruct] Loading "/int/.desktop.settings" -114843 [I][SavedStruct] Loading "/int/.desktop.settings" -114853 [I][BadBleWorker] BLE Key timeout : 16 -114861 [D][BadBleWorker] line:DELAY 200 -114865 [I][BadBleWorker] BLE Key timeout : 16 -115037 [I][SavedStruct] Loading "/int/.desktop.settings" -115055 [I][SavedStruct] Loading "/int/.desktop.settings" -115069 [D][BadBleWorker] line:ENTER -115071 [I][BadBleWorker] Special key pressed 28 - -115093 [I][BadBleWorker] BLE Key timeout : 16 -115097 [D][BadBleWorker] line:GUI SPACE -115100 [I][BadBleWorker] Special key pressed 82c - -115122 [I][BadBleWorker] BLE Key timeout : 16 -115126 [D][BadBleWorker] line:DELAY 500 -115129 [I][BadBleWorker] BLE Key timeout : 16 -115243 [I][SavedStruct] Loading "/int/.desktop.settings" -115443 [I][SavedStruct] Loading "/int/.desktop.settings" -115537 [I][SavedStruct] Loading "/int/.desktop.settings" -115632 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -115643 [I][SavedStruct] Loading "/int/.desktop.settings" -115843 [I][SavedStruct] Loading "/int/.desktop.settings" -116037 [I][SavedStruct] Loading "/int/.desktop.settings" -116055 [I][SavedStruct] Loading "/int/.desktop.settings" -116243 [I][SavedStruct] Loading "/int/.desktop.settings" -116369 [I][BadBleWorker] BLE Key timeout : 16 -116372 [D][BadBleWorker] line:DELAY 200 -116374 [I][BadBleWorker] BLE Key timeout : 16 -116443 [I][SavedStruct] Loading "/int/.desktop.settings" -116537 [I][SavedStruct] Loading "/int/.desktop.settings" -116577 [D][BadBleWorker] line:ENTER -116579 [I][BadBleWorker] Special key pressed 28 - -116599 [I][BadBleWorker] BLE Key timeout : 16 -116603 [I][BadBleWorker] BLE Key timeout : 16 -116643 [I][SavedStruct] Loading "/int/.desktop.settings" -116843 [I][SavedStruct] Loading "/int/.desktop.settings" -117037 [I][SavedStruct] Loading "/int/.desktop.settings" -117056 [I][SavedStruct] Loading "/int/.desktop.settings" -117243 [I][SavedStruct] Loading "/int/.desktop.settings" -117443 [I][SavedStruct] Loading "/int/.desktop.settings" -117537 [I][SavedStruct] Loading "/int/.desktop.settings" -117643 [I][SavedStruct] Loading "/int/.desktop.settings" -117843 [I][SavedStruct] Loading "/int/.desktop.settings" -118037 [I][SavedStruct] Loading "/int/.desktop.settings" -118056 [I][SavedStruct] Loading "/int/.desktop.settings" -118243 [I][SavedStruct] Loading "/int/.desktop.settings" -118443 [I][SavedStruct] Loading "/int/.desktop.settings" -118537 [I][SavedStruct] Loading "/int/.desktop.settings" -118643 [I][SavedStruct] Loading "/int/.desktop.settings" -118843 [I][SavedStruct] Loading "/int/.desktop.settings" -119037 [I][SavedStruct] Loading "/int/.desktop.settings" -119056 [I][SavedStruct] Loading "/int/.desktop.settings" -119243 [I][SavedStruct] Loading "/int/.desktop.settings" -119443 [I][SavedStruct] Loading "/int/.desktop.settings" -119537 [I][SavedStruct] Loading "/int/.desktop.settings" -119643 [I][SavedStruct] Loading "/int/.desktop.settings" -119843 [I][SavedStruct] Loading "/int/.desktop.settings" -120037 [I][SavedStruct] Loading "/int/.desktop.settings" -120056 [I][SavedStruct] Loading "/int/.desktop.settings" -120243 [I][SavedStruct] Loading "/int/.desktop.settings" -120443 [I][SavedStruct] Loading "/int/.desktop.settings" -120537 [I][SavedStruct] Loading "/int/.desktop.settings" -120643 [I][SavedStruct] Loading "/int/.desktop.settings" -120843 [I][SavedStruct] Loading "/int/.desktop.settings" -121037 [I][SavedStruct] Loading "/int/.desktop.settings" -121056 [I][SavedStruct] Loading "/int/.desktop.settings" -121243 [I][SavedStruct] Loading "/int/.desktop.settings" -121443 [I][SavedStruct] Loading "/int/.desktop.settings" -121537 [I][SavedStruct] Loading "/int/.desktop.settings" -121643 [I][SavedStruct] Loading "/int/.desktop.settings" -121843 [I][SavedStruct] Loading "/int/.desktop.settings" -122037 [I][SavedStruct] Loading "/int/.desktop.settings" -122056 [I][SavedStruct] Loading "/int/.desktop.settings" -122243 [I][SavedStruct] Loading "/int/.desktop.settings" -122443 [I][SavedStruct] Loading "/int/.desktop.settings" -122537 [I][SavedStruct] Loading "/int/.desktop.settings" -122643 [I][SavedStruct] Loading "/int/.desktop.settings" -122843 [I][SavedStruct] Loading "/int/.desktop.settings" -123037 [I][SavedStruct] Loading "/int/.desktop.settings" -123056 [I][SavedStruct] Loading "/int/.desktop.settings" -123243 [I][SavedStruct] Loading "/int/.desktop.settings" -123443 [I][SavedStruct] Loading "/int/.desktop.settings" -123537 [I][SavedStruct] Loading "/int/.desktop.settings" -123643 [I][SavedStruct] Loading "/int/.desktop.settings" -123843 [I][SavedStruct] Loading "/int/.desktop.settings" -124037 [I][SavedStruct] Loading "/int/.desktop.settings" -124056 [I][SavedStruct] Loading "/int/.desktop.settings" -124243 [I][SavedStruct] Loading "/int/.desktop.settings" -124335 [I][BtGap] Stop advertising -124338 [D][BtGap] terminate success -124341 [E][BtGap] set_non_discoverable failed 12 -124345 [I][SavedStruct] Loading "/int/.desktop.settings" -124443 [I][SavedStruct] Loading "/int/.desktop.settings" -124483 [I][BtGap] Disconnect from client. Reason: 16 -124545 [I][SavedStruct] Loading "/int/.bt.settings" -124558 [I][SavedStruct] Loading "/int/.bt.keys" -124567 [I][FuriHalBt] Disconnect and stop advertising -124571 [I][FuriHalBt] Stop current profile services -124582 [I][FuriHalBt] Stop BLE related RTOS threads -124606 [I][FuriHalBt] Reset SHCI -124643 [I][SavedStruct] Loading "/int/.desktop.settings" -124720 [I][FuriHalBt] Start BT initialization -124725 [I][Core2] Core2 started -124727 [I][Core2] C2 boot completed, mode: Stack -124730 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -124732 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -124736 [I][Core2] Radio stack started -124738 [I][Core2] Flash activity control switched to SEM7 -124740 [I][BtGap] Advertising name: Keyboard -124742 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -124753 [E][BtGap] Message queue get error: -4 -124762 [D][BtBatterySvc] Updating power state characteristic -124768 [I][BtSrv] Bt App started -124770 [I][BtGap] Start advertising -124772 [I][BadBleWorker] End -124774 [I][SavedStruct] Loading "/int/.desktop.settings" -124785 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -124790 [I][BtGap] Rssi: 328 -124801 [D][BrowserWorker] Start -124803 [I][SavedStruct] Loading "/int/.desktop.settings" -124834 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: 4 -124836 [D][BrowserWorker] Load offset: 0 cnt: 50 -124880 [D][BtGap] Slave security initiated -124999 [I][BtGap] Pairing complete -125003 [I][BtSrv] Open RPC connection -125006 [D][RpcSrv] Session started -125008 [D][BtBatterySvc] Updating battery level characteristic -125025 [D][BrowserWorker] Exit to: /any/BadUsb items: 10 idx: -1 -125028 [D][BrowserWorker] Load offset: 0 cnt: 50 -125146 [I][BtGap] Rx MTU size: 414 -125268 [D][BrowserWorker] End -125270 [I][SavedStruct] Loading "/int/.desktop.settings" -125315 [I][fap_loader_app] FAP app returned: 0 -125347 [I][LoaderSrv] Application stopped. Free heap: 118720 -125376 [I][AnimationStorage] Custom Manifest selected -126074 [I][AnimationManager] Select 'SPIRAL' animation -126078 [I][AnimationManager] Load animation 'SPIRAL' -126102 [I][SavedStruct] Loading "/int/.desktop.settings" -127063 [D][BtSerialSvc] Received 57 bytes -127066 [D][BtSerialSvc] Available buff size: 967 -127069 [D][RpcStorage] Read -127123 [D][RpcStorage] Stat -127183 [D][RpcStorage] Info -127243 [D][BtSerialSvc] Received 12 bytes -127245 [D][BtSerialSvc] Available buff size: 1012 -127247 [D][RpcStorage] Info -127301 [D][BtSerialSvc] Received 23 bytes -127303 [D][BtSerialSvc] Available buff size: 1001 -127306 [D][RpcSystem] SetDatetime -127359 [D][BtSerialSvc] Received 29 bytes -127361 [D][BtSerialSvc] Available buff size: 995 -127364 [D][RpcStorage] Stat -127446 [D][BtSerialSvc] Received 11 bytes -127448 [D][BtSerialSvc] Available buff size: 1013 -127451 [D][RpcStorage] List -127745 [D][BtSerialSvc] Received 18 bytes -127747 [D][BtSerialSvc] Available buff size: 1006 -127749 [D][RpcStorage] List -127983 [D][BtSerialSvc] Received 18 bytes -127985 [D][BtSerialSvc] Available buff size: 1006 -127988 [D][RpcStorage] List -128041 [D][BtSerialSvc] Received 15 bytes -128043 [D][BtSerialSvc] Available buff size: 1009 -128046 [D][RpcStorage] List -128219 [D][BtSerialSvc] Received 15 bytes -128222 [D][BtSerialSvc] Available buff size: 1009 -128225 [D][RpcStorage] List -128399 [D][BtSerialSvc] Received 20 bytes -128403 [D][BtSerialSvc] Available buff size: 1004 -128408 [D][RpcStorage] List -128576 [D][BtSerialSvc] Received 19 bytes -128578 [D][BtSerialSvc] Available buff size: 1005 -128580 [D][RpcStorage] List -128633 [D][BtSerialSvc] Received 27 bytes -128635 [D][BtSerialSvc] Available buff size: 997 -128639 [D][RpcStorage] Md5sum -129503 [D][BtSerialSvc] Received 37 bytes -129505 [D][BtSerialSvc] Available buff size: 987 -129512 [D][RpcStorage] Md5sum -129591 [D][BtSerialSvc] Received 38 bytes -129593 [D][BtSerialSvc] Available buff size: 986 -129600 [D][RpcStorage] Md5sum -129678 [D][BtSerialSvc] Received 37 bytes -129680 [D][BtSerialSvc] Available buff size: 987 -129683 [D][RpcStorage] Md5sum -129736 [D][BtSerialSvc] Received 38 bytes -129738 [D][BtSerialSvc] Available buff size: 986 -129741 [D][RpcStorage] Md5sum -129794 [D][BtSerialSvc] Received 36 bytes -129796 [D][BtSerialSvc] Available buff size: 988 -129799 [D][RpcStorage] Md5sum -130032 [D][BtSerialSvc] Received 36 bytes -130034 [D][BtSerialSvc] Available buff size: 988 -130037 [D][RpcStorage] Md5sum -130120 [D][BtSerialSvc] Received 36 bytes -130122 [D][BtSerialSvc] Available buff size: 988 -130125 [D][RpcStorage] Md5sum - ->: - _.-------.._ -, - .-"```"--..,,_/ /`-, -, \ - .:" /:/ /'\ \ ,_..., `. | | - / ,----/:/ /`\ _\~`_-"` _; - ' / /`"""'\ \ \.~`_-' ,-"'/ - | | | 0 | | .-' ,/` / - | ,..\ \ ,.-"` ,/` / - ; : `/`""\` ,/--==,/-----, - | `-...| -.___-Z:_______J...---; - : ` _-' - _L_ _ ___ ___ ___ ___ ____--"`___ _ ___ -| __|| | |_ _|| _ \| _ \| __|| _ \ / __|| | |_ _| -| _| | |__ | | | _/| _/| _| | / | (__ | |__ | | -|_| |____||___||_| |_| |___||_|_\ \___||____||___| - -Welcome to Flipper Zero Command Line Interface! -Read Manual https://docs.flipperzero.one - -Firmware version: dev 0.74.3 (XFW-0040 built on 26-01-2023) - ->: log -Press CTRL+C to stop... -25524 [D][BrowserWorker] End -25537 [I][BtGap] Stop advertising -25541 [D][BtGap] set_non_discoverable success -25555 [I][SavedStruct] Loading "/int/.desktop.settings" -25706 [I][SavedStruct] Loading "/int/.desktop.settings" -25747 [I][FuriHalBt] Disconnect and stop advertising -25749 [I][FuriHalBt] Stop current profile services -25758 [I][FuriHalBt] Stop BLE related RTOS threads -25782 [I][FuriHalBt] Reset SHCI -25896 [I][FuriHalBt] Start BT initialization -25901 [I][Core2] Core2 started -25903 [I][Core2] C2 boot completed, mode: Stack -25906 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -25908 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -25912 [I][SavedStruct] Loading "/int/.desktop.settings" -25915 [I][Core2] Radio stack started -25921 [I][Core2] Flash activity control switched to SEM7 -25925 [I][BtGap] Advertising name: Keyboard -25928 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -25950 [D][BtBatterySvc] Updating power state characteristic -25956 [I][BtGap] Start advertising -25958 [I][SavedStruct] Loading "/int/.bt.settings" -25975 [I][SavedStruct] Loading "/ext/apps/Tools/.bt_hid.keys" -25984 [I][FuriHalBt] Disconnect and stop advertising -25986 [I][BtGap] Stop advertising -25989 [D][BtGap] set_non_discoverable success -25992 [I][FuriHalBt] Stop current profile services -26001 [I][FuriHalBt] Stop BLE related RTOS threads -26026 [I][FuriHalBt] Reset SHCI -26051 [I][SavedStruct] Loading "/int/.desktop.settings" -26106 [I][SavedStruct] Loading "/int/.desktop.settings" -26140 [I][FuriHalBt] Start BT initialization -26145 [I][Core2] Core2 started -26147 [I][Core2] C2 boot completed, mode: Stack -26150 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -26152 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -26156 [I][Core2] Radio stack started -26159 [I][Core2] Flash activity control switched to SEM7 -26161 [I][BtGap] Advertising name: Rumik1 -26164 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -26181 [D][BtBatterySvc] Updating power state characteristic -26190 [I][BtSrv] Bt App started -26192 [I][BtGap] Start advertising -26195 [I][BadBleWorker] Init -26197 [I][SavedStruct] Loading "/int/.desktop.settings" -26224 [I][BadBleWorker] BLE Key timeout : 16 -26306 [I][SavedStruct] Loading "/int/.desktop.settings" -26506 [I][SavedStruct] Loading "/int/.desktop.settings" -26551 [I][SavedStruct] Loading "/int/.desktop.settings" -26706 [I][SavedStruct] Loading "/int/.desktop.settings" -26909 [I][SavedStruct] Loading "/int/.desktop.settings" -27051 [I][SavedStruct] Loading "/int/.desktop.settings" -27106 [I][SavedStruct] Loading "/int/.desktop.settings" -27306 [I][SavedStruct] Loading "/int/.desktop.settings" -27506 [I][SavedStruct] Loading "/int/.desktop.settings" -27551 [I][SavedStruct] Loading "/int/.desktop.settings" -27706 [I][SavedStruct] Loading "/int/.desktop.settings" -27906 [I][SavedStruct] Loading "/int/.desktop.settings" -28051 [I][SavedStruct] Loading "/int/.desktop.settings" -28106 [I][SavedStruct] Loading "/int/.desktop.settings" -28306 [I][SavedStruct] Loading "/int/.desktop.settings" -28506 [I][SavedStruct] Loading "/int/.desktop.settings" -28551 [I][SavedStruct] Loading "/int/.desktop.settings" -28706 [I][SavedStruct] Loading "/int/.desktop.settings" -28906 [I][SavedStruct] Loading "/int/.desktop.settings" -29051 [I][SavedStruct] Loading "/int/.desktop.settings" -29106 [I][SavedStruct] Loading "/int/.desktop.settings" -29306 [I][SavedStruct] Loading "/int/.desktop.settings" -29506 [I][SavedStruct] Loading "/int/.desktop.settings" -29551 [I][SavedStruct] Loading "/int/.desktop.settings" -29706 [I][SavedStruct] Loading "/int/.desktop.settings" -29906 [I][SavedStruct] Loading "/int/.desktop.settings" -30051 [I][SavedStruct] Loading "/int/.desktop.settings" -30106 [I][SavedStruct] Loading "/int/.desktop.settings" -30306 [I][SavedStruct] Loading "/int/.desktop.settings" -30506 [I][SavedStruct] Loading "/int/.desktop.settings" -30551 [I][SavedStruct] Loading "/int/.desktop.settings" -30706 [I][SavedStruct] Loading "/int/.desktop.settings" -30906 [I][SavedStruct] Loading "/int/.desktop.settings" -31051 [I][SavedStruct] Loading "/int/.desktop.settings" -31106 [I][SavedStruct] Loading "/int/.desktop.settings" -31306 [I][SavedStruct] Loading "/int/.desktop.settings" -31506 [I][SavedStruct] Loading "/int/.desktop.settings" -31551 [I][SavedStruct] Loading "/int/.desktop.settings" -31706 [I][SavedStruct] Loading "/int/.desktop.settings" -31906 [I][SavedStruct] Loading "/int/.desktop.settings" -32051 [I][SavedStruct] Loading "/int/.desktop.settings" -32106 [I][SavedStruct] Loading "/int/.desktop.settings" -32306 [I][SavedStruct] Loading "/int/.desktop.settings" -32506 [I][SavedStruct] Loading "/int/.desktop.settings" -32551 [I][SavedStruct] Loading "/int/.desktop.settings" -32706 [I][SavedStruct] Loading "/int/.desktop.settings" -32906 [I][SavedStruct] Loading "/int/.desktop.settings" -33051 [I][SavedStruct] Loading "/int/.desktop.settings" -33106 [I][SavedStruct] Loading "/int/.desktop.settings" -33306 [I][SavedStruct] Loading "/int/.desktop.settings" -33506 [I][SavedStruct] Loading "/int/.desktop.settings" -33551 [I][SavedStruct] Loading "/int/.desktop.settings" -33706 [I][SavedStruct] Loading "/int/.desktop.settings" -33906 [I][SavedStruct] Loading "/int/.desktop.settings" -34051 [I][SavedStruct] Loading "/int/.desktop.settings" -34106 [I][SavedStruct] Loading "/int/.desktop.settings" -34306 [I][SavedStruct] Loading "/int/.desktop.settings" -34506 [I][SavedStruct] Loading "/int/.desktop.settings" -34551 [I][SavedStruct] Loading "/int/.desktop.settings" -34706 [I][SavedStruct] Loading "/int/.desktop.settings" -34906 [I][SavedStruct] Loading "/int/.desktop.settings" -35051 [I][SavedStruct] Loading "/int/.desktop.settings" -35106 [I][SavedStruct] Loading "/int/.desktop.settings" -35306 [I][SavedStruct] Loading "/int/.desktop.settings" -35506 [I][SavedStruct] Loading "/int/.desktop.settings" -35551 [I][SavedStruct] Loading "/int/.desktop.settings" -35706 [I][SavedStruct] Loading "/int/.desktop.settings" -35906 [I][SavedStruct] Loading "/int/.desktop.settings" -36051 [I][SavedStruct] Loading "/int/.desktop.settings" -36106 [I][SavedStruct] Loading "/int/.desktop.settings" -36306 [I][SavedStruct] Loading "/int/.desktop.settings" -36506 [I][SavedStruct] Loading "/int/.desktop.settings" -36551 [I][SavedStruct] Loading "/int/.desktop.settings" -36706 [I][SavedStruct] Loading "/int/.desktop.settings" -36906 [I][SavedStruct] Loading "/int/.desktop.settings" -37051 [I][SavedStruct] Loading "/int/.desktop.settings" -37106 [I][SavedStruct] Loading "/int/.desktop.settings" -37306 [I][SavedStruct] Loading "/int/.desktop.settings" -37506 [I][SavedStruct] Loading "/int/.desktop.settings" -37551 [I][SavedStruct] Loading "/int/.desktop.settings" -37706 [I][SavedStruct] Loading "/int/.desktop.settings" -37906 [I][SavedStruct] Loading "/int/.desktop.settings" -38053 [I][SavedStruct] Loading "/int/.desktop.settings" -38106 [I][SavedStruct] Loading "/int/.desktop.settings" -38306 [I][SavedStruct] Loading "/int/.desktop.settings" -38506 [I][SavedStruct] Loading "/int/.desktop.settings" -38551 [I][SavedStruct] Loading "/int/.desktop.settings" -38706 [I][SavedStruct] Loading "/int/.desktop.settings" -38906 [I][SavedStruct] Loading "/int/.desktop.settings" -39051 [I][SavedStruct] Loading "/int/.desktop.settings" -39106 [I][SavedStruct] Loading "/int/.desktop.settings" -39256 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -39258 [I][BtGap] Rssi: 334 -39306 [I][SavedStruct] Loading "/int/.desktop.settings" -39344 [D][BtGap] Slave security initiated -39435 [I][BtGap] Rx MTU size: 414 -39506 [I][SavedStruct] Loading "/int/.desktop.settings" -39551 [I][SavedStruct] Loading "/int/.desktop.settings" -39706 [I][SavedStruct] Loading "/int/.desktop.settings" -39906 [I][SavedStruct] Loading "/int/.desktop.settings" -39941 [D][BtGap] Bond lost event. Start rebonding -40051 [I][SavedStruct] Loading "/int/.desktop.settings" -40106 [I][SavedStruct] Loading "/int/.desktop.settings" -40119 [I][BtGap] Verify numeric comparison: 448118 -41993 [I][SavedStruct] Loading "/int/.desktop.settings" -42014 [I][SavedStruct] Loading "/int/.desktop.settings" -42051 [I][SavedStruct] Loading "/int/.desktop.settings" -42106 [I][SavedStruct] Loading "/int/.desktop.settings" -42306 [I][SavedStruct] Loading "/int/.desktop.settings" -42453 [I][BtKeyStorage] Base address: 200301E0. Start update address: 20030938. Size changed: 4 -42456 [I][SavedStruct] Saving "/ext/apps/Tools/.bt_hid.keys" -42458 [I][BtGap] Pairing complete -42506 [I][BtKeyStorage] Base address: 200301E0. Start update address: 20030938. Size changed: 88 -42508 [I][SavedStruct] Saving "/ext/apps/Tools/.bt_hid.keys" -42540 [D][BtGap] RSSI: -81 -42542 [D][BtBatterySvc] Updating battery level characteristic -42544 [I][SavedStruct] Loading "/int/.desktop.settings" -42547 [D][BtGap] RSSI: -81 -42551 [I][BadBleWorker] BLE Key timeout : 33 -42569 [I][SavedStruct] Loading "/int/.desktop.settings" -42706 [I][SavedStruct] Loading "/int/.desktop.settings" -42906 [I][SavedStruct] Loading "/int/.desktop.settings" -43068 [I][SavedStruct] Loading "/int/.desktop.settings" -43106 [I][SavedStruct] Loading "/int/.desktop.settings" -43306 [I][SavedStruct] Loading "/int/.desktop.settings" -43506 [I][SavedStruct] Loading "/int/.desktop.settings" -43514 [I][BtGap] Connection parameters event complete -43518 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -43522 [W][BtGap] Unsupported connection interval. Request connection parameters update -43528 [I][BtGap] Rssi: 358 -43568 [I][SavedStruct] Loading "/int/.desktop.settings" -43570 [D][BtGap] Connection parameters accepted -43706 [I][SavedStruct] Loading "/int/.desktop.settings" -43731 [I][BtGap] Connection parameters event complete -43735 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -43737 [I][BtGap] Rssi: 337 -43906 [I][SavedStruct] Loading "/int/.desktop.settings" -44068 [I][SavedStruct] Loading "/int/.desktop.settings" -44106 [I][SavedStruct] Loading "/int/.desktop.settings" -44306 [I][SavedStruct] Loading "/int/.desktop.settings" -44506 [I][SavedStruct] Loading "/int/.desktop.settings" -44568 [I][SavedStruct] Loading "/int/.desktop.settings" -44706 [I][SavedStruct] Loading "/int/.desktop.settings" -44906 [I][SavedStruct] Loading "/int/.desktop.settings" -45068 [I][SavedStruct] Loading "/int/.desktop.settings" -45106 [I][SavedStruct] Loading "/int/.desktop.settings" -45306 [I][SavedStruct] Loading "/int/.desktop.settings" -45337 [D][DolphinState] icounter 1325, butthurt 0 -45340 [D][BtGap] RSSI: -92 -45341 [I][BadBleWorker] BLE Key timeout : 16 -45346 [D][BadBleWorker] line:REM Troll scrip to open vx-underground on an iphone -45348 [D][BtGap] RSSI: -92 -45350 [I][BadBleWorker] BLE Key timeout : 16 -45352 [D][BadBleWorker] line:DELAY 1000 -45354 [D][BtGap] RSSI: -92 -45355 [I][BadBleWorker] BLE Key timeout : 16 -45506 [I][SavedStruct] Loading "/int/.desktop.settings" -45706 [I][SavedStruct] Loading "/int/.desktop.settings" -45838 [I][SavedStruct] Loading "/int/.desktop.settings" -45906 [I][SavedStruct] Loading "/int/.desktop.settings" -46106 [I][SavedStruct] Loading "/int/.desktop.settings" -46306 [I][SavedStruct] Loading "/int/.desktop.settings" -46338 [I][SavedStruct] Loading "/int/.desktop.settings" -46357 [D][BadBleWorker] line:GUI SPACE -46359 [I][BadBleWorker] Special key pressed 82c - -46380 [D][BtGap] RSSI: -96 -46382 [I][BadBleWorker] BLE Key timeout : 16 -46385 [D][BadBleWorker] line:DELAY 500 -46388 [D][BtGap] RSSI: -96 -46390 [I][BadBleWorker] BLE Key timeout : 16 -46506 [I][SavedStruct] Loading "/int/.desktop.settings" -46706 [I][SavedStruct] Loading "/int/.desktop.settings" -46838 [I][SavedStruct] Loading "/int/.desktop.settings" -46892 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -46906 [I][SavedStruct] Loading "/int/.desktop.settings" -47106 [I][SavedStruct] Loading "/int/.desktop.settings" -47306 [I][SavedStruct] Loading "/int/.desktop.settings" -47308 [E][BtHid] Failed updating report characteristic: 100 -47313 [E][BtHid] Failed updating report characteristic: 100 -47334 [E][BtHid] Failed updating report characteristic: 100 -47338 [I][SavedStruct] Loading "/int/.desktop.settings" -47340 [E][BtHid] Failed updating report characteristic: 100 -47469 [E][BtHid] Failed updating report characteristic: 100 -47472 [E][BtHid] Failed updating report characteristic: 100 -47491 [E][BtHid] Failed updating report characteristic: 100 -47494 [E][BtHid] Failed updating report characteristic: 100 -47506 [I][SavedStruct] Loading "/int/.desktop.settings" -47513 [E][BtHid] Failed updating report characteristic: 100 -47516 [E][BtHid] Failed updating report characteristic: 100 -47537 [E][BtHid] Failed updating report characteristic: 100 -47540 [E][BtHid] Failed updating report characteristic: 100 -47559 [E][BtHid] Failed updating report characteristic: 100 -47562 [E][BtHid] Failed updating report characteristic: 100 -47581 [E][BtHid] Failed updating report characteristic: 100 -47584 [E][BtHid] Failed updating report characteristic: 100 -47603 [E][BtHid] Failed updating report characteristic: 100 -47606 [E][BtHid] Failed updating report characteristic: 100 -47625 [E][BtHid] Failed updating report characteristic: 100 -47628 [E][BtHid] Failed updating report characteristic: 100 -47682 [D][BtGap] RSSI: -97 -47684 [I][BadBleWorker] BLE Key timeout : 16 -47686 [D][BadBleWorker] line:DELAY 200 -47688 [D][BtGap] RSSI: -97 -47690 [I][BadBleWorker] BLE Key timeout : 16 -47706 [I][SavedStruct] Loading "/int/.desktop.settings" -47838 [I][SavedStruct] Loading "/int/.desktop.settings" -47892 [D][BadBleWorker] line:ENTER -47894 [I][BadBleWorker] Special key pressed 28 - -47906 [I][SavedStruct] Loading "/int/.desktop.settings" -47916 [D][BtGap] RSSI: -91 -47918 [I][BadBleWorker] BLE Key timeout : 16 -47922 [D][BadBleWorker] line:GUI SPACE -47924 [I][BadBleWorker] Special key pressed 82c - -47948 [D][BtGap] RSSI: -91 -47950 [I][BadBleWorker] BLE Key timeout : 16 -47953 [D][BadBleWorker] line:DELAY 500 -47956 [D][BtGap] RSSI: -91 -47958 [I][BadBleWorker] BLE Key timeout : 16 -48106 [I][SavedStruct] Loading "/int/.desktop.settings" -48306 [I][SavedStruct] Loading "/int/.desktop.settings" -48338 [I][SavedStruct] Loading "/int/.desktop.settings" -48460 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -48506 [I][SavedStruct] Loading "/int/.desktop.settings" -48706 [I][SavedStruct] Loading "/int/.desktop.settings" -48787 [E][BtHid] Failed updating report characteristic: 100 -48790 [E][BtHid] Failed updating report characteristic: 100 -48809 [E][BtHid] Failed updating report characteristic: 100 -48812 [E][BtHid] Failed updating report characteristic: 100 -48831 [E][BtHid] Failed updating report characteristic: 100 -48834 [E][BtHid] Failed updating report characteristic: 100 -48838 [I][SavedStruct] Loading "/int/.desktop.settings" -48854 [E][BtHid] Failed updating report characteristic: 100 -48859 [E][BtHid] Failed updating report characteristic: 100 -48878 [E][BtHid] Failed updating report characteristic: 100 -48881 [E][BtHid] Failed updating report characteristic: 100 -48900 [E][BtHid] Failed updating report characteristic: 100 -48903 [E][BtHid] Failed updating report characteristic: 100 -48907 [I][SavedStruct] Loading "/int/.desktop.settings" -48923 [E][BtHid] Failed updating report characteristic: 100 -48928 [E][BtHid] Failed updating report characteristic: 100 -48947 [E][BtHid] Failed updating report characteristic: 100 -48950 [E][BtHid] Failed updating report characteristic: 100 -48969 [E][BtHid] Failed updating report characteristic: 100 -48972 [E][BtHid] Failed updating report characteristic: 100 -48991 [E][BtHid] Failed updating report characteristic: 100 -48994 [E][BtHid] Failed updating report characteristic: 100 -49103 [E][BtHid] Failed updating report characteristic: 100 -49106 [I][SavedStruct] Loading "/int/.desktop.settings" -49123 [E][BtHid] Failed updating report characteristic: 100 -49127 [E][BtHid] Failed updating report characteristic: 100 -49146 [E][BtHid] Failed updating report characteristic: 100 -49149 [E][BtHid] Failed updating report characteristic: 100 -49168 [E][BtHid] Failed updating report characteristic: 100 -49171 [E][BtHid] Failed updating report characteristic: 100 -49190 [E][BtHid] Failed updating report characteristic: 100 -49193 [E][BtHid] Failed updating report characteristic: 100 -49213 [E][BtHid] Failed updating report characteristic: 100 -49218 [E][BtHid] Failed updating report characteristic: 100 -49238 [E][BtHid] Failed updating report characteristic: 100 -49241 [E][BtHid] Failed updating report characteristic: 100 -49260 [E][BtHid] Failed updating report characteristic: 100 -49280 [D][BtGap] RSSI: -90 -49282 [I][BadBleWorker] BLE Key timeout : 16 -49285 [D][BadBleWorker] line:DELAY 200 -49288 [D][BtGap] RSSI: -90 -49290 [I][BadBleWorker] BLE Key timeout : 16 -49306 [I][SavedStruct] Loading "/int/.desktop.settings" -49338 [I][SavedStruct] Loading "/int/.desktop.settings" -49492 [D][BadBleWorker] line:ENTER -49494 [I][BadBleWorker] Special key pressed 28 - -49506 [I][SavedStruct] Loading "/int/.desktop.settings" -49516 [D][BtGap] RSSI: -96 -49518 [I][BadBleWorker] BLE Key timeout : 16 -49527 [D][BadBleWorker] line:GUI SPACE -49529 [I][BadBleWorker] Special key pressed 82c - -49550 [D][BtGap] RSSI: -97 -49552 [I][BadBleWorker] BLE Key timeout : 16 -49555 [D][BadBleWorker] line:DELAY 500 -49557 [D][BtGap] RSSI: -97 -49558 [I][BadBleWorker] BLE Key timeout : 16 -49706 [I][SavedStruct] Loading "/int/.desktop.settings" -49838 [I][SavedStruct] Loading "/int/.desktop.settings" -49906 [I][SavedStruct] Loading "/int/.desktop.settings" -50060 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -50106 [I][SavedStruct] Loading "/int/.desktop.settings" -50306 [I][SavedStruct] Loading "/int/.desktop.settings" -50338 [I][SavedStruct] Loading "/int/.desktop.settings" -50506 [I][SavedStruct] Loading "/int/.desktop.settings" -50706 [I][SavedStruct] Loading "/int/.desktop.settings" -50796 [D][BtGap] RSSI: -91 -50798 [I][BadBleWorker] BLE Key timeout : 16 -50801 [D][BadBleWorker] line:DELAY 200 -50804 [D][BtGap] RSSI: -91 -50806 [I][BadBleWorker] BLE Key timeout : 16 -50838 [I][SavedStruct] Loading "/int/.desktop.settings" -50906 [I][SavedStruct] Loading "/int/.desktop.settings" -51008 [D][BadBleWorker] line:ENTER -51010 [I][BadBleWorker] Special key pressed 28 - -51029 [D][BtGap] RSSI: -95 -51031 [I][BadBleWorker] BLE Key timeout : 16 -51034 [D][BadBleWorker] line:GUI SPACE -51036 [I][BadBleWorker] Special key pressed 82c - -51056 [D][BtGap] RSSI: -85 -51058 [I][BadBleWorker] BLE Key timeout : 33 -51061 [D][BadBleWorker] line:DELAY 500 -51064 [D][BtGap] RSSI: -85 -51066 [I][BadBleWorker] BLE Key timeout : 33 -51106 [I][SavedStruct] Loading "/int/.desktop.settings" -51306 [I][SavedStruct] Loading "/int/.desktop.settings" -51338 [I][SavedStruct] Loading "/int/.desktop.settings" -51506 [I][SavedStruct] Loading "/int/.desktop.settings" -51568 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -51706 [I][SavedStruct] Loading "/int/.desktop.settings" -51838 [I][SavedStruct] Loading "/int/.desktop.settings" -51906 [I][SavedStruct] Loading "/int/.desktop.settings" -52106 [I][SavedStruct] Loading "/int/.desktop.settings" -52306 [I][SavedStruct] Loading "/int/.desktop.settings" -52338 [I][SavedStruct] Loading "/int/.desktop.settings" -52506 [I][SavedStruct] Loading "/int/.desktop.settings" -52706 [I][SavedStruct] Loading "/int/.desktop.settings" -52838 [I][SavedStruct] Loading "/int/.desktop.settings" -52906 [I][SavedStruct] Loading "/int/.desktop.settings" -53007 [D][BtGap] RSSI: -79 -53009 [I][BadBleWorker] BLE Key timeout : 33 -53012 [D][BadBleWorker] line:DELAY 200 -53014 [D][BtGap] RSSI: -79 -53016 [I][BadBleWorker] BLE Key timeout : 33 -53106 [I][SavedStruct] Loading "/int/.desktop.settings" -53218 [D][BadBleWorker] line:ENTER -53220 [I][BadBleWorker] Special key pressed 28 - -53257 [D][BtGap] RSSI: -80 -53259 [I][BadBleWorker] BLE Key timeout : 33 -53263 [D][BtGap] RSSI: -80 -53265 [I][BadBleWorker] BLE Key timeout : 33 -53306 [I][SavedStruct] Loading "/int/.desktop.settings" -53338 [I][SavedStruct] Loading "/int/.desktop.settings" -53506 [I][SavedStruct] Loading "/int/.desktop.settings" -53706 [I][SavedStruct] Loading "/int/.desktop.settings" -53838 [I][SavedStruct] Loading "/int/.desktop.settings" -53906 [I][SavedStruct] Loading "/int/.desktop.settings" -54106 [I][SavedStruct] Loading "/int/.desktop.settings" -54306 [I][SavedStruct] Loading "/int/.desktop.settings" -54338 [I][SavedStruct] Loading "/int/.desktop.settings" -54506 [I][SavedStruct] Loading "/int/.desktop.settings" -54706 [I][SavedStruct] Loading "/int/.desktop.settings" -54838 [I][SavedStruct] Loading "/int/.desktop.settings" -54906 [I][SavedStruct] Loading "/int/.desktop.settings" -55106 [I][SavedStruct] Loading "/int/.desktop.settings" -55306 [I][SavedStruct] Loading "/int/.desktop.settings" -55338 [I][SavedStruct] Loading "/int/.desktop.settings" -55506 [I][SavedStruct] Loading "/int/.desktop.settings" -55706 [I][SavedStruct] Loading "/int/.desktop.settings" -55838 [I][SavedStruct] Loading "/int/.desktop.settings" -55906 [I][SavedStruct] Loading "/int/.desktop.settings" -56106 [I][SavedStruct] Loading "/int/.desktop.settings" -56316 [I][SavedStruct] Loading "/int/.desktop.settings" -56338 [I][SavedStruct] Loading "/int/.desktop.settings" -56506 [I][SavedStruct] Loading "/int/.desktop.settings" -56706 [I][SavedStruct] Loading "/int/.desktop.settings" -56838 [I][SavedStruct] Loading "/int/.desktop.settings" -56906 [I][SavedStruct] Loading "/int/.desktop.settings" -57106 [I][SavedStruct] Loading "/int/.desktop.settings" -57306 [I][SavedStruct] Loading "/int/.desktop.settings" -57338 [I][SavedStruct] Loading "/int/.desktop.settings" -57506 [I][SavedStruct] Loading "/int/.desktop.settings" -57706 [I][SavedStruct] Loading "/int/.desktop.settings" -57838 [I][SavedStruct] Loading "/int/.desktop.settings" -57906 [I][SavedStruct] Loading "/int/.desktop.settings" -58083 [I][BtGap] Stop advertising -58086 [D][BtGap] terminate success -58089 [E][BtGap] set_non_discoverable failed 12 -58093 [I][SavedStruct] Loading "/int/.desktop.settings" -58112 [I][SavedStruct] Loading "/int/.desktop.settings" -58131 [I][BtGap] Disconnect from client. Reason: 16 -58293 [I][SavedStruct] Loading "/int/.bt.settings" -58307 [I][SavedStruct] Loading "/int/.bt.keys" -58317 [I][FuriHalBt] Disconnect and stop advertising -58320 [I][FuriHalBt] Stop current profile services -58324 [I][SavedStruct] Loading "/int/.desktop.settings" -58346 [I][FuriHalBt] Stop BLE related RTOS threads -58374 [I][FuriHalBt] Reset SHCI -58488 [I][FuriHalBt] Start BT initialization -58493 [I][Core2] Core2 started -58495 [I][Core2] C2 boot completed, mode: Stack -58498 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -58500 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -58504 [I][Core2] Radio stack started -58507 [I][Core2] Flash activity control switched to SEM7 -58511 [I][BtGap] Advertising name: Keyboard -58514 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -58518 [I][SavedStruct] Loading "/int/.desktop.settings" -58541 [D][BtBatterySvc] Updating power state characteristic -58547 [I][BtSrv] Bt App started -58548 [I][BtGap] Start advertising -58550 [I][BadBleWorker] End -58552 [I][SavedStruct] Loading "/int/.desktop.settings" -58573 [I][SavedStruct] Loading "/int/.desktop.settings" -58575 [D][BrowserWorker] Start -58608 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: 4 -58610 [D][BrowserWorker] Load offset: 0 cnt: 50 -58724 [D][BrowserWorker] Exit to: /any/BadUsb items: 10 idx: -1 -58727 [D][BrowserWorker] Load offset: 0 cnt: 50 -59009 [D][BrowserWorker] End -59011 [I][SavedStruct] Loading "/int/.desktop.settings" -59055 [I][fap_loader_app] FAP app returned: 0 -59091 [I][LoaderSrv] Application stopped. Free heap: 127088 -59120 [I][AnimationStorage] Custom Manifest selected -59411 [I][AnimationManager] Select 'HANDS' animation -59415 [I][AnimationManager] Load animation 'HANDS' -59443 [I][SavedStruct] Loading "/int/.desktop.settings" -75339 [I][Dolphin] Flush stats -75341 [I][SavedStruct] Saving "/int/.dolphin.state" -75351 [D][StorageInt] Device erase: page 9, translated page: d6 -75439 [D][StorageInt] Device sync: skipping -75441 [I][DolphinState] State saved -77873 [I][AnimationStorage] Custom Manifest selected -78353 [I][AnimationManager] Select 'DEDSEC_AD' animation -108394 [I][AnimationStorage] Custom Manifest selected -108758 [I][AnimationManager] Select 'DEDSEC_ASCII' animation -118697 [D][BtGap] set_non_discoverable success -138798 [I][AnimationStorage] Custom Manifest selected -139612 [I][AnimationManager] Select 'MARCUS' animation -169649 [I][AnimationStorage] Custom Manifest selected -170049 [I][AnimationManager] Select 'HANDS' animation -178699 [D][BtGap] set_non_discoverable success -200094 [I][AnimationStorage] Custom Manifest selected -200963 [I][AnimationManager] Select 'SKULL' animation -231003 [I][AnimationStorage] Custom Manifest selected -231753 [I][AnimationManager] Select 'GUNS_CAR' animation -238701 [D][BtGap] set_non_discoverable success -261795 [I][AnimationStorage] Custom Manifest selected -262627 [I][AnimationManager] Select 'DEDSEC_LOGO' animation -292669 [I][AnimationStorage] Custom Manifest selected -293615 [I][AnimationManager] Select 'LOGO_WD2' animation -298703 [D][BtGap] set_non_discoverable success -323656 [I][AnimationStorage] Custom Manifest selected -324243 [I][AnimationManager] Select 'DEDSEC_OLD' animation -354285 [I][AnimationStorage] Custom Manifest selected -355074 [I][AnimationManager] Select 'SPIRAL' animation -358705 [D][BtGap] set_non_discoverable success -385114 [I][AnimationStorage] Custom Manifest selected -385501 [I][AnimationManager] Select 'HANDS' animation -415546 [I][AnimationStorage] Custom Manifest selected -416332 [I][AnimationManager] Select 'SPIRAL' animation -418707 [D][BtGap] set_non_discoverable success -446371 [I][AnimationStorage] Custom Manifest selected -446861 [I][AnimationManager] Select 'DEDSEC_AD' animation -476903 [I][AnimationStorage] Custom Manifest selected -477735 [I][AnimationManager] Select 'DEDSEC_LOGO' animation -478709 [D][BtGap] set_non_discoverable success -507777 [I][AnimationStorage] Custom Manifest selected -508256 [I][AnimationManager] Select 'DEDSEC_AD' animation -538299 [I][AnimationStorage] Custom Manifest selected -539085 [I][AnimationManager] Select 'SPIRAL' animation -539117 [D][BtGap] set_non_discoverable success -569126 [I][AnimationStorage] Custom Manifest selected -569876 [I][AnimationManager] Select 'GUNS_CAR' animation -599120 [D][BtGap] set_non_discoverable success -599918 [I][AnimationStorage] Custom Manifest selected -600830 [I][AnimationManager] Select 'REAPER_ALT' animation -630871 [I][AnimationStorage] Custom Manifest selected -631392 [I][AnimationManager] Select 'DEDSEC_TALK' animation -659122 [D][BtGap] set_non_discoverable success -661435 [I][AnimationStorage] Custom Manifest selected -662238 [I][AnimationManager] Select 'MARCUS' animation -690919 [I][LoaderSrv] Starting: Applications -690925 [I][AnimationManager] Unload animation 'MARCUS' -690948 [D][BrowserWorker] Start -690965 [D][BrowserWorker] Enter folder: /ext/apps items: 6 idx: -1 -690967 [D][BrowserWorker] Load offset: 0 cnt: 50 -717407 [D][BrowserWorker] Enter folder: /ext/apps/Tools items: 23 idx: -1 -717410 [D][BrowserWorker] Load offset: 0 cnt: 50 -718007 [D][BrowserWorker] Exit to: /ext/apps items: 6 idx: 5 -718011 [D][BrowserWorker] Load offset: 0 cnt: 50 -719124 [D][BtGap] set_non_discoverable success -719398 [D][BrowserWorker] Enter folder: /ext/apps/Main items: 8 idx: -1 -719400 [D][BrowserWorker] Load offset: 0 cnt: 50 -720667 [D][BrowserWorker] End -720679 [I][fap_loader_app] FAP Loader is loading /ext/apps/Main/bad_ble.fap -720722 [I][fap_loader_app] FAP Loader is mapping -721451 [I][elf] Total size of loaded sections: 10460 -721453 [I][fap_loader_app] Loaded in 774ms -721455 [I][fap_loader_app] FAP Loader is starting app -721483 [D][BrowserWorker] Start -721498 [D][BrowserWorker] Enter folder: /any/BadUsb items: 10 idx: -1 -721502 [D][BrowserWorker] Load offset: 0 cnt: 50 -724277 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: -1 -724280 [D][BrowserWorker] Load offset: 0 cnt: 50 -737153 [D][BrowserWorker] End -737166 [I][BtGap] Stop advertising -737170 [D][BtGap] set_non_discoverable success -737185 [I][SavedStruct] Loading "/int/.desktop.settings" -737308 [I][SavedStruct] Loading "/int/.desktop.settings" -737327 [I][SavedStruct] Loading "/int/.desktop.settings" -737376 [I][FuriHalBt] Disconnect and stop advertising -737380 [I][FuriHalBt] Stop current profile services -737395 [I][FuriHalBt] Stop BLE related RTOS threads -737419 [I][FuriHalBt] Reset SHCI -737527 [I][SavedStruct] Loading "/int/.desktop.settings" -737533 [I][FuriHalBt] Start BT initialization -737540 [I][Core2] Core2 started -737542 [I][Core2] C2 boot completed, mode: Stack -737546 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -737550 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -737557 [I][Core2] Radio stack started -737559 [I][Core2] Flash activity control switched to SEM7 -737562 [I][BtGap] Advertising name: Keyboard -737565 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -737582 [D][BtBatterySvc] Updating power state characteristic -737587 [I][BtGap] Start advertising -737590 [I][SavedStruct] Loading "/int/.bt.settings" -737607 [I][SavedStruct] Loading "/ext/apps/Tools/.bt_hid.keys" -737616 [I][FuriHalBt] Disconnect and stop advertising -737618 [I][BtGap] Stop advertising -737621 [D][BtGap] set_non_discoverable success -737623 [I][FuriHalBt] Stop current profile services -737633 [I][FuriHalBt] Stop BLE related RTOS threads -737641 [I][SavedStruct] Loading "/int/.desktop.settings" -737658 [I][FuriHalBt] Reset SHCI -737683 [I][SavedStruct] Loading "/int/.desktop.settings" -737727 [I][SavedStruct] Loading "/int/.desktop.settings" -737772 [I][FuriHalBt] Start BT initialization -737777 [I][Core2] Core2 started -737779 [I][Core2] C2 boot completed, mode: Stack -737782 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -737784 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -737788 [I][Core2] Radio stack started -737790 [I][Core2] Flash activity control switched to SEM7 -737792 [I][BtGap] Advertising name: Rumik1 -737794 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -737810 [D][BtBatterySvc] Updating power state characteristic -737820 [I][BtSrv] Bt App started -737822 [I][BtGap] Start advertising -737824 [I][BadBleWorker] Init -737828 [I][SavedStruct] Loading "/int/.desktop.settings" -737834 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -737839 [I][BtGap] Rssi: 296 -737863 [D][BtGap] RSSI: -43 -737865 [I][BadBleWorker] BLE Key timeout : 41 -737921 [D][BtGap] Slave security initiated -737927 [I][SavedStruct] Loading "/int/.desktop.settings" -737974 [I][SavedStruct] Loading "/int/.desktop.settings" -738039 [I][BtGap] Pairing complete -738042 [D][BtGap] RSSI: -47 -738044 [D][BtBatterySvc] Updating battery level characteristic -738048 [D][BtGap] RSSI: -47 -738050 [I][BadBleWorker] BLE Key timeout : 41 -738127 [I][SavedStruct] Loading "/int/.desktop.settings" -738183 [I][SavedStruct] Loading "/int/.desktop.settings" -738216 [I][BtGap] Rx MTU size: 414 -738307 [I][SavedStruct] Loading "/int/.desktop.settings" -738327 [I][SavedStruct] Loading "/int/.desktop.settings" -738527 [I][SavedStruct] Loading "/int/.desktop.settings" -738640 [I][SavedStruct] Loading "/int/.desktop.settings" -738683 [I][SavedStruct] Loading "/int/.desktop.settings" -738727 [I][SavedStruct] Loading "/int/.desktop.settings" -738810 [I][BtGap] Connection parameters event complete -738813 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -738815 [W][BtGap] Unsupported connection interval. Request connection parameters update -738819 [I][BtGap] Rssi: 311 -738849 [D][BtGap] Connection parameters accepted -738927 [I][SavedStruct] Loading "/int/.desktop.settings" -738973 [I][SavedStruct] Loading "/int/.desktop.settings" -739010 [I][BtGap] Connection parameters event complete -739012 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -739015 [I][BtGap] Rssi: 328 -739127 [I][SavedStruct] Loading "/int/.desktop.settings" -739183 [I][SavedStruct] Loading "/int/.desktop.settings" -739306 [I][SavedStruct] Loading "/int/.desktop.settings" -739327 [I][SavedStruct] Loading "/int/.desktop.settings" -739527 [I][SavedStruct] Loading "/int/.desktop.settings" -739639 [I][SavedStruct] Loading "/int/.desktop.settings" -739683 [I][SavedStruct] Loading "/int/.desktop.settings" -739727 [I][SavedStruct] Loading "/int/.desktop.settings" -739927 [I][SavedStruct] Loading "/int/.desktop.settings" -739972 [I][SavedStruct] Loading "/int/.desktop.settings" -740127 [I][SavedStruct] Loading "/int/.desktop.settings" -740183 [I][SavedStruct] Loading "/int/.desktop.settings" -740305 [I][SavedStruct] Loading "/int/.desktop.settings" -740327 [I][SavedStruct] Loading "/int/.desktop.settings" -740527 [I][SavedStruct] Loading "/int/.desktop.settings" -740638 [I][SavedStruct] Loading "/int/.desktop.settings" -740683 [I][SavedStruct] Loading "/int/.desktop.settings" -740727 [I][SavedStruct] Loading "/int/.desktop.settings" -740927 [I][SavedStruct] Loading "/int/.desktop.settings" -740971 [I][SavedStruct] Loading "/int/.desktop.settings" -741127 [I][SavedStruct] Loading "/int/.desktop.settings" -741183 [I][SavedStruct] Loading "/int/.desktop.settings" -741304 [I][SavedStruct] Loading "/int/.desktop.settings" -741327 [I][SavedStruct] Loading "/int/.desktop.settings" -741527 [I][SavedStruct] Loading "/int/.desktop.settings" -741637 [I][SavedStruct] Loading "/int/.desktop.settings" -741683 [I][SavedStruct] Loading "/int/.desktop.settings" -741727 [I][SavedStruct] Loading "/int/.desktop.settings" -741927 [I][SavedStruct] Loading "/int/.desktop.settings" -741970 [I][SavedStruct] Loading "/int/.desktop.settings" -742127 [I][SavedStruct] Loading "/int/.desktop.settings" -742183 [I][SavedStruct] Loading "/int/.desktop.settings" -742303 [I][SavedStruct] Loading "/int/.desktop.settings" -742327 [I][SavedStruct] Loading "/int/.desktop.settings" -742527 [I][SavedStruct] Loading "/int/.desktop.settings" -742636 [I][SavedStruct] Loading "/int/.desktop.settings" -742727 [I][SavedStruct] Loading "/int/.desktop.settings" -742927 [I][SavedStruct] Loading "/int/.desktop.settings" -742969 [I][SavedStruct] Loading "/int/.desktop.settings" -743127 [I][SavedStruct] Loading "/int/.desktop.settings" -743302 [I][SavedStruct] Loading "/int/.desktop.settings" -743327 [I][SavedStruct] Loading "/int/.desktop.settings" -743382 [I][SavedStruct] Loading "/int/.desktop.settings" -743527 [I][SavedStruct] Loading "/int/.desktop.settings" -743635 [I][SavedStruct] Loading "/int/.desktop.settings" -743727 [I][SavedStruct] Loading "/int/.desktop.settings" -743882 [I][SavedStruct] Loading "/int/.desktop.settings" -743927 [I][SavedStruct] Loading "/int/.desktop.settings" -743968 [I][SavedStruct] Loading "/int/.desktop.settings" -744127 [I][SavedStruct] Loading "/int/.desktop.settings" -744301 [I][SavedStruct] Loading "/int/.desktop.settings" -744327 [I][SavedStruct] Loading "/int/.desktop.settings" -744382 [I][SavedStruct] Loading "/int/.desktop.settings" -744527 [I][SavedStruct] Loading "/int/.desktop.settings" -744634 [I][SavedStruct] Loading "/int/.desktop.settings" -744727 [I][SavedStruct] Loading "/int/.desktop.settings" -744882 [I][SavedStruct] Loading "/int/.desktop.settings" -744927 [I][SavedStruct] Loading "/int/.desktop.settings" -744967 [I][SavedStruct] Loading "/int/.desktop.settings" -745127 [I][SavedStruct] Loading "/int/.desktop.settings" -745300 [I][SavedStruct] Loading "/int/.desktop.settings" -745327 [I][SavedStruct] Loading "/int/.desktop.settings" -745382 [I][SavedStruct] Loading "/int/.desktop.settings" -745527 [I][SavedStruct] Loading "/int/.desktop.settings" -745633 [I][SavedStruct] Loading "/int/.desktop.settings" -745727 [I][SavedStruct] Loading "/int/.desktop.settings" -745882 [I][SavedStruct] Loading "/int/.desktop.settings" -745927 [I][SavedStruct] Loading "/int/.desktop.settings" -745966 [I][SavedStruct] Loading "/int/.desktop.settings" -746127 [I][SavedStruct] Loading "/int/.desktop.settings" -746299 [I][SavedStruct] Loading "/int/.desktop.settings" -746327 [I][SavedStruct] Loading "/int/.desktop.settings" -746382 [I][SavedStruct] Loading "/int/.desktop.settings" -746527 [I][SavedStruct] Loading "/int/.desktop.settings" -746632 [I][SavedStruct] Loading "/int/.desktop.settings" -746727 [I][SavedStruct] Loading "/int/.desktop.settings" -746882 [I][SavedStruct] Loading "/int/.desktop.settings" -746927 [I][SavedStruct] Loading "/int/.desktop.settings" -746965 [I][SavedStruct] Loading "/int/.desktop.settings" -747127 [I][SavedStruct] Loading "/int/.desktop.settings" -747298 [I][SavedStruct] Loading "/int/.desktop.settings" -747327 [I][SavedStruct] Loading "/int/.desktop.settings" -747453 [D][DolphinState] icounter 1325, butthurt 0 -747456 [D][BtGap] RSSI: -65 -747458 [I][BadBleWorker] BLE Key timeout : 37 -747462 [D][BadBleWorker] line:REM Troll scrip to open vx-underground on an iphone -747465 [D][BtGap] RSSI: -65 -747467 [I][BadBleWorker] BLE Key timeout : 37 -747470 [D][BadBleWorker] line:DELAY 1000 -747473 [D][BtGap] RSSI: -65 -747475 [I][BadBleWorker] BLE Key timeout : 37 -747527 [I][SavedStruct] Loading "/int/.desktop.settings" -747631 [I][SavedStruct] Loading "/int/.desktop.settings" -747727 [I][SavedStruct] Loading "/int/.desktop.settings" -747927 [I][SavedStruct] Loading "/int/.desktop.settings" -747954 [I][SavedStruct] Loading "/int/.desktop.settings" -747972 [I][SavedStruct] Loading "/int/.desktop.settings" -748127 [I][SavedStruct] Loading "/int/.desktop.settings" -748297 [I][SavedStruct] Loading "/int/.desktop.settings" -748327 [I][SavedStruct] Loading "/int/.desktop.settings" -748454 [I][SavedStruct] Loading "/int/.desktop.settings" -748477 [D][BadBleWorker] line:GUI SPACE -748479 [I][BadBleWorker] Special key pressed 82c - -748520 [D][BtGap] RSSI: -77 -748523 [I][BadBleWorker] BLE Key timeout : 33 -748531 [D][BadBleWorker] line:DELAY 500 -748535 [D][BtGap] RSSI: -77 -748537 [I][BadBleWorker] BLE Key timeout : 33 -748543 [I][SavedStruct] Loading "/int/.desktop.settings" -748630 [I][SavedStruct] Loading "/int/.desktop.settings" -748727 [I][SavedStruct] Loading "/int/.desktop.settings" -748927 [I][SavedStruct] Loading "/int/.desktop.settings" -748954 [I][SavedStruct] Loading "/int/.desktop.settings" -748972 [I][SavedStruct] Loading "/int/.desktop.settings" -749041 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -749127 [I][SavedStruct] Loading "/int/.desktop.settings" -749296 [I][SavedStruct] Loading "/int/.desktop.settings" -749327 [I][SavedStruct] Loading "/int/.desktop.settings" -749454 [I][SavedStruct] Loading "/int/.desktop.settings" -749527 [I][SavedStruct] Loading "/int/.desktop.settings" -749629 [I][SavedStruct] Loading "/int/.desktop.settings" -749727 [I][SavedStruct] Loading "/int/.desktop.settings" -749927 [I][SavedStruct] Loading "/int/.desktop.settings" -749954 [I][SavedStruct] Loading "/int/.desktop.settings" -749972 [I][SavedStruct] Loading "/int/.desktop.settings" -750127 [I][SavedStruct] Loading "/int/.desktop.settings" -750295 [I][SavedStruct] Loading "/int/.desktop.settings" -750327 [I][SavedStruct] Loading "/int/.desktop.settings" -750454 [I][SavedStruct] Loading "/int/.desktop.settings" -750479 [D][BtGap] RSSI: -76 -750481 [I][BadBleWorker] BLE Key timeout : 33 -750484 [D][BadBleWorker] line:DELAY 200 -750487 [D][BtGap] RSSI: -76 -750489 [I][BadBleWorker] BLE Key timeout : 33 -750527 [I][SavedStruct] Loading "/int/.desktop.settings" -750628 [I][SavedStruct] Loading "/int/.desktop.settings" -750692 [D][BadBleWorker] line:ENTER -750694 [I][BadBleWorker] Special key pressed 28 - -750727 [I][SavedStruct] Loading "/int/.desktop.settings" -750733 [D][BtGap] RSSI: -63 -750735 [I][BadBleWorker] BLE Key timeout : 37 -750738 [D][BadBleWorker] line:GUI SPACE -750740 [I][BadBleWorker] Special key pressed 82c - -750782 [D][BtGap] RSSI: -62 -750784 [I][BadBleWorker] BLE Key timeout : 37 -750788 [D][BadBleWorker] line:DELAY 500 -750791 [D][BtGap] RSSI: -62 -750793 [I][BadBleWorker] BLE Key timeout : 37 -750927 [I][SavedStruct] Loading "/int/.desktop.settings" -750954 [I][SavedStruct] Loading "/int/.desktop.settings" -750972 [I][SavedStruct] Loading "/int/.desktop.settings" -751127 [I][SavedStruct] Loading "/int/.desktop.settings" -751294 [I][SavedStruct] Loading "/int/.desktop.settings" -751304 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -751327 [I][SavedStruct] Loading "/int/.desktop.settings" -751454 [I][SavedStruct] Loading "/int/.desktop.settings" -751527 [I][SavedStruct] Loading "/int/.desktop.settings" -751627 [I][SavedStruct] Loading "/int/.desktop.settings" -751727 [I][SavedStruct] Loading "/int/.desktop.settings" -751927 [I][SavedStruct] Loading "/int/.desktop.settings" -751954 [I][SavedStruct] Loading "/int/.desktop.settings" -751972 [I][SavedStruct] Loading "/int/.desktop.settings" -752127 [I][SavedStruct] Loading "/int/.desktop.settings" -752293 [I][SavedStruct] Loading "/int/.desktop.settings" -752327 [I][SavedStruct] Loading "/int/.desktop.settings" -752454 [I][SavedStruct] Loading "/int/.desktop.settings" -752527 [I][SavedStruct] Loading "/int/.desktop.settings" -752626 [I][SavedStruct] Loading "/int/.desktop.settings" -752727 [I][SavedStruct] Loading "/int/.desktop.settings" -752908 [D][BtGap] RSSI: -54 -752910 [I][BadBleWorker] BLE Key timeout : 37 -752914 [D][BadBleWorker] line:DELAY 200 -752917 [D][BtGap] RSSI: -54 -752919 [I][BadBleWorker] BLE Key timeout : 37 -752927 [I][SavedStruct] Loading "/int/.desktop.settings" -752954 [I][SavedStruct] Loading "/int/.desktop.settings" -752972 [I][SavedStruct] Loading "/int/.desktop.settings" -753122 [D][BadBleWorker] line:ENTER -753124 [I][BadBleWorker] Special key pressed 28 - -753127 [I][SavedStruct] Loading "/int/.desktop.settings" -753166 [D][BtGap] RSSI: -54 -753168 [I][BadBleWorker] BLE Key timeout : 37 -753172 [D][BadBleWorker] line:GUI SPACE -753174 [I][BadBleWorker] Special key pressed 82c - -753215 [D][BtGap] RSSI: -55 -753217 [I][BadBleWorker] BLE Key timeout : 37 -753220 [D][BadBleWorker] line:DELAY 500 -753224 [D][BtGap] RSSI: -55 -753226 [I][BadBleWorker] BLE Key timeout : 37 -753292 [I][SavedStruct] Loading "/int/.desktop.settings" -753327 [I][SavedStruct] Loading "/int/.desktop.settings" -753527 [I][SavedStruct] Loading "/int/.desktop.settings" -753625 [I][SavedStruct] Loading "/int/.desktop.settings" -753727 [I][SavedStruct] Loading "/int/.desktop.settings" -753927 [I][SavedStruct] Loading "/int/.desktop.settings" -753958 [I][SavedStruct] Loading "/int/.desktop.settings" -753998 [I][SavedStruct] Loading "/int/.desktop.settings" -754127 [I][SavedStruct] Loading "/int/.desktop.settings" -754146 [I][BtGap] Stop advertising -754149 [D][BtGap] terminate success -754152 [E][BtGap] set_non_discoverable failed 12 -754156 [I][SavedStruct] Loading "/int/.desktop.settings" -754275 [I][BtGap] Disconnect from client. Reason: 16 -754291 [I][SavedStruct] Loading "/int/.desktop.settings" -754327 [I][SavedStruct] Loading "/int/.desktop.settings" -754356 [I][SavedStruct] Loading "/int/.bt.settings" -754370 [I][SavedStruct] Loading "/int/.bt.keys" -754380 [I][FuriHalBt] Disconnect and stop advertising -754382 [I][FuriHalBt] Stop current profile services -754393 [I][FuriHalBt] Stop BLE related RTOS threads -754417 [I][FuriHalBt] Reset SHCI -754527 [I][SavedStruct] Loading "/int/.desktop.settings" -754531 [I][FuriHalBt] Start BT initialization -754538 [I][Core2] Core2 started -754541 [I][Core2] C2 boot completed, mode: Stack -754544 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -754547 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -754554 [I][Core2] Radio stack started -754559 [I][Core2] Flash activity control switched to SEM7 -754563 [I][BtGap] Advertising name: Keyboard -754567 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -754585 [D][BtBatterySvc] Updating power state characteristic -754591 [I][BtSrv] Bt App started -754592 [I][BtGap] Start advertising -754596 [I][BadBleWorker] End -754599 [I][SavedStruct] Loading "/int/.desktop.settings" -754630 [I][SavedStruct] Loading "/int/.desktop.settings" -754634 [D][BrowserWorker] Start -754661 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: 4 -754664 [D][BrowserWorker] Load offset: 0 cnt: 50 - - _.-------.._ -, - .-"```"--..,,_/ /`-, -, \ - .:" /:/ /'\ \ ,_..., `. | | - / ,----/:/ /`\ _\~`_-"` _; - ' / /`"""'\ \ \.~`_-' ,-"'/ - | | | 0 | | .-' ,/` / - | ,..\ \ ,.-"` ,/` / - ; : `/`""\` ,/--==,/-----, - | `-...| -.___-Z:_______J...---; - : ` _-' - _L_ _ ___ ___ ___ ___ ____--"`___ _ ___ -| __|| | |_ _|| _ \| _ \| __|| _ \ / __|| | |_ _| -| _| | |__ | | | _/| _/| _| | / | (__ | |__ | | -|_| |____||___||_| |_| |___||_|_\ \___||____||___| - -Welcome to Flipper Zero Command Line Interface! -Read Manual https://docs.flipperzero.one - -Firmware version: dev 0.74.3 (XFW-0040 built on 26-01-2023) - ->: log -Press CTRL+C to stop... -988327 [I][SavedStruct] Loading "/int/.desktop.settings" -988390 [I][SavedStruct] Loading "/int/.desktop.settings" -988527 [I][SavedStruct] Loading "/int/.desktop.settings" -988555 [I][SavedStruct] Loading "/int/.desktop.settings" -988723 [I][SavedStruct] Loading "/int/.desktop.settings" -988742 [I][SavedStruct] Loading "/int/.desktop.settings" -988927 [I][SavedStruct] Loading "/int/.desktop.settings" -989055 [I][SavedStruct] Loading "/int/.desktop.settings" -989074 [I][SavedStruct] Loading "/int/.desktop.settings" -989127 [I][SavedStruct] Loading "/int/.desktop.settings" -989327 [I][SavedStruct] Loading "/int/.desktop.settings" -989389 [I][SavedStruct] Loading "/int/.desktop.settings" -989527 [I][SavedStruct] Loading "/int/.desktop.settings" -989555 [I][SavedStruct] Loading "/int/.desktop.settings" -989722 [I][SavedStruct] Loading "/int/.desktop.settings" -989741 [I][SavedStruct] Loading "/int/.desktop.settings" -989927 [I][SavedStruct] Loading "/int/.desktop.settings" -990055 [I][SavedStruct] Loading "/int/.desktop.settings" -990074 [I][SavedStruct] Loading "/int/.desktop.settings" -990127 [I][SavedStruct] Loading "/int/.desktop.settings" -990327 [I][SavedStruct] Loading "/int/.desktop.settings" -990388 [I][SavedStruct] Loading "/int/.desktop.settings" -990527 [I][SavedStruct] Loading "/int/.desktop.settings" -990558 [I][BtGap] Stop advertising -990561 [D][BtGap] terminate success -990564 [E][BtGap] set_non_discoverable failed 12 -990568 [I][SavedStruct] Loading "/int/.desktop.settings" -990720 [I][BtGap] Disconnect from client. Reason: 16 -990723 [I][SavedStruct] Loading "/int/.desktop.settings" -990743 [I][SavedStruct] Loading "/int/.desktop.settings" -990768 [I][SavedStruct] Loading "/int/.bt.settings" -990782 [I][SavedStruct] Loading "/int/.bt.keys" -990792 [I][FuriHalBt] Disconnect and stop advertising -990794 [I][FuriHalBt] Stop current profile services -990805 [I][FuriHalBt] Stop BLE related RTOS threads -990829 [I][FuriHalBt] Reset SHCI -990927 [I][SavedStruct] Loading "/int/.desktop.settings" -990943 [I][FuriHalBt] Start BT initialization -990949 [I][Core2] Core2 started -990951 [I][Core2] C2 boot completed, mode: Stack -990954 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -990956 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -990960 [I][Core2] Radio stack started -990962 [I][Core2] Flash activity control switched to SEM7 -990964 [I][BtGap] Advertising name: Keyboard -990966 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -990983 [D][BtBatterySvc] Updating power state characteristic -990989 [I][BtSrv] Bt App started -990991 [I][BtGap] Start advertising -990993 [I][BadBleWorker] End -990995 [I][SavedStruct] Loading "/int/.desktop.settings" -991016 [I][SavedStruct] Loading "/int/.desktop.settings" -991020 [D][BrowserWorker] Start -991046 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: 4 -991048 [D][BrowserWorker] Load offset: 0 cnt: 50 -995286 [D][BrowserWorker] End -995288 [I][SavedStruct] Loading "/int/.desktop.settings" -995311 [I][BtGap] Stop advertising -995315 [D][BtGap] set_non_discoverable success -995321 [I][SavedStruct] Loading "/int/.desktop.settings" -995342 [I][SavedStruct] Loading "/int/.desktop.settings" -995360 [I][SavedStruct] Loading "/int/.desktop.settings" -995383 [I][SavedStruct] Loading "/int/.desktop.settings" -995520 [I][FuriHalBt] Disconnect and stop advertising -995522 [I][FuriHalBt] Stop current profile services -995527 [I][SavedStruct] Loading "/int/.desktop.settings" -995539 [I][FuriHalBt] Stop BLE related RTOS threads -995565 [I][FuriHalBt] Reset SHCI -995679 [I][FuriHalBt] Start BT initialization -995684 [I][Core2] Core2 started -995686 [I][Core2] C2 boot completed, mode: Stack -995689 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -995691 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -995695 [I][Core2] Radio stack started -995697 [I][Core2] Flash activity control switched to SEM7 -995699 [I][BtGap] Advertising name: Keyboard -995701 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -995712 [E][BtGap] Message queue get error: -4 -995716 [I][SavedStruct] Loading "/int/.desktop.settings" -995728 [D][BtBatterySvc] Updating power state characteristic -995738 [I][BtGap] Start advertising -995741 [I][SavedStruct] Loading "/int/.bt.settings" -995745 [I][SavedStruct] Loading "/int/.desktop.settings" -995773 [I][SavedStruct] Loading "/ext/apps/Tools/.bt_hid.keys" -995786 [I][FuriHalBt] Disconnect and stop advertising -995789 [I][BtGap] Stop advertising -995791 [D][BtGap] set_non_discoverable success -995794 [I][FuriHalBt] Stop current profile services -995805 [I][FuriHalBt] Stop BLE related RTOS threads -995830 [I][FuriHalBt] Reset SHCI -995927 [I][SavedStruct] Loading "/int/.desktop.settings" -995944 [I][FuriHalBt] Start BT initialization -995949 [I][Core2] Core2 started -995951 [I][Core2] C2 boot completed, mode: Stack -995954 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -995956 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -995960 [I][Core2] Radio stack started -995962 [I][Core2] Flash activity control switched to SEM7 -995964 [I][BtGap] Advertising name: Rumik1 -995966 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -995984 [D][BtBatterySvc] Updating power state characteristic -995993 [I][BtSrv] Bt App started -995994 [I][BtGap] Start advertising -995998 [I][BadBleWorker] Init -996000 [I][SavedStruct] Loading "/int/.desktop.settings" -996023 [I][BadBleWorker] BLE Key timeout : 16 -996027 [I][BtGap] Stop advertising -996030 [D][BtGap] set_non_discoverable success -996034 [I][SavedStruct] Loading "/int/.desktop.settings" -996052 [I][SavedStruct] Loading "/int/.desktop.settings" -996127 [I][SavedStruct] Loading "/int/.desktop.settings" -996234 [I][SavedStruct] Loading "/int/.bt.settings" -996248 [I][SavedStruct] Loading "/int/.bt.keys" -996258 [I][FuriHalBt] Disconnect and stop advertising -996260 [I][FuriHalBt] Stop current profile services -996271 [I][FuriHalBt] Stop BLE related RTOS threads -996296 [I][FuriHalBt] Reset SHCI -996327 [I][SavedStruct] Loading "/int/.desktop.settings" -996382 [I][SavedStruct] Loading "/int/.desktop.settings" -996410 [I][FuriHalBt] Start BT initialization -996415 [I][Core2] Core2 started -996417 [I][Core2] C2 boot completed, mode: Stack -996420 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -996422 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -996426 [I][Core2] Radio stack started -996428 [I][Core2] Flash activity control switched to SEM7 -996430 [I][BtGap] Advertising name: Keyboard -996432 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -996449 [D][BtBatterySvc] Updating power state characteristic -996456 [I][BtSrv] Bt App started -996458 [I][BtGap] Start advertising -996461 [I][BadBleWorker] End -996464 [I][SavedStruct] Loading "/int/.desktop.settings" -996482 [I][SavedStruct] Loading "/int/.desktop.settings" -996485 [D][BrowserWorker] Start -996510 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: 6 -996512 [D][BrowserWorker] Load offset: 0 cnt: 50 -996800 [D][BrowserWorker] Exit to: /any/BadUsb items: 10 idx: -1 -996803 [D][BrowserWorker] Load offset: 0 cnt: 50 -999551 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: -1 -999553 [D][BrowserWorker] Load offset: 0 cnt: 50 -1001657 [D][BrowserWorker] End -1001660 [I][SavedStruct] Loading "/int/.desktop.settings" -1001680 [I][BtGap] Stop advertising -1001685 [D][BtGap] set_non_discoverable success -1001692 [I][SavedStruct] Loading "/int/.desktop.settings" -1001710 [I][SavedStruct] Loading "/int/.desktop.settings" -1001726 [I][SavedStruct] Loading "/int/.desktop.settings" -1001744 [I][SavedStruct] Loading "/int/.desktop.settings" -1001890 [I][FuriHalBt] Disconnect and stop advertising -1001892 [I][FuriHalBt] Stop current profile services -1001902 [I][FuriHalBt] Stop BLE related RTOS threads -1001926 [I][FuriHalBt] Reset SHCI -1001929 [I][SavedStruct] Loading "/int/.desktop.settings" -1002040 [I][FuriHalBt] Start BT initialization -1002044 [I][SavedStruct] Loading "/int/.desktop.settings" -1002046 [I][Core2] Core2 started -1002049 [I][Core2] C2 boot completed, mode: Stack -1002053 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -1002057 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -1002063 [I][Core2] Radio stack started -1002066 [I][Core2] Flash activity control switched to SEM7 -1002070 [I][BtGap] Advertising name: Keyboard -1002074 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -1002095 [D][BtBatterySvc] Updating power state characteristic -1002102 [I][BtGap] Start advertising -1002104 [I][SavedStruct] Loading "/int/.bt.settings" -1002121 [I][SavedStruct] Loading "/ext/apps/Tools/.bt_hid.keys" -1002130 [I][FuriHalBt] Disconnect and stop advertising -1002132 [I][BtGap] Stop advertising -1002136 [D][BtGap] set_non_discoverable success -1002139 [I][SavedStruct] Loading "/int/.desktop.settings" -1002141 [I][FuriHalBt] Stop current profile services -1002158 [I][FuriHalBt] Stop BLE related RTOS threads -1002183 [I][FuriHalBt] Reset SHCI -1002209 [I][SavedStruct] Loading "/int/.desktop.settings" -1002297 [I][FuriHalBt] Start BT initialization -1002302 [I][Core2] Core2 started -1002305 [I][Core2] C2 boot completed, mode: Stack -1002308 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -1002310 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -1002314 [I][Core2] Radio stack started -1002316 [I][Core2] Flash activity control switched to SEM7 -1002318 [I][BtGap] Advertising name: Rumik1 -1002321 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -1002327 [I][SavedStruct] Loading "/int/.desktop.settings" -1002348 [D][BtBatterySvc] Updating power state characteristic -1002357 [I][BtSrv] Bt App started -1002359 [I][BtGap] Start advertising -1002362 [I][BadBleWorker] Init -1002364 [I][SavedStruct] Loading "/int/.desktop.settings" -1002393 [I][BadBleWorker] BLE Key timeout : 16 -1002396 [I][SavedStruct] Loading "/int/.desktop.settings" -1002527 [I][SavedStruct] Loading "/int/.desktop.settings" -1002709 [I][SavedStruct] Loading "/int/.desktop.settings" -1002729 [I][SavedStruct] Loading "/int/.desktop.settings" -1002750 [I][SavedStruct] Loading "/int/.desktop.settings" -1002927 [I][SavedStruct] Loading "/int/.desktop.settings" -1002929 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -1002934 [I][BtGap] Rssi: 315 -1003036 [D][BtGap] Slave security initiated -1003042 [I][SavedStruct] Loading "/int/.desktop.settings" -1003127 [I][SavedStruct] Loading "/int/.desktop.settings" -1003155 [I][BtGap] Pairing complete -1003158 [D][BtGap] RSSI: -55 -1003160 [D][BtBatterySvc] Updating battery level characteristic -1003163 [D][BtGap] RSSI: -55 -1003165 [I][BadBleWorker] BLE Key timeout : 37 -1003209 [I][SavedStruct] Loading "/int/.desktop.settings" -1003327 [I][SavedStruct] Loading "/int/.desktop.settings" -1003331 [I][BtGap] Rx MTU size: 414 -1003375 [I][SavedStruct] Loading "/int/.desktop.settings" -1003527 [I][SavedStruct] Loading "/int/.desktop.settings" -1003708 [I][SavedStruct] Loading "/int/.desktop.settings" -1003727 [I][SavedStruct] Loading "/int/.desktop.settings" -1003746 [I][SavedStruct] Loading "/int/.desktop.settings" -1003894 [I][BtGap] Connection parameters event complete -1003896 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -1003899 [W][BtGap] Unsupported connection interval. Request connection parameters update -1003903 [I][BtGap] Rssi: 314 -1003927 [I][SavedStruct] Loading "/int/.desktop.settings" -1003933 [D][BtGap] Connection parameters accepted -1004041 [I][SavedStruct] Loading "/int/.desktop.settings" -1004095 [I][BtGap] Connection parameters event complete -1004097 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -1004100 [I][BtGap] Rssi: 317 -1004127 [I][SavedStruct] Loading "/int/.desktop.settings" -1004225 [I][SavedStruct] Loading "/int/.desktop.settings" -1004327 [I][SavedStruct] Loading "/int/.desktop.settings" -1004374 [I][SavedStruct] Loading "/int/.desktop.settings" -1004527 [I][SavedStruct] Loading "/int/.desktop.settings" -1004707 [I][SavedStruct] Loading "/int/.desktop.settings" -1004726 [I][SavedStruct] Loading "/int/.desktop.settings" -1004745 [I][SavedStruct] Loading "/int/.desktop.settings" -1004927 [I][SavedStruct] Loading "/int/.desktop.settings" -1005040 [I][SavedStruct] Loading "/int/.desktop.settings" -1005127 [I][SavedStruct] Loading "/int/.desktop.settings" -1005225 [I][SavedStruct] Loading "/int/.desktop.settings" -1005327 [I][SavedStruct] Loading "/int/.desktop.settings" -1005373 [I][SavedStruct] Loading "/int/.desktop.settings" -1005527 [I][SavedStruct] Loading "/int/.desktop.settings" -1005706 [I][SavedStruct] Loading "/int/.desktop.settings" -1005727 [I][SavedStruct] Loading "/int/.desktop.settings" -1005800 [D][DolphinState] icounter 1325, butthurt 0 -1005803 [D][BtGap] RSSI: -57 -1005805 [I][BadBleWorker] BLE Key timeout : 37 -1005809 [D][BadBleWorker] line:REM Troll scrip to open vx-underground on an iphone -1005812 [D][BtGap] RSSI: -57 -1005814 [I][BadBleWorker] BLE Key timeout : 37 -1005817 [D][BadBleWorker] line:DELAY 1000 -1005820 [D][BtGap] RSSI: -57 -1005822 [I][BadBleWorker] BLE Key timeout : 37 -1005927 [I][SavedStruct] Loading "/int/.desktop.settings" -1006039 [I][SavedStruct] Loading "/int/.desktop.settings" -1006127 [I][SavedStruct] Loading "/int/.desktop.settings" -1006301 [I][SavedStruct] Loading "/int/.desktop.settings" -1006327 [I][SavedStruct] Loading "/int/.desktop.settings" -1006372 [I][SavedStruct] Loading "/int/.desktop.settings" -1006527 [I][SavedStruct] Loading "/int/.desktop.settings" -1006705 [I][SavedStruct] Loading "/int/.desktop.settings" -1006727 [I][SavedStruct] Loading "/int/.desktop.settings" -1006801 [I][SavedStruct] Loading "/int/.desktop.settings" -1006824 [D][BadBleWorker] line:GUI SPACE -1006826 [I][BadBleWorker] Special key pressed 82c - -1006867 [D][BtGap] RSSI: -62 -1006869 [I][BadBleWorker] BLE Key timeout : 37 -1006873 [D][BadBleWorker] line:DELAY 500 -1006875 [D][BtGap] RSSI: -62 -1006877 [I][BadBleWorker] BLE Key timeout : 37 -1006927 [I][SavedStruct] Loading "/int/.desktop.settings" -1007039 [I][SavedStruct] Loading "/int/.desktop.settings" -1007127 [I][SavedStruct] Loading "/int/.desktop.settings" -1007301 [I][SavedStruct] Loading "/int/.desktop.settings" -1007327 [I][SavedStruct] Loading "/int/.desktop.settings" -1007371 [I][SavedStruct] Loading "/int/.desktop.settings" -1007388 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -1007527 [I][SavedStruct] Loading "/int/.desktop.settings" -1007704 [I][SavedStruct] Loading "/int/.desktop.settings" -1007727 [I][SavedStruct] Loading "/int/.desktop.settings" -1007801 [I][SavedStruct] Loading "/int/.desktop.settings" -1007927 [I][SavedStruct] Loading "/int/.desktop.settings" -1008037 [I][SavedStruct] Loading "/int/.desktop.settings" -1008127 [I][SavedStruct] Loading "/int/.desktop.settings" -1008301 [I][SavedStruct] Loading "/int/.desktop.settings" -1008327 [I][SavedStruct] Loading "/int/.desktop.settings" -1008370 [I][SavedStruct] Loading "/int/.desktop.settings" -1008527 [I][SavedStruct] Loading "/int/.desktop.settings" -1008703 [I][SavedStruct] Loading "/int/.desktop.settings" -1008727 [I][SavedStruct] Loading "/int/.desktop.settings" -1008801 [I][SavedStruct] Loading "/int/.desktop.settings" -1008927 [I][SavedStruct] Loading "/int/.desktop.settings" -1008996 [D][BtGap] RSSI: -79 -1008997 [I][BadBleWorker] BLE Key timeout : 33 -1008999 [D][BadBleWorker] line:DELAY 200 -1009001 [D][BtGap] RSSI: -74 -1009004 [I][BadBleWorker] BLE Key timeout : 33 -1009036 [I][SavedStruct] Loading "/int/.desktop.settings" -1009127 [I][SavedStruct] Loading "/int/.desktop.settings" -1009207 [D][BadBleWorker] line:ENTER -1009209 [I][BadBleWorker] Special key pressed 28 - -1009246 [D][BtGap] RSSI: -79 -1009248 [I][BadBleWorker] BLE Key timeout : 33 -1009252 [D][BadBleWorker] line:GUI SPACE -1009254 [I][BadBleWorker] Special key pressed 82c - -1009291 [D][BtGap] RSSI: -75 -1009293 [I][BadBleWorker] BLE Key timeout : 33 -1009297 [D][BadBleWorker] line:DELAY 500 -1009299 [D][BtGap] RSSI: -75 -1009302 [I][BadBleWorker] BLE Key timeout : 33 -1009305 [I][SavedStruct] Loading "/int/.desktop.settings" -1009327 [I][SavedStruct] Loading "/int/.desktop.settings" -1009369 [I][SavedStruct] Loading "/int/.desktop.settings" -1009527 [I][SavedStruct] Loading "/int/.desktop.settings" -1009702 [I][SavedStruct] Loading "/int/.desktop.settings" -1009727 [I][SavedStruct] Loading "/int/.desktop.settings" -1009801 [I][SavedStruct] Loading "/int/.desktop.settings" -1009813 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -1009927 [I][SavedStruct] Loading "/int/.desktop.settings" -1010035 [I][SavedStruct] Loading "/int/.desktop.settings" -1010127 [I][SavedStruct] Loading "/int/.desktop.settings" -1010301 [I][SavedStruct] Loading "/int/.desktop.settings" -1010327 [I][SavedStruct] Loading "/int/.desktop.settings" -1010368 [I][SavedStruct] Loading "/int/.desktop.settings" -1010527 [I][SavedStruct] Loading "/int/.desktop.settings" -1010701 [I][SavedStruct] Loading "/int/.desktop.settings" -1010727 [I][SavedStruct] Loading "/int/.desktop.settings" -1010801 [I][SavedStruct] Loading "/int/.desktop.settings" -1010927 [I][SavedStruct] Loading "/int/.desktop.settings" -1011034 [I][SavedStruct] Loading "/int/.desktop.settings" -1011127 [I][SavedStruct] Loading "/int/.desktop.settings" -1011254 [D][BtGap] RSSI: -85 -1011256 [I][BadBleWorker] BLE Key timeout : 33 -1011260 [D][BadBleWorker] line:DELAY 200 -1011262 [D][BtGap] RSSI: -85 -1011264 [I][BadBleWorker] BLE Key timeout : 33 -1011301 [I][SavedStruct] Loading "/int/.desktop.settings" -1011327 [I][SavedStruct] Loading "/int/.desktop.settings" -1011367 [I][SavedStruct] Loading "/int/.desktop.settings" -1011466 [D][BadBleWorker] line:ENTER -1011468 [I][BadBleWorker] Special key pressed 28 - -1011505 [D][BtGap] RSSI: -85 -1011507 [I][BadBleWorker] BLE Key timeout : 33 -1011511 [D][BadBleWorker] line:GUI SPACE -1011513 [I][BadBleWorker] Special key pressed 82c - -1011527 [I][SavedStruct] Loading "/int/.desktop.settings" -1011549 [D][BtGap] RSSI: -85 -1011551 [I][BadBleWorker] BLE Key timeout : 33 -1011555 [D][BadBleWorker] line:DELAY 500 -1011558 [D][BtGap] RSSI: -85 -1011560 [I][BadBleWorker] BLE Key timeout : 33 -1011700 [I][SavedStruct] Loading "/int/.desktop.settings" -1011727 [I][SavedStruct] Loading "/int/.desktop.settings" -1011801 [I][SavedStruct] Loading "/int/.desktop.settings" -1011927 [I][SavedStruct] Loading "/int/.desktop.settings" -1012033 [I][SavedStruct] Loading "/int/.desktop.settings" -1012062 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -1012127 [I][SavedStruct] Loading "/int/.desktop.settings" -1012301 [I][SavedStruct] Loading "/int/.desktop.settings" -1012327 [I][SavedStruct] Loading "/int/.desktop.settings" -1012366 [I][SavedStruct] Loading "/int/.desktop.settings" -1012527 [I][SavedStruct] Loading "/int/.desktop.settings" -1012699 [I][SavedStruct] Loading "/int/.desktop.settings" -1012727 [I][SavedStruct] Loading "/int/.desktop.settings" -1012801 [I][SavedStruct] Loading "/int/.desktop.settings" -1012927 [I][SavedStruct] Loading "/int/.desktop.settings" -1013032 [I][SavedStruct] Loading "/int/.desktop.settings" -1013127 [I][SavedStruct] Loading "/int/.desktop.settings" -1013301 [I][SavedStruct] Loading "/int/.desktop.settings" -1013327 [I][SavedStruct] Loading "/int/.desktop.settings" -1013365 [I][SavedStruct] Loading "/int/.desktop.settings" -1013505 [D][BtGap] RSSI: -91 -1013507 [I][BadBleWorker] BLE Key timeout : 16 -1013511 [D][BadBleWorker] line:DELAY 200 -1013513 [D][BtGap] RSSI: -91 -1013515 [I][BadBleWorker] BLE Key timeout : 16 -1013527 [I][SavedStruct] Loading "/int/.desktop.settings" -1013698 [I][SavedStruct] Loading "/int/.desktop.settings" -1013717 [D][BadBleWorker] line:ENTER -1013719 [I][BadBleWorker] Special key pressed 28 - -1013727 [I][SavedStruct] Loading "/int/.desktop.settings" -1013741 [D][BtGap] RSSI: -99 -1013743 [I][BadBleWorker] BLE Key timeout : 16 -1013749 [D][BadBleWorker] line:GUI SPACE -1013751 [I][BadBleWorker] Special key pressed 82c - -1013770 [D][BtGap] RSSI: -99 -1013772 [I][BadBleWorker] BLE Key timeout : 16 -1013776 [D][BadBleWorker] line:DELAY 500 -1013778 [D][BtGap] RSSI: -99 -1013780 [I][BadBleWorker] BLE Key timeout : 16 -1013801 [I][SavedStruct] Loading "/int/.desktop.settings" -1013927 [I][SavedStruct] Loading "/int/.desktop.settings" -1014031 [I][SavedStruct] Loading "/int/.desktop.settings" -1014134 [I][SavedStruct] Loading "/int/.desktop.settings" -1014282 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -1014301 [I][SavedStruct] Loading "/int/.desktop.settings" -1014327 [I][SavedStruct] Loading "/int/.desktop.settings" -1014364 [I][SavedStruct] Loading "/int/.desktop.settings" -1014527 [I][SavedStruct] Loading "/int/.desktop.settings" -1014593 [E][BtHid] Failed updating report characteristic: 100 -1014596 [E][BtHid] Failed updating report characteristic: 100 -1014616 [E][BtHid] Failed updating report characteristic: 100 -1014619 [E][BtHid] Failed updating report characteristic: 100 -1014640 [E][BtHid] Failed updating report characteristic: 100 -1014643 [E][BtHid] Failed updating report characteristic: 100 -1014664 [E][BtHid] Failed updating report characteristic: 100 -1014667 [E][BtHid] Failed updating report characteristic: 100 -1014688 [E][BtHid] Failed updating report characteristic: 100 -1014691 [E][BtHid] Failed updating report characteristic: 100 -1014697 [I][SavedStruct] Loading "/int/.desktop.settings" -1014712 [E][BtHid] Failed updating report characteristic: 100 -1014717 [E][BtHid] Failed updating report characteristic: 100 -1014727 [I][SavedStruct] Loading "/int/.desktop.settings" -1014739 [E][BtHid] Failed updating report characteristic: 100 -1014744 [E][BtHid] Failed updating report characteristic: 100 -1014765 [E][BtHid] Failed updating report characteristic: 100 -1014768 [E][BtHid] Failed updating report characteristic: 100 -1014789 [E][BtHid] Failed updating report characteristic: 100 -1014792 [E][BtHid] Failed updating report characteristic: 100 -1014801 [I][SavedStruct] Loading "/int/.desktop.settings" -1014814 [E][BtHid] Failed updating report characteristic: 100 -1014819 [E][BtHid] Failed updating report characteristic: 100 -1014840 [E][BtHid] Failed updating report characteristic: 100 -1014843 [E][BtHid] Failed updating report characteristic: 100 -1014862 [E][BtHid] Failed updating report characteristic: 100 -1014865 [E][BtHid] Failed updating report characteristic: 100 -1014885 [E][BtHid] Failed updating report characteristic: 100 -1014888 [E][BtHid] Failed updating report characteristic: 100 -1014907 [E][BtHid] Failed updating report characteristic: 100 -1014910 [E][BtHid] Failed updating report characteristic: 100 -1014927 [I][SavedStruct] Loading "/int/.desktop.settings" -1014931 [E][BtHid] Failed updating report characteristic: 100 -1014936 [E][BtHid] Failed updating report characteristic: 100 -1014957 [E][BtHid] Failed updating report characteristic: 100 -1014960 [E][BtHid] Failed updating report characteristic: 100 -1014981 [E][BtHid] Failed updating report characteristic: 100 -1014984 [E][BtHid] Failed updating report characteristic: 100 -1015004 [E][BtHid] Failed updating report characteristic: 100 -1015007 [E][BtHid] Failed updating report characteristic: 100 -1015027 [E][BtHid] Failed updating report characteristic: 100 -1015031 [E][BtHid] Failed updating report characteristic: 100 -1015033 [I][SavedStruct] Loading "/int/.desktop.settings" -1015051 [E][BtHid] Failed updating report characteristic: 100 -1015055 [E][BtHid] Failed updating report characteristic: 100 -1015075 [E][BtHid] Failed updating report characteristic: 100 -1015078 [E][BtHid] Failed updating report characteristic: 100 -1015099 [E][BtHid] Failed updating report characteristic: 100 -1015102 [E][BtHid] Failed updating report characteristic: 100 -1015121 [E][BtHid] Failed updating report characteristic: 100 -1015124 [E][BtHid] Failed updating report characteristic: 100 -1015129 [I][SavedStruct] Loading "/int/.desktop.settings" -1015146 [E][BtHid] Failed updating report characteristic: 100 -1015153 [E][BtHid] Failed updating report characteristic: 100 -1015174 [E][BtHid] Failed updating report characteristic: 100 -1015177 [D][BtGap] RSSI: -99 -1015179 [I][BadBleWorker] BLE Key timeout : 16 -1015181 [D][BadBleWorker] line:DELAY 200 -1015183 [D][BtGap] RSSI: -99 -1015184 [I][BadBleWorker] BLE Key timeout : 16 -1015301 [I][SavedStruct] Loading "/int/.desktop.settings" -1015327 [I][SavedStruct] Loading "/int/.desktop.settings" -1015363 [I][SavedStruct] Loading "/int/.desktop.settings" -1015386 [D][BadBleWorker] line:ENTER -1015388 [I][BadBleWorker] Special key pressed 28 - -1015391 [E][BtHid] Failed updating report characteristic: 100 -1015410 [D][BtGap] RSSI: -89 -1015412 [I][BadBleWorker] BLE Key timeout : 16 -1015416 [D][BtGap] RSSI: -89 -1015418 [I][BadBleWorker] BLE Key timeout : 16 -1015527 [I][SavedStruct] Loading "/int/.desktop.settings" -1015696 [I][SavedStruct] Loading "/int/.desktop.settings" -1015727 [I][SavedStruct] Loading "/int/.desktop.settings" -1015801 [I][SavedStruct] Loading "/int/.desktop.settings" -1015927 [I][SavedStruct] Loading "/int/.desktop.settings" -1016029 [I][SavedStruct] Loading "/int/.desktop.settings" -1016127 [I][SavedStruct] Loading "/int/.desktop.settings" -1016301 [I][SavedStruct] Loading "/int/.desktop.settings" -1016327 [I][SavedStruct] Loading "/int/.desktop.settings" -1016362 [I][SavedStruct] Loading "/int/.desktop.settings" -1016527 [I][SavedStruct] Loading "/int/.desktop.settings" -1016695 [I][SavedStruct] Loading "/int/.desktop.settings" -1016727 [I][SavedStruct] Loading "/int/.desktop.settings" -1016801 [I][SavedStruct] Loading "/int/.desktop.settings" -1016927 [I][SavedStruct] Loading "/int/.desktop.settings" -1017028 [I][SavedStruct] Loading "/int/.desktop.settings" -1017127 [I][SavedStruct] Loading "/int/.desktop.settings" -1017301 [I][SavedStruct] Loading "/int/.desktop.settings" -1017327 [I][SavedStruct] Loading "/int/.desktop.settings" -1017361 [I][SavedStruct] Loading "/int/.desktop.settings" -1017527 [I][SavedStruct] Loading "/int/.desktop.settings" -1017694 [I][SavedStruct] Loading "/int/.desktop.settings" -1017727 [I][SavedStruct] Loading "/int/.desktop.settings" -1017801 [I][SavedStruct] Loading "/int/.desktop.settings" -1017927 [I][SavedStruct] Loading "/int/.desktop.settings" -1018027 [I][SavedStruct] Loading "/int/.desktop.settings" -1018127 [I][SavedStruct] Loading "/int/.desktop.settings" -1018301 [I][SavedStruct] Loading "/int/.desktop.settings" -1018327 [I][SavedStruct] Loading "/int/.desktop.settings" -1018360 [I][SavedStruct] Loading "/int/.desktop.settings" -1018527 [I][SavedStruct] Loading "/int/.desktop.settings" -1018693 [I][SavedStruct] Loading "/int/.desktop.settings" -1018727 [I][SavedStruct] Loading "/int/.desktop.settings" -1018801 [I][SavedStruct] Loading "/int/.desktop.settings" -1018927 [I][SavedStruct] Loading "/int/.desktop.settings" -1019026 [I][SavedStruct] Loading "/int/.desktop.settings" -1019127 [I][SavedStruct] Loading "/int/.desktop.settings" -1019301 [I][SavedStruct] Loading "/int/.desktop.settings" -1019327 [I][SavedStruct] Loading "/int/.desktop.settings" -1019359 [I][SavedStruct] Loading "/int/.desktop.settings" -1019527 [I][SavedStruct] Loading "/int/.desktop.settings" -1019692 [I][SavedStruct] Loading "/int/.desktop.settings" -1019727 [I][SavedStruct] Loading "/int/.desktop.settings" -1019801 [I][SavedStruct] Loading "/int/.desktop.settings" -1019927 [I][SavedStruct] Loading "/int/.desktop.settings" -1020025 [I][SavedStruct] Loading "/int/.desktop.settings" -1020127 [I][SavedStruct] Loading "/int/.desktop.settings" -1020301 [I][SavedStruct] Loading "/int/.desktop.settings" -1020327 [I][SavedStruct] Loading "/int/.desktop.settings" -1020358 [I][SavedStruct] Loading "/int/.desktop.settings" -1020527 [I][SavedStruct] Loading "/int/.desktop.settings" -1020691 [I][SavedStruct] Loading "/int/.desktop.settings" -1020727 [I][SavedStruct] Loading "/int/.desktop.settings" -1020801 [I][SavedStruct] Loading "/int/.desktop.settings" -1020927 [I][SavedStruct] Loading "/int/.desktop.settings" -1021024 [I][SavedStruct] Loading "/int/.desktop.settings" -1021127 [I][SavedStruct] Loading "/int/.desktop.settings" -1021301 [I][SavedStruct] Loading "/int/.desktop.settings" -1021327 [I][SavedStruct] Loading "/int/.desktop.settings" -1021357 [I][SavedStruct] Loading "/int/.desktop.settings" -1021527 [I][SavedStruct] Loading "/int/.desktop.settings" -1021690 [I][SavedStruct] Loading "/int/.desktop.settings" -1021727 [I][SavedStruct] Loading "/int/.desktop.settings" -1021801 [I][SavedStruct] Loading "/int/.desktop.settings" -1021927 [I][SavedStruct] Loading "/int/.desktop.settings" -1022023 [I][SavedStruct] Loading "/int/.desktop.settings" -1022127 [I][SavedStruct] Loading "/int/.desktop.settings" -1022301 [I][SavedStruct] Loading "/int/.desktop.settings" -1022327 [I][SavedStruct] Loading "/int/.desktop.settings" -1022356 [I][SavedStruct] Loading "/int/.desktop.settings" - ->: - _.-------.._ -, - .-"```"--..,,_/ /`-, -, \ - .:" /:/ /'\ \ ,_..., `. | | - / ,----/:/ /`\ _\~`_-"` _; - ' / /`"""'\ \ \.~`_-' ,-"'/ - | | | 0 | | .-' ,/` / - | ,..\ \ ,.-"` ,/` / - ; : `/`""\` ,/--==,/-----, - | `-...| -.___-Z:_______J...---; - : ` _-' - _L_ _ ___ ___ ___ ___ ____--"`___ _ ___ -| __|| | |_ _|| _ \| _ \| __|| _ \ / __|| | |_ _| -| _| | |__ | | | _/| _/| _| | / | (__ | |__ | | -|_| |____||___||_| |_| |___||_|_\ \___||____||___| - -Welcome to Flipper Zero Command Line Interface! -Read Manual https://docs.flipperzero.one - -Firmware version: dev 0.74.3 (XFW-0040 built on 26-01-2023) - ->: log -Press CTRL+C to stop... -27492 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: -1 -27494 [D][BrowserWorker] Load offset: 0 cnt: 50 -28939 [D][BrowserWorker] End -28952 [I][BtGap] Stop advertising -28956 [D][BtGap] set_non_discoverable success -28970 [I][SavedStruct] Loading "/int/.desktop.settings" -29075 [I][SavedStruct] Loading "/int/.desktop.settings" -29162 [I][FuriHalBt] Disconnect and stop advertising -29164 [I][FuriHalBt] Stop current profile services -29173 [I][FuriHalBt] Stop BLE related RTOS threads -29197 [I][FuriHalBt] Reset SHCI -29275 [I][SavedStruct] Loading "/int/.desktop.settings" -29311 [I][FuriHalBt] Start BT initialization -29316 [I][Core2] Core2 started -29318 [I][Core2] C2 boot completed, mode: Stack -29321 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -29323 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -29327 [I][Core2] Radio stack started -29330 [I][Core2] Flash activity control switched to SEM7 -29332 [I][BtGap] Advertising name: Keyboard -29334 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -29350 [D][BtBatterySvc] Updating power state characteristic -29356 [I][BtGap] Start advertising -29358 [I][SavedStruct] Loading "/int/.bt.settings" -29376 [I][SavedStruct] Loading "/ext/apps/Tools/.bt_hid.keys" -29385 [I][FuriHalBt] Disconnect and stop advertising -29387 [I][BtGap] Stop advertising -29390 [D][BtGap] set_non_discoverable success -29392 [I][FuriHalBt] Stop current profile services -29402 [I][FuriHalBt] Stop BLE related RTOS threads -29427 [I][FuriHalBt] Reset SHCI -29466 [I][SavedStruct] Loading "/int/.desktop.settings" -29482 [I][SavedStruct] Loading "/int/.desktop.settings" -29541 [I][FuriHalBt] Start BT initialization -29546 [I][Core2] Core2 started -29548 [I][Core2] C2 boot completed, mode: Stack -29551 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -29553 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -29557 [I][Core2] Radio stack started -29560 [I][Core2] Flash activity control switched to SEM7 -29562 [I][BtGap] Advertising name: Rumik1 -29565 [I][BtGap] MAC @ : 6C:7A:D9:AC:57:72 -29582 [D][BtBatterySvc] Updating power state characteristic -29591 [I][BtSrv] Bt App started -29593 [I][BtGap] Start advertising -29596 [I][BadBleWorker] Init -29598 [I][SavedStruct] Loading "/int/.desktop.settings" -29625 [I][BadBleWorker] BLE Key timeout : 16 -29675 [I][SavedStruct] Loading "/int/.desktop.settings" -29875 [I][SavedStruct] Loading "/int/.desktop.settings" -29966 [I][SavedStruct] Loading "/int/.desktop.settings" -30075 [I][SavedStruct] Loading "/int/.desktop.settings" -30275 [I][SavedStruct] Loading "/int/.desktop.settings" -30466 [I][SavedStruct] Loading "/int/.desktop.settings" -30486 [I][SavedStruct] Loading "/int/.desktop.settings" -30675 [I][SavedStruct] Loading "/int/.desktop.settings" -30726 [I][BtGap] Connection parameters: Connection Interval: 24 (30 ms), Slave Latency: 0, Supervision Timeout: 72 -30839 [D][BtGap] Slave security initiated -30875 [I][SavedStruct] Loading "/int/.desktop.settings" -30966 [I][SavedStruct] Loading "/int/.desktop.settings" -31018 [I][BtGap] Pairing complete -31021 [D][BtGap] RSSI: -47 -31023 [D][BtBatterySvc] Updating battery level characteristic -31026 [D][BtGap] RSSI: -47 -31028 [I][BadBleWorker] BLE Key timeout : 33 -31075 [I][SavedStruct] Loading "/int/.desktop.settings" -31136 [I][BtGap] Rx MTU size: 414 -31275 [I][SavedStruct] Loading "/int/.desktop.settings" -31466 [I][SavedStruct] Loading "/int/.desktop.settings" -31484 [I][SavedStruct] Loading "/int/.desktop.settings" -31675 [I][SavedStruct] Loading "/int/.desktop.settings" -31702 [I][BtGap] Connection parameters event complete -31704 [I][BtGap] Connection parameters: Connection Interval: 12 (15 ms), Slave Latency: 4, Supervision Timeout: 100 -31706 [W][BtGap] Unsupported connection interval. Request connection parameters update -31739 [D][BtGap] Connection parameters accepted -31875 [I][SavedStruct] Loading "/int/.desktop.settings" -31902 [I][BtGap] Connection parameters event complete -31906 [I][BtGap] Connection parameters: Connection Interval: 36 (45 ms), Slave Latency: 4, Supervision Timeout: 100 -31968 [I][SavedStruct] Loading "/int/.desktop.settings" -32075 [I][SavedStruct] Loading "/int/.desktop.settings" -32275 [I][SavedStruct] Loading "/int/.desktop.settings" -32466 [I][SavedStruct] Loading "/int/.desktop.settings" -32484 [I][SavedStruct] Loading "/int/.desktop.settings" -32675 [I][SavedStruct] Loading "/int/.desktop.settings" -32875 [I][SavedStruct] Loading "/int/.desktop.settings" -32966 [I][SavedStruct] Loading "/int/.desktop.settings" -33075 [I][SavedStruct] Loading "/int/.desktop.settings" -33275 [I][SavedStruct] Loading "/int/.desktop.settings" -33466 [I][SavedStruct] Loading "/int/.desktop.settings" -33484 [I][SavedStruct] Loading "/int/.desktop.settings" -33675 [I][SavedStruct] Loading "/int/.desktop.settings" -33875 [I][SavedStruct] Loading "/int/.desktop.settings" -33966 [I][SavedStruct] Loading "/int/.desktop.settings" -34075 [I][SavedStruct] Loading "/int/.desktop.settings" -34275 [I][SavedStruct] Loading "/int/.desktop.settings" -34466 [I][SavedStruct] Loading "/int/.desktop.settings" -34484 [I][SavedStruct] Loading "/int/.desktop.settings" -34675 [I][SavedStruct] Loading "/int/.desktop.settings" -34875 [I][SavedStruct] Loading "/int/.desktop.settings" -34966 [I][SavedStruct] Loading "/int/.desktop.settings" -35075 [I][SavedStruct] Loading "/int/.desktop.settings" -35275 [I][SavedStruct] Loading "/int/.desktop.settings" -35359 [D][DolphinState] icounter 1325, butthurt 0 -35362 [D][BtGap] RSSI: -53 -35363 [I][BadBleWorker] BLE Key timeout : 33 -35367 [D][BadBleWorker] line:REM Troll scrip to open vx-underground on an iphone -35370 [D][BtGap] RSSI: -53 -35371 [I][BadBleWorker] BLE Key timeout : 33 -35373 [D][BadBleWorker] line:DELAY 1000 -35375 [D][BtGap] RSSI: -53 -35376 [I][BadBleWorker] BLE Key timeout : 33 -35475 [I][SavedStruct] Loading "/int/.desktop.settings" -35675 [I][SavedStruct] Loading "/int/.desktop.settings" -35860 [I][SavedStruct] Loading "/int/.desktop.settings" -35878 [I][SavedStruct] Loading "/int/.desktop.settings" -36075 [I][SavedStruct] Loading "/int/.desktop.settings" -36275 [I][SavedStruct] Loading "/int/.desktop.settings" -36360 [I][SavedStruct] Loading "/int/.desktop.settings" -36378 [D][BadBleWorker] line:GUI SPACE -36380 [I][BadBleWorker] Special key pressed 82c - -36418 [D][BtGap] RSSI: -57 -36420 [I][BadBleWorker] BLE Key timeout : 33 -36423 [D][BadBleWorker] line:DELAY 500 -36426 [D][BtGap] RSSI: -57 -36428 [I][BadBleWorker] BLE Key timeout : 33 -36475 [I][SavedStruct] Loading "/int/.desktop.settings" -36675 [I][SavedStruct] Loading "/int/.desktop.settings" -36860 [I][SavedStruct] Loading "/int/.desktop.settings" -36878 [I][SavedStruct] Loading "/int/.desktop.settings" -36930 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -37075 [I][SavedStruct] Loading "/int/.desktop.settings" -37275 [I][SavedStruct] Loading "/int/.desktop.settings" -37360 [I][SavedStruct] Loading "/int/.desktop.settings" -37475 [I][SavedStruct] Loading "/int/.desktop.settings" -37675 [I][SavedStruct] Loading "/int/.desktop.settings" -37860 [I][SavedStruct] Loading "/int/.desktop.settings" -37878 [I][SavedStruct] Loading "/int/.desktop.settings" -38075 [I][SavedStruct] Loading "/int/.desktop.settings" -38275 [I][SavedStruct] Loading "/int/.desktop.settings" -38360 [I][SavedStruct] Loading "/int/.desktop.settings" -38370 [D][BtGap] RSSI: -71 -38372 [I][BadBleWorker] BLE Key timeout : 37 -38376 [D][BadBleWorker] line:DELAY 200 -38380 [D][BtGap] RSSI: -74 -38382 [I][BadBleWorker] BLE Key timeout : 37 -38475 [I][SavedStruct] Loading "/int/.desktop.settings" -38586 [D][BadBleWorker] line:ENTER -38588 [I][BadBleWorker] Special key pressed 28 - -38629 [D][BtGap] RSSI: -88 -38631 [I][BadBleWorker] BLE Key timeout : 41 -38633 [D][BadBleWorker] line:GUI SPACE -38635 [I][BadBleWorker] Special key pressed 82c - -38675 [I][SavedStruct] Loading "/int/.desktop.settings" -38682 [D][BtGap] RSSI: -71 -38684 [I][BadBleWorker] BLE Key timeout : 37 -38688 [D][BadBleWorker] line:DELAY 500 -38692 [D][BtGap] RSSI: -71 -38694 [I][BadBleWorker] BLE Key timeout : 37 -38860 [I][SavedStruct] Loading "/int/.desktop.settings" -38878 [I][SavedStruct] Loading "/int/.desktop.settings" -39075 [I][SavedStruct] Loading "/int/.desktop.settings" -39198 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -39275 [I][SavedStruct] Loading "/int/.desktop.settings" -39360 [I][SavedStruct] Loading "/int/.desktop.settings" -39475 [I][SavedStruct] Loading "/int/.desktop.settings" -39675 [I][SavedStruct] Loading "/int/.desktop.settings" -39860 [I][SavedStruct] Loading "/int/.desktop.settings" -39878 [I][SavedStruct] Loading "/int/.desktop.settings" -40086 [I][SavedStruct] Loading "/int/.desktop.settings" -40275 [I][SavedStruct] Loading "/int/.desktop.settings" -40360 [I][SavedStruct] Loading "/int/.desktop.settings" -40475 [I][SavedStruct] Loading "/int/.desktop.settings" -40675 [I][SavedStruct] Loading "/int/.desktop.settings" -40803 [D][BtGap] RSSI: -98 -40805 [I][BadBleWorker] BLE Key timeout : 41 -40809 [D][BadBleWorker] line:DELAY 200 -40812 [D][BtGap] RSSI: -98 -40814 [I][BadBleWorker] BLE Key timeout : 41 -40860 [I][SavedStruct] Loading "/int/.desktop.settings" -40878 [I][SavedStruct] Loading "/int/.desktop.settings" -41017 [D][BadBleWorker] line:ENTER -41019 [I][BadBleWorker] Special key pressed 28 - -41063 [D][BtGap] RSSI: -89 -41065 [I][BadBleWorker] BLE Key timeout : 41 -41068 [D][BadBleWorker] line:GUI SPACE -41070 [I][BadBleWorker] Special key pressed 82c - -41075 [I][SavedStruct] Loading "/int/.desktop.settings" -41115 [D][BtGap] RSSI: -91 -41117 [I][BadBleWorker] BLE Key timeout : 41 -41119 [D][BadBleWorker] line:DELAY 500 -41121 [D][BtGap] RSSI: -91 -41122 [I][BadBleWorker] BLE Key timeout : 41 -41275 [I][SavedStruct] Loading "/int/.desktop.settings" -41360 [I][SavedStruct] Loading "/int/.desktop.settings" -41475 [I][SavedStruct] Loading "/int/.desktop.settings" -41624 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -41675 [I][SavedStruct] Loading "/int/.desktop.settings" -41860 [I][SavedStruct] Loading "/int/.desktop.settings" -41878 [I][SavedStruct] Loading "/int/.desktop.settings" -42075 [I][SavedStruct] Loading "/int/.desktop.settings" -42275 [I][SavedStruct] Loading "/int/.desktop.settings" -42360 [I][SavedStruct] Loading "/int/.desktop.settings" -42475 [I][SavedStruct] Loading "/int/.desktop.settings" -42675 [I][SavedStruct] Loading "/int/.desktop.settings" -42860 [I][SavedStruct] Loading "/int/.desktop.settings" -42878 [I][SavedStruct] Loading "/int/.desktop.settings" -43075 [I][SavedStruct] Loading "/int/.desktop.settings" -43275 [I][SavedStruct] Loading "/int/.desktop.settings" -43360 [I][SavedStruct] Loading "/int/.desktop.settings" -43389 [D][BtGap] RSSI: -85 -43391 [I][BadBleWorker] BLE Key timeout : 41 -43394 [D][BadBleWorker] line:DELAY 200 -43397 [D][BtGap] RSSI: -85 -43399 [I][BadBleWorker] BLE Key timeout : 41 -43475 [I][SavedStruct] Loading "/int/.desktop.settings" -43601 [D][BadBleWorker] line:ENTER -43603 [I][BadBleWorker] Special key pressed 28 - -43647 [D][BtGap] RSSI: -86 -43649 [I][BadBleWorker] BLE Key timeout : 41 -43652 [D][BadBleWorker] line:GUI SPACE -43654 [I][BadBleWorker] Special key pressed 82c - -43675 [I][SavedStruct] Loading "/int/.desktop.settings" -43699 [D][BtGap] RSSI: -91 -43701 [I][BadBleWorker] BLE Key timeout : 41 -43704 [D][BadBleWorker] line:DELAY 500 -43706 [D][BtGap] RSSI: -91 -43708 [I][BadBleWorker] BLE Key timeout : 41 -43860 [I][SavedStruct] Loading "/int/.desktop.settings" -43878 [I][SavedStruct] Loading "/int/.desktop.settings" -44075 [I][SavedStruct] Loading "/int/.desktop.settings" -44211 [D][BadBleWorker] line:STRING https://www.vx=underground.org/index.html -44275 [I][SavedStruct] Loading "/int/.desktop.settings" -44360 [I][SavedStruct] Loading "/int/.desktop.settings" -44475 [I][SavedStruct] Loading "/int/.desktop.settings" -44675 [I][SavedStruct] Loading "/int/.desktop.settings" -44860 [I][SavedStruct] Loading "/int/.desktop.settings" -44878 [I][SavedStruct] Loading "/int/.desktop.settings" -45075 [I][SavedStruct] Loading "/int/.desktop.settings" -45275 [I][SavedStruct] Loading "/int/.desktop.settings" -45360 [I][SavedStruct] Loading "/int/.desktop.settings" -45475 [I][SavedStruct] Loading "/int/.desktop.settings" -45675 [I][SavedStruct] Loading "/int/.desktop.settings" -45860 [I][SavedStruct] Loading "/int/.desktop.settings" -45878 [I][SavedStruct] Loading "/int/.desktop.settings" -45978 [D][BtGap] RSSI: -89 -45980 [I][BadBleWorker] BLE Key timeout : 41 -45983 [D][BadBleWorker] line:DELAY 200 -45986 [D][BtGap] RSSI: -86 -45987 [I][BadBleWorker] BLE Key timeout : 41 -46075 [I][SavedStruct] Loading "/int/.desktop.settings" -46190 [D][BadBleWorker] line:ENTER -46192 [I][BadBleWorker] Special key pressed 28 - -46237 [D][BtGap] RSSI: -97 -46239 [I][BadBleWorker] BLE Key timeout : 41 -46242 [D][BtGap] RSSI: -97 -46244 [I][BadBleWorker] BLE Key timeout : 41 -46275 [I][SavedStruct] Loading "/int/.desktop.settings" -46360 [I][SavedStruct] Loading "/int/.desktop.settings" -46475 [I][SavedStruct] Loading "/int/.desktop.settings" -46675 [I][SavedStruct] Loading "/int/.desktop.settings" -46860 [I][SavedStruct] Loading "/int/.desktop.settings" -46879 [I][SavedStruct] Loading "/int/.desktop.settings" -47075 [I][SavedStruct] Loading "/int/.desktop.settings" -47275 [I][SavedStruct] Loading "/int/.desktop.settings" -47360 [I][SavedStruct] Loading "/int/.desktop.settings" -47475 [I][SavedStruct] Loading "/int/.desktop.settings" -47675 [I][SavedStruct] Loading "/int/.desktop.settings" -47860 [I][SavedStruct] Loading "/int/.desktop.settings" -47879 [I][SavedStruct] Loading "/int/.desktop.settings" -48075 [I][SavedStruct] Loading "/int/.desktop.settings" -48275 [I][SavedStruct] Loading "/int/.desktop.settings" -48360 [I][SavedStruct] Loading "/int/.desktop.settings" -48475 [I][SavedStruct] Loading "/int/.desktop.settings" -48675 [I][SavedStruct] Loading "/int/.desktop.settings" -48860 [I][SavedStruct] Loading "/int/.desktop.settings" -48879 [I][SavedStruct] Loading "/int/.desktop.settings" -49075 [I][SavedStruct] Loading "/int/.desktop.settings" -49275 [I][SavedStruct] Loading "/int/.desktop.settings" -49360 [I][SavedStruct] Loading "/int/.desktop.settings" -49475 [I][SavedStruct] Loading "/int/.desktop.settings" -49675 [I][SavedStruct] Loading "/int/.desktop.settings" -49860 [I][SavedStruct] Loading "/int/.desktop.settings" -49879 [I][SavedStruct] Loading "/int/.desktop.settings" -50075 [I][SavedStruct] Loading "/int/.desktop.settings" -50275 [I][SavedStruct] Loading "/int/.desktop.settings" -50360 [I][SavedStruct] Loading "/int/.desktop.settings" -50475 [I][SavedStruct] Loading "/int/.desktop.settings" -50675 [I][SavedStruct] Loading "/int/.desktop.settings" -50860 [I][SavedStruct] Loading "/int/.desktop.settings" -50879 [I][SavedStruct] Loading "/int/.desktop.settings" -51075 [I][SavedStruct] Loading "/int/.desktop.settings" -51275 [I][SavedStruct] Loading "/int/.desktop.settings" -51360 [I][SavedStruct] Loading "/int/.desktop.settings" -51475 [I][SavedStruct] Loading "/int/.desktop.settings" -51675 [I][SavedStruct] Loading "/int/.desktop.settings" -51860 [I][SavedStruct] Loading "/int/.desktop.settings" -51879 [I][SavedStruct] Loading "/int/.desktop.settings" -52075 [I][SavedStruct] Loading "/int/.desktop.settings" -52275 [I][SavedStruct] Loading "/int/.desktop.settings" -52360 [I][SavedStruct] Loading "/int/.desktop.settings" -52475 [I][SavedStruct] Loading "/int/.desktop.settings" -52675 [I][SavedStruct] Loading "/int/.desktop.settings" -52860 [I][SavedStruct] Loading "/int/.desktop.settings" -52879 [I][SavedStruct] Loading "/int/.desktop.settings" -53075 [I][SavedStruct] Loading "/int/.desktop.settings" -53275 [I][SavedStruct] Loading "/int/.desktop.settings" -53360 [I][SavedStruct] Loading "/int/.desktop.settings" -53475 [I][SavedStruct] Loading "/int/.desktop.settings" -53675 [I][SavedStruct] Loading "/int/.desktop.settings" -53860 [I][SavedStruct] Loading "/int/.desktop.settings" -53879 [I][SavedStruct] Loading "/int/.desktop.settings" -54075 [I][SavedStruct] Loading "/int/.desktop.settings" -54101 [I][BtGap] Stop advertising -54104 [D][BtGap] terminate success -54107 [E][BtGap] set_non_discoverable failed 12 -54111 [I][SavedStruct] Loading "/int/.desktop.settings" -54275 [I][SavedStruct] Loading "/int/.desktop.settings" -54311 [I][SavedStruct] Loading "/int/.bt.settings" -54324 [I][SavedStruct] Loading "/int/.bt.keys" -54335 [I][FuriHalBt] Disconnect and stop advertising -54337 [I][FuriHalBt] Stop current profile services -54339 [I][BtGap] Disconnect from client. Reason: 16 -54349 [I][FuriHalBt] Stop BLE related RTOS threads -54373 [I][FuriHalBt] Reset SHCI -54475 [I][SavedStruct] Loading "/int/.desktop.settings" -54487 [I][FuriHalBt] Start BT initialization -54494 [I][Core2] Core2 started -54496 [I][Core2] C2 boot completed, mode: Stack -54500 [I][Core2] Core2: FUS: 1.2.0, mem 16/0, flash 6 pages -54504 [I][Core2] Core2: Stack: 1.13.3, branch 0, reltype 2, stacktype 3, flash 30 pages -54508 [I][Core2] Radio stack started -54511 [I][Core2] Flash activity control switched to SEM7 -54513 [I][BtGap] Advertising name: Keyboard -54516 [I][BtGap] MAC @ : 35:F2:47:26:E1:80 -54534 [D][BtBatterySvc] Updating power state characteristic -54540 [I][BtSrv] Bt App started -54542 [I][BtGap] Start advertising -54545 [I][BadBleWorker] End -54547 [I][SavedStruct] Loading "/int/.desktop.settings" -54568 [I][SavedStruct] Loading "/int/.desktop.settings" -54570 [D][BrowserWorker] Start -54598 [D][BrowserWorker] Enter folder: /any/BadUsb/fun items: 9 idx: 4 -54600 [D][BrowserWorker] Load offset: 0 cnt: 50 -54676 [D][BrowserWorker] Exit to: /any/BadUsb items: 10 idx: -1 -54678 [D][BrowserWorker] Load offset: 0 cnt: 50 -54888 [D][BrowserWorker] End -54890 [I][SavedStruct] Loading "/int/.desktop.settings" -54946 [I][fap_loader_app] FAP app returned: 0 -54982 [I][LoaderSrv] Application stopped. Free heap: 140272 -55011 [I][AnimationStorage] Custom Manifest selected -55299 [I][AnimationManager] Select 'HANDS' animation -55303 [I][AnimationManager] Load animation 'HANDS' -55331 [I][SavedStruct] Loading "/int/.desktop.settings" -65361 [I][Dolphin] Flush stats -65363 [I][SavedStruct] Saving "/int/.dolphin.state" -65373 [D][StorageInt] Device erase: page 2, translated page: cf -65468 [D][StorageInt] Device sync: skipping -65473 [I][DolphinState] State saved -72183 [I][AnimationStorage] Custom Manifest selected -73040 [I][AnimationManager] Select 'SKULL' animation -103081 [I][AnimationStorage] Custom Manifest selected -104016 [I][AnimationManager] Select 'LOGO_WD2' animation -114771 [D][BtGap] set_non_discoverable success -134057 [I][AnimationStorage] Custom Manifest selected -134395 [I][AnimationManager] Select 'MUMMY' animation -164438 [I][AnimationStorage] Custom Manifest selected -164953 [I][AnimationManager] Select 'DEDSEC_TALK' animation -174773 [D][BtGap] set_non_discoverable success -194994 [I][AnimationStorage] Custom Manifest selected -195897 [I][AnimationManager] Select 'REAPER_ALT' animation -225938 [I][AnimationStorage] Custom Manifest selected -226509 [I][AnimationManager] Select 'DEDSEC_OLD' animation -234775 [D][BtGap] set_non_discoverable success -256552 [I][AnimationStorage] Custom Manifest selected -256819 [I][AnimationManager] Select 'JOIN_US' animation -286859 [I][AnimationStorage] Custom Manifest selected -287374 [I][AnimationManager] Select 'DEDSEC_TALK' animation -294777 [D][BtGap] set_non_discoverable success -317415 [I][AnimationStorage] Custom Manifest selected -318273 [I][AnimationManager] Select 'SKULL' animation -348316 [I][AnimationStorage] Custom Manifest selected -349083 [I][AnimationManager] Select 'SPIRAL' animation -354779 [D][BtGap] set_non_discoverable success -379124 [I][AnimationStorage] Custom Manifest selected -379787 [I][AnimationManager] Select 'SKULL_SPIN' animation -409828 [I][AnimationStorage] Custom Manifest selected -410316 [I][AnimationManager] Select 'DEDSEC_AD' animation -414781 [D][BtGap] set_non_discoverable success -440358 [I][AnimationStorage] Custom Manifest selected -440698 [I][AnimationManager] Select 'MUMMY' animation -470740 [I][AnimationStorage] Custom Manifest selected -471138 [I][AnimationManager] Select 'HANDS' animation -474783 [D][BtGap] set_non_discoverable success -501180 [I][AnimationStorage] Custom Manifest selected -502243 [I][AnimationManager] Select 'DEDSEC_ANIM' animation -532285 [I][AnimationStorage] Custom Manifest selected -532547 [I][AnimationManager] Select 'BOTTY_CALL' animation -534785 [D][BtGap] set_non_discoverable success -562592 [I][AnimationStorage] Custom Manifest selected -563449 [I][AnimationManager] Select 'SKULL' animation -593489 [I][AnimationStorage] Custom Manifest selected -594414 [I][AnimationManager] Select 'LOGO_WD2' animation -594787 [D][BtGap] set_non_discoverable success -624465 [I][AnimationStorage] Custom Manifest selected -624658 [I][AnimationManager] Select 'thank_you_128x64' animation -654700 [I][AnimationStorage] Custom Manifest selected -655440 [I][AnimationManager] Select 'GUNS_CAR' animation -655471 [D][BtGap] set_non_discoverable success -685480 [I][AnimationStorage] Custom Manifest selected -686535 [I][AnimationManager] Select 'DEDSEC_ANIM' animation -715480 [D][BtGap] set_non_discoverable success -716577 [I][AnimationStorage] Custom Manifest selected -717479 [I][AnimationManager] Select 'REAPER_ALT' animation -747521 [I][AnimationStorage] Custom Manifest selected -748026 [I][AnimationManager] Select 'DEDSEC_TALK' animation -775484 [D][BtGap] set_non_discoverable success -778069 [I][AnimationStorage] Custom Manifest selected -779065 [I][AnimationManager] Select 'REAPER' animation -809108 [I][AnimationStorage] Custom Manifest selected -809625 [I][AnimationManager] Select 'DEDSEC_TALK' animation -835486 [D][BtGap] set_non_discoverable success -839669 [I][AnimationStorage] Custom Manifest selected -840573 [I][AnimationManager] Select 'REAPER_ALT' animation -870614 [I][AnimationStorage] Custom Manifest selected -871392 [I][AnimationManager] Select 'SPIRAL' animation -895488 [D][BtGap] set_non_discoverable success -901433 [I][AnimationStorage] Custom Manifest selected -902487 [I][AnimationManager] Select 'DEDSEC_ANIM' animation -932529 [I][AnimationStorage] Custom Manifest selected -932843 [I][AnimationManager] Select 'FINGER' animation