@@ -226,6 +226,9 @@ bool commandAT(const char * commandString)
226226 systemPrintln (" ATI10 - Display radio metrics" );
227227 systemPrintln (" ATI11 - Display the system runtime" );
228228 systemPrintln (" ATI12 - Set programming complete" );
229+ systemPrintln (" ATI13 - Display the random seed" );
230+ systemPrintln (" ATI14 - Display the channel table by channel" );
231+ systemPrintln (" ATI15 - Display the channel table by frequency" );
229232
230233 // Virtual circuit information commands
231234 systemPrintln (" ATI30 - Return myVc value" );
@@ -637,6 +640,69 @@ bool commandAT(const char * commandString)
637640 systemWrite (*data++);
638641 }
639642 return true ;
643+
644+ case (' 3' ): // ATI13 - Display the random seed
645+ systemPrint (" myRandSeed: " );
646+ systemPrintln (myRandSeed);
647+ return true ;
648+
649+ case (' 4' ): // ATI14 - Display the channel table by channel
650+ systemPrintln (" Channel Table" );
651+ if (!channels)
652+ systemPrintln (" Channel table not allocated!" );
653+ else
654+ {
655+ for (int index = 0 ; index < settings.numberOfChannels ; index++)
656+ {
657+ systemPrint (" Channel " );
658+ if ((index <= 9 ) && (settings.numberOfChannels >= 10 ))
659+ systemPrint (" " );
660+ systemPrint (index);
661+ systemPrint (" : " );
662+ systemPrint (channels[index],3 );
663+ systemPrintln (" MHz" );
664+ }
665+ }
666+ return true ;
667+
668+ case (' 5' ): // ATI14 - Display the channel table by frequency
669+ systemPrintln (" Channel Table by Frequency" );
670+ if (!channels)
671+ systemPrintln (" Channel table not allocated!" );
672+ else
673+ {
674+ // Initialize the channel array
675+ uint8_t chanIndex[settings.numberOfChannels ];
676+ for (int index = 0 ; index < settings.numberOfChannels ; index++)
677+ chanIndex[index] = index;
678+
679+ // Sort the channel numbers by frequency
680+ for (int index = 0 ; index < (settings.numberOfChannels - 1 ); index++)
681+ {
682+ for (int x = index + 1 ; x < settings.numberOfChannels ; x++)
683+ {
684+ if (channels[chanIndex[index]] > channels[chanIndex[x]])
685+ {
686+ uint8_t f = chanIndex[index];
687+ chanIndex[index] = chanIndex[x];
688+ chanIndex[x] = f;
689+ }
690+ }
691+ }
692+
693+ // Display the frequencies
694+ for (int index = 0 ; index < settings.numberOfChannels ; index++)
695+ {
696+ systemPrint (" Channel " );
697+ if ((chanIndex[index] <= 9 ) && (settings.numberOfChannels >= 10 ))
698+ systemPrint (" " );
699+ systemPrint (chanIndex[index]);
700+ systemPrint (" : " );
701+ systemPrint (channels[chanIndex[index]],3 );
702+ systemPrintln (" MHz" );
703+ }
704+ }
705+ return true ;
640706 }
641707 }
642708 if ((commandString[2 ] == ' I' ) && (commandString[3 ] == ' 3' ) && (commandLength == 5 ))
0 commit comments