Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions Firmware/LoRaSerial/Commands.ino
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,15 @@ bool commandAT(const char * commandString)
systemPrintln(" ATI10 - Display radio metrics");
systemPrintln(" ATI11 - Display the system runtime");
systemPrintln(" ATI12 - Set programming complete");
systemPrintln(" ATI13 - Display the random seed");
systemPrintln(" ATI14 - Display the channel table by channel");
systemPrintln(" ATI15 - Display the channel table by frequency");

//Virtual circuit information commands
systemPrintln(" ATI30 - Return myVc value");
systemPrintln(" ATI31 - Display the VC details");
systemPrintln(" ATI32 - Dump the NVM unique ID table");
systemPrintln(" ATI33 - Display the VC states");
return true;

case ('0'): //ATI0 - Show user settable parameters
Expand Down Expand Up @@ -637,6 +641,69 @@ bool commandAT(const char * commandString)
systemWrite(*data++);
}
return true;

case ('3'): //ATI13 - Display the random seed
systemPrint("myRandSeed: ");
systemPrintln(myRandSeed);
return true;

case ('4'): //ATI14 - Display the channel table by channel
systemPrintln("Channel Table");
if (!channels)
systemPrintln(" Channel table not allocated!");
else
{
for (int index = 0; index < settings.numberOfChannels; index++)
{
systemPrint(" Channel ");
if ((index <= 9) && (settings.numberOfChannels >= 10))
systemPrint(" ");
systemPrint(index);
systemPrint(": ");
systemPrint(channels[index],3);
systemPrintln(" MHz");
}
}
return true;

case ('5'): //ATI14 - Display the channel table by frequency
systemPrintln("Channel Table by Frequency");
if (!channels)
systemPrintln(" Channel table not allocated!");
else
{
//Initialize the channel array
uint8_t chanIndex[settings.numberOfChannels];
for (int index = 0; index < settings.numberOfChannels; index++)
chanIndex[index] = index;

//Sort the channel numbers by frequency
for (int index = 0; index < (settings.numberOfChannels - 1); index++)
{
for (int x = index + 1; x < settings.numberOfChannels; x++)
{
if (channels[chanIndex[index]] > channels[chanIndex[x]])
{
uint8_t f = chanIndex[index];
chanIndex[index] = chanIndex[x];
chanIndex[x] = f;
}
}
}

//Display the frequencies
for (int index = 0; index < settings.numberOfChannels; index++)
{
systemPrint(" Channel ");
if ((chanIndex[index] <= 9) && (settings.numberOfChannels >= 10))
systemPrint(" ");
systemPrint(chanIndex[index]);
systemPrint(": ");
systemPrint(channels[chanIndex[index]],3);
systemPrintln(" MHz");
}
}
return true;
}
}
if ((commandString[2] == 'I') && (commandString[3] == '3') && (commandLength == 5))
Expand Down Expand Up @@ -769,6 +836,17 @@ bool commandAT(const char * commandString)
systemPrintln("Empty");
}
return true;

case ('3'): //ATI33 - Display the VC states
for (int vcIndex = 0; vcIndex < MAX_VC; vcIndex++)
{
systemPrint("VC ");
systemPrint(vcIndex);
systemPrint(": ");
systemPrintln(vcStateNames[virtualCircuitList[vcIndex].vcState]);
}
return true;

}
}
if ((commandString[2] == 'I') && (commandString[3] == '5') && (commandLength == 5))
Expand Down
3 changes: 3 additions & 0 deletions Firmware/LoRaSerial/LoRaSerial.ino
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ float *channels;
uint8_t channelNumber = 0;
uint32_t airSpeed;

uint16_t myRandSeed;
bool myRandBit;

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//Encryption
Expand Down
3 changes: 0 additions & 3 deletions Firmware/LoRaSerial/Radio.ino
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,6 @@ uint16_t calcMaxThroughput()
return (mostBytesPerSecond);
}

uint16_t myRandSeed;
bool myRandBit;

//Generate unique hop table based on radio settings
void generateHopTable()
{
Expand Down
2 changes: 1 addition & 1 deletion Firmware/LoRaSerial/Serial.ino
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void updateSerial()

//Assert RTS when there is enough space in the receive buffer
if ((!rtsAsserted) && (availableRXBytes() < (sizeof(serialReceiveBuffer) / 2))
&& (availableTXBytes() <= RTS_ON_BYTES))
&& (availableTXBytes() <= settings.rtsOnBytes))
updateRTS(true); //We're ready for more data

//Attempt to empty the serialTransmitBuffer
Expand Down
Loading