HAL_ChibiOS: make serial number match HAL_PX4

This commit is contained in:
Andrew Tridgell 2018-07-06 07:53:31 +10:00
parent 57598e5b9f
commit fbf24f0492

View File

@ -252,12 +252,11 @@ bool Util::get_system_id(char buf[40])
strncpy(board_name, CHIBIOS_SHORT_BOARD_NAME, 13);
board_name[13] = 0;
// this format is chosen to match the human_readable_serial()
// function in auth.c
// this format is chosen to match the format used by HAL_PX4
snprintf(buf, 40, "%s %02X%02X%02X%02X %02X%02X%02X%02X %02X%02X%02X%02X",
board_name,
(unsigned)serialid[0], (unsigned)serialid[1], (unsigned)serialid[2], (unsigned)serialid[3],
(unsigned)serialid[4], (unsigned)serialid[5], (unsigned)serialid[6], (unsigned)serialid[7],
(unsigned)serialid[8], (unsigned)serialid[9], (unsigned)serialid[10],(unsigned)serialid[11]);
(unsigned)serialid[3], (unsigned)serialid[2], (unsigned)serialid[1], (unsigned)serialid[0],
(unsigned)serialid[7], (unsigned)serialid[6], (unsigned)serialid[5], (unsigned)serialid[4],
(unsigned)serialid[11], (unsigned)serialid[10], (unsigned)serialid[9],(unsigned)serialid[8]);
return true;
}