Skip to content

Commit cc8639a

Browse files
committed
Review changes
1 parent 9484ad2 commit cc8639a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

applications/main/infrared/scenes/infrared_scene_rpc.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ bool infrared_scene_rpc_on_event(void* context, SceneManagerEvent event) {
144144
TAG, "Sending signal with index \"%ld\"", app_state->current_button_index);
145145
}
146146
if(infrared->app_state.current_button_index != InfraredButtonIndexNone) {
147-
InfraredErrorCode error =
148-
infrared_tx_start_button_index(infrared, app_state->current_button_index);
147+
InfraredSignal* signal = infrared_signal_alloc();
148+
InfraredErrorCode error = infrared_remote_load_signal(
149+
infrared->remote, signal, app_state->current_button_index);
149150
if(!INFRARED_ERROR_PRESENT(error)) {
151+
infrared_signal_transmit(signal);
150152
const char* remote_name = infrared_remote_get_name(infrared->remote);
151153
infrared_text_store_set(infrared, 0, "emulating\n%s", remote_name);
152154

@@ -163,13 +165,10 @@ bool infrared_scene_rpc_on_event(void* context, SceneManagerEvent event) {
163165
}
164166

165167
if(result) {
166-
infrared_tx_stop(infrared);
167168
scene_manager_set_scene_state(
168169
infrared->scene_manager, InfraredSceneRpc, InfraredRpcStateLoaded);
169-
scene_manager_stop(infrared->scene_manager);
170-
view_dispatcher_stop(infrared->view_dispatcher);
171170
}
172-
171+
infrared_signal_free(infrared->current_signal);
173172
rpc_system_app_confirm(infrared->rpc_ctx, result);
174173
} else if(
175174
event.event == InfraredCustomEventTypeRpcExit ||

0 commit comments

Comments
 (0)