diff --git a/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.c b/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.c index 223876c36..db485a2aa 100644 --- a/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.c +++ b/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.c @@ -64,6 +64,7 @@ SubGhzTxRx* subghz_txrx_alloc() { //set default device Internal subghz_devices_init(); + instance->radio_device_type = SubGhzRadioDeviceTypeInternal; instance->radio_device_type = subghz_txrx_radio_device_set(instance, SubGhzRadioDeviceTypeInternal); @@ -570,7 +571,7 @@ void subghz_txrx_set_raw_file_encoder_worker_callback_end( context); } -bool subghz_txrx_radio_device_is_connect_external(SubGhzTxRx* instance, const char* name) { +bool subghz_txrx_radio_device_is_external_connected(SubGhzTxRx* instance, const char* name) { furi_assert(instance); bool is_connect = false; @@ -580,7 +581,10 @@ bool subghz_txrx_radio_device_is_connect_external(SubGhzTxRx* instance, const ch subghz_txrx_radio_device_power_on(instance); } - is_connect = subghz_devices_is_connect(subghz_devices_get_by_name(name)); + const SubGhzDevice* device = subghz_devices_get_by_name(name); + if(device) { + is_connect = subghz_devices_is_connect(device); + } if(!is_otg_enabled) { subghz_txrx_radio_device_power_off(instance); @@ -593,7 +597,7 @@ SubGhzRadioDeviceType furi_assert(instance); if(radio_device_type == SubGhzRadioDeviceTypeExternalCC1101 && - subghz_txrx_radio_device_is_connect_external(instance, SUBGHZ_DEVICE_CC1101_EXT_NAME)) { + subghz_txrx_radio_device_is_external_connected(instance, SUBGHZ_DEVICE_CC1101_EXT_NAME)) { subghz_txrx_radio_device_power_on(instance); instance->radio_device = subghz_devices_get_by_name(SUBGHZ_DEVICE_CC1101_EXT_NAME); subghz_devices_begin(instance->radio_device); diff --git a/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.h b/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.h index 93748e2de..8bb7f2aee 100644 --- a/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.h +++ b/applications/external/subghz_remote_configurator/helpers/txrx/subghz_txrx.h @@ -326,7 +326,7 @@ void subghz_txrx_set_raw_file_encoder_worker_callback_end( * @param name Name of external radio device * @return bool True if is connected to the external radio device */ -bool subghz_txrx_radio_device_is_connect_external(SubGhzTxRx* instance, const char* name); +bool subghz_txrx_radio_device_is_external_connected(SubGhzTxRx* instance, const char* name); /* Set the selected radio device to use *