[FL-2204] Bluetooth forget devices (#967)

* bt: update connection parameters
* bt: set correct connection latency and timeout
* gui popup: add clean method
* furi_hal_bt: add connection parameters request, clear database
* bt: add forget bonded devices API
* bt_settings: add forget bonded devices GUI
* bt: rework pin code show with view port to hide view
* bt: support conn parameters for different profiles
* furi_hal_bt: sync f6 target
* target f6: fix build
* bt: format sources
* furi_hal_bt: update connection parameters
* bt: update connection params, fix GUI
* FuriHal: fix spelling
* Refactoring: rename _clean to _reset

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2022-01-21 20:32:03 +03:00
committed by GitHub
parent d4787e859e
commit 23ff6723cf
82 changed files with 471 additions and 116 deletions

View File

@@ -241,7 +241,7 @@ View* button_menu_get_view(ButtonMenu* button_menu) {
return button_menu->view;
}
void button_menu_clean(ButtonMenu* button_menu) {
void button_menu_reset(ButtonMenu* button_menu) {
furi_assert(button_menu);
with_view_model(

View File

@@ -39,7 +39,7 @@ View* button_menu_get_view(ButtonMenu* button_menu);
*
* @param button_menu ButtonMenu instance
*/
void button_menu_clean(ButtonMenu* button_menu);
void button_menu_reset(ButtonMenu* button_menu);
/** Add item to button menu instance
*

View File

@@ -112,7 +112,7 @@ void button_panel_reserve(ButtonPanel* button_panel, size_t reserve_x, size_t re
void button_panel_free(ButtonPanel* button_panel) {
furi_assert(button_panel);
button_panel_clean(button_panel);
button_panel_reset(button_panel);
with_view_model(
button_panel->view, (ButtonPanelModel * model) {
@@ -125,7 +125,7 @@ void button_panel_free(ButtonPanel* button_panel) {
free(button_panel);
}
void button_panel_clean(ButtonPanel* button_panel) {
void button_panel_reset(ButtonPanel* button_panel) {
furi_assert(button_panel);
with_view_model(

View File

@@ -39,7 +39,7 @@ void button_panel_free(ButtonPanel* button_panel);
*
* @param button_panel ButtonPanel instance
*/
void button_panel_clean(ButtonPanel* button_panel);
void button_panel_reset(ButtonPanel* button_panel);
/** Reserve space for adding items.
*

View File

@@ -244,7 +244,7 @@ void dialog_ex_set_right_button_text(DialogEx* dialog_ex, const char* text) {
});
}
void dialog_ex_clean(DialogEx* dialog_ex) {
void dialog_ex_reset(DialogEx* dialog_ex) {
furi_assert(dialog_ex);
TextElement clean_text_el = {
.text = NULL, .x = 0, .y = 0, .horizontal = AlignLeft, .vertical = AlignLeft};

View File

@@ -143,8 +143,8 @@ void dialog_ex_set_right_button_text(DialogEx* dialog_ex, const char* text);
*
* @param dialog_ex DialogEx instance
*/
void dialog_ex_clean(DialogEx* dialog_ex);
void dialog_ex_reset(DialogEx* dialog_ex);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -146,7 +146,7 @@ Menu* menu_alloc() {
void menu_free(Menu* menu) {
furi_assert(menu);
menu_clean(menu);
menu_reset(menu);
view_free(menu->view);
free(menu);
}
@@ -180,7 +180,7 @@ void menu_add_item(
});
}
void menu_clean(Menu* menu) {
void menu_reset(Menu* menu) {
furi_assert(menu);
with_view_model(
menu->view, (MenuModel * model) {

View File

@@ -59,7 +59,7 @@ void menu_add_item(
*
* @param menu Menu instance
*/
void menu_clean(Menu* menu);
void menu_reset(Menu* menu);
/** Set current menu item
*

View File

@@ -226,4 +226,20 @@ void popup_enable_timeout(Popup* popup) {
void popup_disable_timeout(Popup* popup) {
popup->timer_enabled = false;
}
}
void popup_reset(Popup* popup) {
furi_assert(popup);
with_view_model(
popup->view, (PopupModel * model) {
memset(&model->header, 0, sizeof(model->header));
memset(&model->text, 0, sizeof(model->text));
memset(&model->icon, 0, sizeof(model->icon));
return false;
});
popup->callback = NULL;
popup->context = NULL;
popup->timer_enabled = false;
popup->timer_period_in_ms = 0;
}

View File

@@ -123,6 +123,12 @@ void popup_enable_timeout(Popup* popup);
*/
void popup_disable_timeout(Popup* popup);
/** Reset popup instance state
*
* @param popup Popup instance
*/
void popup_reset(Popup* popup);
#ifdef __cplusplus
}
#endif

View File

@@ -177,7 +177,7 @@ void submenu_add_item(
});
}
void submenu_clean(Submenu* submenu) {
void submenu_reset(Submenu* submenu) {
furi_assert(submenu);
with_view_model(

View File

@@ -57,7 +57,7 @@ void submenu_add_item(
*
* @param submenu Submenu instance
*/
void submenu_clean(Submenu* submenu);
void submenu_reset(Submenu* submenu);
/** Set submenu item selector
*

View File

@@ -164,7 +164,7 @@ View* text_box_get_view(TextBox* text_box) {
return text_box->view;
}
void text_box_clean(TextBox* text_box) {
void text_box_reset(TextBox* text_box) {
furi_assert(text_box);
with_view_model(

View File

@@ -44,7 +44,7 @@ View* text_box_get_view(TextBox* text_box);
*
* @param text_box TextBox instance
*/
void text_box_clean(TextBox* text_box);
void text_box_reset(TextBox* text_box);
/** Set text for text_box
*

View File

@@ -425,7 +425,7 @@ TextInput* text_input_alloc() {
return false;
});
text_input_clean(text_input);
text_input_reset(text_input);
return text_input;
}
@@ -450,7 +450,7 @@ void text_input_free(TextInput* text_input) {
free(text_input);
}
void text_input_clean(TextInput* text_input) {
void text_input_reset(TextInput* text_input) {
furi_assert(text_input);
with_view_model(
text_input->view, (TextInputModel * model) {

View File

@@ -36,7 +36,7 @@ void text_input_free(TextInput* text_input);
*
* @param text_input Text input instance
*/
void text_input_clean(TextInput* text_input);
void text_input_reset(TextInput* text_input);
/** Get text input view
*
@@ -84,4 +84,4 @@ void text_input_set_header_text(TextInput* text_input, const char* text);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -312,7 +312,7 @@ void variable_item_list_free(VariableItemList* variable_item_list) {
free(variable_item_list);
}
void variable_item_list_clean(VariableItemList* variable_item_list) {
void variable_item_list_reset(VariableItemList* variable_item_list) {
furi_assert(variable_item_list);
with_view_model(

View File

@@ -32,7 +32,7 @@ void variable_item_list_free(VariableItemList* variable_item_list);
*
* @param variable_item_list VariableItemList instance
*/
void variable_item_list_clean(VariableItemList* variable_item_list);
void variable_item_list_reset(VariableItemList* variable_item_list);
/** Get VariableItemList View instance
*