forked from biologist79/ESPuino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCmd.cpp
More file actions
612 lines (551 loc) · 18 KB
/
Copy pathCmd.cpp
File metadata and controls
612 lines (551 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
#include <Arduino.h>
#include "settings.h"
#include "Cmd.h"
#include "AudioPlayer.h"
#include "Backup.h"
#include "Battery.h"
#include "Bluetooth.h"
#include "Display.h"
#include "Ftp.h"
#include "Led.h"
#include "Log.h"
#include "Mqtt.h"
#include "Queues.h"
#include "Rfid.h"
#include "RfidSync.h"
#include "Rtc.h"
#include "Sync.h"
#include "System.h"
#include "Web.h"
#include "Webdav.h"
#include "Wlan.h"
#include <algorithm>
static void Cmd_HandleSleepAction(bool enable, const char *enLogMsg, const char *enMqttMsg) {
Led_SetNightmode(enable);
if (enable) {
Log_Println(enLogMsg, LOGLEVEL_INFO);
#ifdef MQTT_ENABLE
publishMqtt(topicSleepTimer, enMqttMsg, false);
#endif
} else {
System_DisableSleepTimer();
Log_Println(modificatorSleepd, LOGLEVEL_INFO);
#ifdef MQTT_ENABLE
publishMqtt(topicSleepTimer, "0", false);
#endif
}
}
// Arm the sleep timer for the given number of minutes and clear the other sleep modifiers
// (sleep-after-track / sleep-after-playlist / play-until-track) so they don't override it.
static void Cmd_StartSleepTimer(uint8_t minutes) {
System_SetSleepTimer(minutes);
gPlayProperties.sleepAfterCurrentTrack = false; // deactivate/overwrite if already active
gPlayProperties.sleepAfterPlaylist = false; // deactivate/overwrite if already active
gPlayProperties.playUntilTrackNumber = 0;
System_IndicateOk();
}
void Cmd_Action(const uint16_t mod, bool bypassLock) {
// CMD_NOTHING (0) is the "no action assigned" sentinel - e.g. an unassigned button or an IR
// short/long press set to "- (None)". Treat it as a genuine no-op instead of falling through
// to the unknown-command error indication in the default case below.
if (mod == CMD_NOTHING) {
return;
}
// The child lock only blocks physical controls (buttons/IR call with bypassLock=false). Internal
// automation callers pass bypassLock=true so a locked player still stops playback before a web
// delete/format, honours HomeKit/RFID-mod commands, and auto-pauses at min volume.
if (!bypassLock && System_AreControlsLocked() && (mod != CMD_LOCK_BUTTONS_MOD)) {
return;
}
// Abort a running HTTP file sync on any button/command press (configurable, default on).
if ((Sync_GetStatus() == 1) && gPrefsSettings.getBool("syncAbortBtn", true)) {
Sync_Cancel();
}
switch (mod) {
case CMD_LOCK_BUTTONS_MOD: { // Locks/unlocks all buttons
System_ToggleLockControls();
if (System_AreControlsLocked()) {
Log_Println(modificatorAllButtonsLocked, LOGLEVEL_NOTICE);
#ifdef MQTT_ENABLE
publishMqtt(topicLockControls, "ON", false);
#endif
} else {
Log_Println(modificatorAllButtonsUnlocked, LOGLEVEL_NOTICE);
#ifdef MQTT_ENABLE
publishMqtt(topicLockControls, "OFF", false);
#endif
}
System_IndicateOk();
break;
}
case CMD_SLEEP_TIMER_MOD_15: // Enables/disables sleep after 15 minutes
Cmd_StartSleepTimer(15u);
break;
case CMD_SLEEP_TIMER_MOD_30: // Enables/disables sleep after 30 minutes
Cmd_StartSleepTimer(30u);
break;
case CMD_SLEEP_TIMER_MOD_60: // Enables/disables sleep after 60 minutes
Cmd_StartSleepTimer(60u);
break;
case CMD_SLEEP_TIMER_MOD_120: // Enables/disables sleep after 2 hrs
Cmd_StartSleepTimer(120u);
break;
case CMD_SLEEP_AFTER_END_OF_TRACK: { // Puts uC to sleep after end of current track
if (gPlayProperties.playMode == NO_PLAYLIST) {
Log_Println(modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
System_IndicateError();
return;
}
gPlayProperties.sleepAfterPlaylist = false;
gPlayProperties.playUntilTrackNumber = 0;
gPlayProperties.sleepAfterCurrentTrack = !gPlayProperties.sleepAfterCurrentTrack;
Cmd_HandleSleepAction(gPlayProperties.sleepAfterCurrentTrack, modificatorSleepAtEOT, "EOT");
System_IndicateOk();
break;
}
case CMD_SLEEP_AFTER_END_OF_PLAYLIST: { // Puts uC to sleep after end of whole playlist (can take a while :->)
if (gPlayProperties.playMode == NO_PLAYLIST) {
Log_Println(modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
System_IndicateError();
return;
}
gPlayProperties.sleepAfterCurrentTrack = false;
gPlayProperties.playUntilTrackNumber = 0;
gPlayProperties.sleepAfterPlaylist = !gPlayProperties.sleepAfterPlaylist;
Cmd_HandleSleepAction(gPlayProperties.sleepAfterPlaylist, modificatorSleepAtEOP, "EOP");
System_IndicateOk();
break;
}
case CMD_SLEEP_AFTER_5_TRACKS: {
size_t playlistSize = 0;
AudioPlayer_LockPlaylist();
if (gPlayProperties.playlist) {
playlistSize = gPlayProperties.playlist->size();
}
AudioPlayer_UnlockPlaylist();
if (gPlayProperties.playMode == NO_PLAYLIST || playlistSize == 0) {
Log_Println(modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
System_IndicateError();
return;
}
gPlayProperties.sleepAfterCurrentTrack = false;
gPlayProperties.sleepAfterPlaylist = false;
// playUntilTrackNumber is the flag AudioPlayer_Loop() actually evaluates for
// "sleep after N tracks". Reapplying the modification card toggles it off.
if (gPlayProperties.playUntilTrackNumber > 0) {
gPlayProperties.playUntilTrackNumber = 0;
} else if ((playlistSize - 1) >= (gPlayProperties.currentTrackNumber + 5)) {
gPlayProperties.playUntilTrackNumber = gPlayProperties.currentTrackNumber + 5;
} else {
// Fewer than five tracks remain: sleep at the end of the playlist instead.
Cmd_Action(CMD_SLEEP_AFTER_END_OF_PLAYLIST);
break;
}
Cmd_HandleSleepAction(gPlayProperties.playUntilTrackNumber > 0, sleepTimerEO5, "EO5T");
System_IndicateOk();
break;
}
case CMD_REPEAT_PLAYLIST: {
if (gPlayProperties.playMode == NO_PLAYLIST) {
Log_Println(modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
System_IndicateError();
} else {
if (gPlayProperties.repeatPlaylist) {
Log_Println(modificatorPlaylistLoopDeactive, LOGLEVEL_NOTICE);
} else {
Log_Println(modificatorPlaylistLoopActive, LOGLEVEL_NOTICE);
}
gPlayProperties.repeatPlaylist = !gPlayProperties.repeatPlaylist;
#ifdef MQTT_ENABLE
publishMqtt(topicRepeatMode, static_cast<uint32_t>(AudioPlayer_GetRepeatMode()), false);
#endif
System_IndicateOk();
Web_SendWebsocketData(0, WebsocketCodeType::TrackInfo);
}
break;
}
case CMD_REPEAT_TRACK: { // Introduces looping for track-mode
if (gPlayProperties.playMode == NO_PLAYLIST) {
Log_Println(modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
System_IndicateError();
} else {
if (gPlayProperties.repeatCurrentTrack) {
Log_Println(modificatorTrackDeactive, LOGLEVEL_NOTICE);
} else {
Log_Println(modificatorTrackActive, LOGLEVEL_NOTICE);
}
gPlayProperties.repeatCurrentTrack = !gPlayProperties.repeatCurrentTrack;
#ifdef OLED_ENABLE
Display_ShowCommandFeedback(gPlayProperties.repeatCurrentTrack ? DisplayCommandFeedback::LoopOn : DisplayCommandFeedback::LoopOff);
#endif
#ifdef MQTT_ENABLE
publishMqtt(topicRepeatMode, static_cast<uint32_t>(AudioPlayer_GetRepeatMode()), false);
#endif
System_IndicateOk();
Web_SendWebsocketData(0, WebsocketCodeType::TrackInfo);
}
break;
}
case CMD_DIMM_LEDS_NIGHTMODE: {
Led_ToggleNightmode();
System_IndicateOk();
break;
}
case CMD_TOGGLE_AMBIENT_LIGHT: {
Led_ToggleAmbientLight();
break;
}
case CMD_TOGGLE_CONTROL_LEDS: {
Led_ToggleControlLeds();
#ifdef MQTT_ENABLE
publishMqtt(topicControlLeds, Led_GetControlLeds() ? "ON" : "OFF", false);
#endif
System_IndicateOk();
break;
}
case CMD_TOGGLE_EQUALIZER: {
AudioPlayer_CycleEqualizerProfile();
#ifdef OLED_ENABLE
Display_ShowCommandFeedback(DisplayCommandFeedback::Equalizer);
#endif
System_IndicateOk();
break;
}
case CMD_TOGGLE_WIFI_STATUS: {
System_SetOperationMode(OPMODE_NORMAL); // escape from BT-mode, WiFi cannot coexist with BT and can cause a crash
Wlan_ToggleEnable();
System_IndicateOk();
break;
}
#ifdef BLUETOOTH_ENABLE
case CMD_TOGGLE_BLUETOOTH_SINK_MODE: {
// One-touch speaker toggle (bind it to a key): from Normal it enters Bluetooth speaker
// mode, and from *either* Bluetooth mode (speaker or headphones) it returns to Normal.
System_IndicateOk();
if (System_GetOperationModeFromNvs() == OPMODE_NORMAL) {
System_SetOperationMode(OPMODE_BLUETOOTH_SINK);
} else {
System_SetOperationMode(OPMODE_NORMAL);
}
break;
}
case CMD_TOGGLE_BLUETOOTH_SOURCE_MODE: {
// One-touch headphone toggle (bind it to a key): from Normal it enters Bluetooth
// headphone mode, and from *either* Bluetooth mode it returns to Normal.
System_IndicateOk();
if (System_GetOperationModeFromNvs() == OPMODE_NORMAL) {
System_SetOperationMode(OPMODE_BLUETOOTH_SOURCE);
} else {
System_SetOperationMode(OPMODE_NORMAL);
}
break;
}
case CMD_TOGGLE_MODE: {
if (System_GetOperationModeFromNvs() == OPMODE_NORMAL) {
System_IndicateOk();
System_SetOperationMode(OPMODE_BLUETOOTH_SINK);
} else if (System_GetOperationModeFromNvs() == OPMODE_BLUETOOTH_SINK) {
System_IndicateOk();
System_SetOperationMode(OPMODE_BLUETOOTH_SOURCE);
} else if (System_GetOperationModeFromNvs() == OPMODE_BLUETOOTH_SOURCE) {
System_IndicateOk();
System_SetOperationMode(OPMODE_NORMAL);
} else {
System_IndicateError();
}
break;
}
case CMD_ENTER_BLUETOOTH_SINK_MODE: {
// Switches to bluetooth sink (speaker) mode from any mode; switches back to normal mode if already active
System_IndicateOk();
if (System_GetOperationModeFromNvs() != OPMODE_BLUETOOTH_SINK) {
System_SetOperationMode(OPMODE_BLUETOOTH_SINK);
} else {
System_SetOperationMode(OPMODE_NORMAL);
}
break;
}
case CMD_ENTER_BLUETOOTH_SOURCE_MODE: {
// Switches to bluetooth source (headphone) mode from any mode; switches back to normal mode if already active
System_IndicateOk();
if (System_GetOperationModeFromNvs() != OPMODE_BLUETOOTH_SOURCE) {
System_SetOperationMode(OPMODE_BLUETOOTH_SOURCE);
} else {
System_SetOperationMode(OPMODE_NORMAL);
}
break;
}
#endif
#ifdef FTP_ENABLE
case CMD_ENABLE_FTP_SERVER: {
if (millis() <= 30000) { // Only allow to enable FTP within the first 30s after start (to prevent children it mess it up)
Ftp_EnableServer();
} else {
Log_Println(ftpEnableTooLate, LOGLEVEL_ERROR);
System_IndicateError();
}
break;
}
#endif
case CMD_TELL_IP_ADDRESS: {
if (Wlan_IsConnected()) {
gPlayProperties.tellMode = TTS_IP_ADDRESS;
gPlayProperties.currentSpeechActive = true;
gPlayProperties.lastSpeechActive = true;
System_IndicateOk();
} else {
Log_Println(unableToTellIpAddress, LOGLEVEL_ERROR);
System_IndicateError();
}
break;
}
case CMD_TELL_CURRENT_TIME: {
if (Wlan_IsConnected()) {
gPlayProperties.tellMode = TTS_CURRENT_TIME;
gPlayProperties.currentSpeechActive = true;
gPlayProperties.lastSpeechActive = true;
System_IndicateOk();
} else {
Log_Println(unableToTellTime, LOGLEVEL_ERROR);
System_IndicateError();
}
break;
}
case CMD_RTC_RESYNC: {
if (Rtc_IsAvailable()) {
Rtc_SetFromSystemTime();
System_IndicateOk();
} else {
System_IndicateError();
}
break;
}
case CMD_TOGGLE_OLED: {
#ifdef OLED_ENABLE
Display_Toggle();
System_IndicateOk();
#else
System_IndicateError();
#endif
break;
}
case CMD_PLAYPAUSE: {
#ifdef OLED_ENABLE
const bool canTogglePlayback = System_UsesLocalAudio()
? gPlayProperties.playMode != NO_PLAYLIST
: Bluetooth_Device_Connected();
const bool pausedAfterToggle = !gPlayProperties.pausePlay;
#endif
if (System_UsesLocalAudio()) {
AudioPlayer_SetTrackControl(PAUSEPLAY);
} else {
Bluetooth_PlayPauseTrack();
}
#ifdef OLED_ENABLE
if (canTogglePlayback) {
Display_ShowCommandFeedback(pausedAfterToggle ? DisplayCommandFeedback::Pause : DisplayCommandFeedback::Play);
}
#endif
break;
}
case CMD_PREVTRACK: {
if (System_UsesLocalAudio()) {
AudioPlayer_SetTrackControl(PREVIOUSTRACK);
} else {
Bluetooth_PreviousTrack();
}
break;
}
case CMD_NEXTTRACK: {
if (System_UsesLocalAudio()) {
AudioPlayer_SetTrackControl(NEXTTRACK);
} else {
Bluetooth_NextTrack();
}
break;
}
case CMD_FIRSTTRACK: {
AudioPlayer_SetTrackControl(FIRSTTRACK);
break;
}
case CMD_LASTTRACK: {
AudioPlayer_SetTrackControl(LASTTRACK);
break;
}
case CMD_NEXTFOLDER: {
AudioPlayer_SetTrackControl(NEXTFOLDER);
break;
}
case CMD_PREVFOLDER: {
AudioPlayer_SetTrackControl(PREVIOUSFOLDER);
break;
}
case CMD_VOLUMEINIT: {
AudioPlayer_SetVolume(AudioPlayer_GetInitVolume());
break;
}
case CMD_VOLUMEUP: {
if (System_UsesLocalAudio()) {
AudioPlayer_SetVolume(AudioPlayer_GetCurrentVolume() + 1);
} else {
Bluetooth_SetVolume(Bluetooth_GetCurrentVolume() + 1);
}
break;
}
case CMD_VOLUMEDOWN: {
if (System_UsesLocalAudio()) {
AudioPlayer_SetVolume(AudioPlayer_GetCurrentVolume() - 1);
} else {
Bluetooth_SetVolume(Bluetooth_GetCurrentVolume() - 1);
}
break;
}
case CMD_MUTE: {
// Toggle mute: drop the volume to 0 and remember the previous level, restoring it on the
// next press. Local audio only (Bluetooth handles its own volume on the sink/source side).
static uint8_t lastVolume = 0;
if (AudioPlayer_GetCurrentVolume() > 0) {
lastVolume = AudioPlayer_GetCurrentVolume();
AudioPlayer_SetCurrentVolume(0u);
Log_Println("Mute", LOGLEVEL_NOTICE);
} else {
AudioPlayer_SetCurrentVolume(lastVolume); // Reset to last value if mute is pressed again
Log_Println("Unmute", LOGLEVEL_NOTICE);
}
break;
}
case CMD_MEASUREBATTERY: {
#ifdef BATTERY_MEASURE_ENABLE
Battery_LogStatus();
Battery_PublishMQTT();
Led_Indicate(LedIndicatorType::Voltage);
#endif
break;
}
case CMD_SLEEPMODE: {
System_RequestSleep();
break;
}
case CMD_RESTARTSYSTEM: {
System_Restart();
break;
}
case CMD_FIRMWARE_UPDATE: {
Web_TriggerGithubOta();
System_IndicateOk();
break;
}
case CMD_RFID_SYNC: {
RfidSync_TriggerFull();
System_IndicateOk();
break;
}
case CMD_BACKUP_UPLOAD: {
Backup_Trigger();
System_IndicateOk();
break;
}
case CMD_TOGGLE_WEBDAV_SERVER: {
if (Webdav_IsServerRunning()) {
Webdav_DisableServer();
} else {
Webdav_EnableServer();
}
break;
}
case CMD_SEEK_FORWARDS: {
// Accumulate rather than set a flag: the flag was a single overwrite-able enum consumed once per
// audio-loop iteration, so N detents of a fast rotary spin collapsed into a single jump.
// Read per use (like rotSeekStep in RotaryEncoder.cpp) so a change in the web UI applies at once.
AudioPlayer_AddSeekOffset(static_cast<int16_t>(gPrefsSettings.getUChar("jumpOffset", SEEK_STEP_BUTTON_DEFAULT)));
break;
}
case CMD_SEEK_BACKWARDS: {
AudioPlayer_AddSeekOffset(-static_cast<int16_t>(gPrefsSettings.getUChar("jumpOffset", SEEK_STEP_BUTTON_DEFAULT)));
break;
}
case CMD_SEEK_PREVIEW: {
// Rotary-gesture-only: RotaryEncoder.cpp intercepts this command directly (it needs the raw,
// bidirectional detent delta to move a preview target, not a single fire-and-forget action) and
// never dispatches it here. This case only exists so an unexpected direct dispatch (e.g. a
// misconfigured short/long-press assignment) is a silent no-op instead of falling into "unknown
// command" below.
break;
}
case CMD_OLED_MENU: {
#ifdef OLED_ENABLE
uint16_t selectedCommand = CMD_NOTHING;
if (!Display_MenuPress(&selectedCommand)) {
System_IndicateError();
} else if (selectedCommand != CMD_NOTHING) {
// Dispatch through the normal command path so shutdown countdowns, OTA, MQTT side effects
// and lock handling remain exactly the same. The OLED may keep an OTA result page visible.
Cmd_Action(selectedCommand, bypassLock);
}
#else
System_IndicateError();
#endif
break;
}
case CMD_BRIGHTNESS_UP:
case CMD_BRIGHTNESS_DOWN: {
// Led_SetBrightness() takes a uint8_t and does not bounds-check, so clamping is the caller's job:
// brightness 2 minus a step would otherwise wrap to ~255 and blast a dark room at full power.
const int16_t step = (mod == CMD_BRIGHTNESS_UP) ? LED_BRIGHTNESS_STEP : -static_cast<int16_t>(LED_BRIGHTNESS_STEP);
const int16_t target = static_cast<int16_t>(Led_GetBrightness()) + step;
Led_SetBrightness(static_cast<uint8_t>(std::clamp<int16_t>(target, LED_BRIGHTNESS_MIN, 255)));
Log_Printf(LOGLEVEL_INFO, "LED-brightness: %u", Led_GetBrightness());
break;
}
case CMD_SMART_FORWARDS: {
// Smart forward: in-file seek on a single long file, else next track (decision + coalescing in AudioPlayer_Loop)
if (System_UsesLocalAudio()) {
AudioPlayer_SetTrackControl(SMARTFORWARD);
} else {
Bluetooth_NextTrack();
}
break;
}
case CMD_SMART_BACKWARDS: {
// Smart backward: in-file seek on a single long file, else previous track (decision + coalescing in AudioPlayer_Loop)
if (System_UsesLocalAudio()) {
AudioPlayer_SetTrackControl(SMARTBACKWARD);
} else {
Bluetooth_PreviousTrack();
}
break;
}
case CMD_STOP: {
AudioPlayer_SeekPreviewCancel(); // don't let a stopped track's leftover preview commit onto whatever plays next
AudioPlayer_SetTrackControl(STOP);
break;
}
// Virtual RFID-cards 01..10: synthesize the card-id "9000000000NN" and feed it to the
// RFID queue. Relies on CMD_VIRTUAL_RFID_CARD_* (and the matching VIRTUAL_RFID_CARD_*
// strings in values.h) being contiguous/sequential, so the id is derived from the offset.
case CMD_VIRTUAL_RFID_CARD_01:
case CMD_VIRTUAL_RFID_CARD_02:
case CMD_VIRTUAL_RFID_CARD_03:
case CMD_VIRTUAL_RFID_CARD_04:
case CMD_VIRTUAL_RFID_CARD_05:
case CMD_VIRTUAL_RFID_CARD_06:
case CMD_VIRTUAL_RFID_CARD_07:
case CMD_VIRTUAL_RFID_CARD_08:
case CMD_VIRTUAL_RFID_CARD_09:
case CMD_VIRTUAL_RFID_CARD_10: {
char id[cardIdStringSize];
snprintf(id, sizeof(id), "9000000000%02u", (unsigned) (mod - CMD_VIRTUAL_RFID_CARD_01 + 1));
Rfid_ResetOldRfid();
xQueueSend(gRfidCardQueue, id, 0);
break;
}
case PRINT_TASK_STATS: {
System_esp_print_tasks();
break;
}
default: {
Log_Printf(LOGLEVEL_ERROR, modificatorDoesNotExist, mod);
System_IndicateError();
}
}
}