Skip to content

Commit

Permalink
Merge pull request #620 from G2Dolphin/niceflors
Browse files Browse the repository at this point in the history
Added NiceFloR-S to ignore options, removed colons.
  • Loading branch information
xMasterX authored Oct 17, 2023
2 parents 8b8174b + 1e5223c commit e5b079f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
34 changes: 25 additions & 9 deletions applications/main/subghz/scenes/subghz_scene_receiver_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ static void subghz_scene_receiver_config_set_princeton(VariableItem* item) {
subghz_scene_receiver_config_set_ignore_filter(item, SubGhzProtocolFlag_Princeton);
}

static void subghz_scene_receiver_config_set_niceflors(VariableItem* item) {
subghz_scene_receiver_config_set_ignore_filter(item, SubGhzProtocolFlag_NiceFlorS);
}

static void subghz_scene_receiver_config_var_list_enter_callback(void* context, uint32_t index) {
furi_assert(context);
SubGhz* subghz = context;
Expand Down Expand Up @@ -336,7 +340,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {

item = variable_item_list_add(
subghz->variable_item_list,
"Frequency:",
"Frequency",
subghz_setting_get_frequency_count(setting),
subghz_scene_receiver_config_set_frequency,
subghz);
Expand All @@ -356,7 +360,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {

item = variable_item_list_add(
subghz->variable_item_list,
"Modulation:",
"Modulation",
subghz_setting_get_preset_count(setting),
subghz_scene_receiver_config_set_preset,
subghz);
Expand All @@ -371,7 +375,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {
// Hopping
item = variable_item_list_add(
subghz->variable_item_list,
"Hopping:",
"Hopping",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_hopping_running,
subghz);
Expand All @@ -385,7 +389,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {
SubGhzCustomEventManagerSet) {
item = variable_item_list_add(
subghz->variable_item_list,
"Bin RAW:",
"Bin RAW",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_bin_raw,
subghz);
Expand All @@ -399,7 +403,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {
SubGhzCustomEventManagerSet) {
item = variable_item_list_add(
subghz->variable_item_list,
"Ignore Starline:",
"Ignore Starline",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_starline,
subghz);
Expand All @@ -411,7 +415,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {

item = variable_item_list_add(
subghz->variable_item_list,
"Ignore Cars:",
"Ignore Cars",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_auto_alarms,
subghz);
Expand All @@ -423,7 +427,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {

item = variable_item_list_add(
subghz->variable_item_list,
"Ignore Magellan:",
"Ignore Magellan",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_magellan,
subghz);
Expand All @@ -435,7 +439,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {

item = variable_item_list_add(
subghz->variable_item_list,
"Ignore Princeton:",
"Ignore Princeton",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_princeton,
subghz);
Expand All @@ -444,12 +448,24 @@ void subghz_scene_receiver_config_on_enter(void* context) {
subghz->ignore_filter, SubGhzProtocolFlag_Princeton);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, combobox_text[value_index]);

item = variable_item_list_add(
subghz->variable_item_list,
"Ignore NiceFlorS / Nice One",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_niceflors,
subghz);

value_index = subghz_scene_receiver_config_ignore_filter_get_index(
subghz->ignore_filter, SubGhzProtocolFlag_NiceFlorS);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, combobox_text[value_index]);
}

// Enable speaker, will send all incoming noises and signals to speaker so you can listen how your remote sounds like :)
item = variable_item_list_add(
subghz->variable_item_list,
"Sound:",
"Sound",
COMBO_BOX_COUNT,
subghz_scene_receiver_config_set_speaker,
subghz);
Expand Down
4 changes: 3 additions & 1 deletion applications/main/subghz/subghz_last_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void subghz_last_settings_log(SubGhzLastSettings* instance) {
TAG,
"Frequency: %03ld.%02ld, FeedbackLevel: %ld, FATrigger: %.2f, External: %s, ExtPower: %s, TimestampNames: %s, ExtPowerAmp: %s,\n"
"Hopping: %s,\nPreset: %ld, RSSI: %.2f, "
"Starline: %s, Cars: %s, Magellan: %s, BinRAW: %s",
"Starline: %s, Cars: %s, Magellan: %s, NiceFloR-S: %s, BinRAW: %s",
instance->frequency / 1000000 % 1000,
instance->frequency / 10000 % 100,
instance->frequency_analyzer_feedback_level,
Expand All @@ -321,5 +321,7 @@ void subghz_last_settings_log(SubGhzLastSettings* instance) {
instance->ignore_filter, SubGhzProtocolFlag_AutoAlarms),
subghz_last_settings_log_filter_get_index(
instance->ignore_filter, SubGhzProtocolFlag_Magellan),
subghz_last_settings_log_filter_get_index(
instance->ignore_filter, SubGhzProtocolFlag_NiceFlorS),
subghz_last_settings_log_filter_get_index(instance->filter, SubGhzProtocolFlag_BinRAW));
}
2 changes: 1 addition & 1 deletion lib/subghz/protocols/nice_flor_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const SubGhzProtocol subghz_protocol_nice_flor_s = {
.type = SubGhzProtocolTypeDynamic,
.flag = SubGhzProtocolFlag_433 | SubGhzProtocolFlag_868 | SubGhzProtocolFlag_AM |
SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_Load | SubGhzProtocolFlag_Save |
SubGhzProtocolFlag_Send,
SubGhzProtocolFlag_Send | SubGhzProtocolFlag_NiceFlorS,

.decoder = &subghz_protocol_nice_flor_s_decoder,
.encoder = &subghz_protocol_nice_flor_s_encoder,
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ typedef enum {
SubGhzProtocolFlag_AutoAlarms = (1 << 12),
SubGhzProtocolFlag_Magellan = (1 << 13),
SubGhzProtocolFlag_Princeton = (1 << 14),
SubGhzProtocolFlag_NiceFlorS = (1 << 15),
} SubGhzProtocolFlag;

struct SubGhzProtocol {
Expand Down

0 comments on commit e5b079f

Please sign in to comment.