[ion] Encode the serial number in Base64

Also, expose serialNumber() in Ion and keep "copySerialNumber" in
Ion::Device. This allows the DFU bootloader to remain .bss-free.
This commit is contained in:
Romain Goyet
2018-05-04 17:06:16 +02:00
committed by Ecco
parent 11ae2da6c5
commit a29c775663
14 changed files with 90 additions and 47 deletions

View File

@@ -192,24 +192,13 @@ void SubController::willDisplayCellForIndex(HighlightCell * cell, int index) {
}
if (m_messageTreeModel->label() == I18n::Message::About) {
myCell->setMessageFontSize(KDText::FontSize::Small);
const char * accessoryMessage = nullptr;
char serialNumber[Ion::SerialNumberLength+1];
switch (index) {
case 0:
accessoryMessage = Ion::softwareVersion();
break;
case 1:
Ion::getSerialNumber(serialNumber);
accessoryMessage = serialNumber;
break;
case 2:
accessoryMessage = Ion::fccId();
break;
default:
assert(false);
break;
}
myCell->setAccessoryText(accessoryMessage);
const char * messages[] = {
Ion::softwareVersion(),
Ion::serialNumber(),
Ion::fccId()
};
assert(index >= 0 && index < 3);
myCell->setAccessoryText(messages[index]);
}
}