mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-05 07:28:29 -04:00
HAL_ChibiOS: report system ID in mavlink and logs
This commit is contained in:
parent
eb2c9dfe74
commit
e5435e02ad
@ -240,3 +240,24 @@ bool Util::flash_bootloader()
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
display system identifer - board type and serial number
|
||||
*/
|
||||
bool Util::get_system_id(char buf[40])
|
||||
{
|
||||
uint8_t serialid[12];
|
||||
char board_name[14];
|
||||
|
||||
memcpy(serialid, (const void *)UDID_START, 12);
|
||||
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
|
||||
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]);
|
||||
return true;
|
||||
}
|
||||
|
@ -44,6 +44,9 @@ public:
|
||||
void set_imu_temp(float current);
|
||||
void set_imu_target_temp(int8_t *target);
|
||||
|
||||
// get system ID as a string
|
||||
bool get_system_id(char buf[40]) override;
|
||||
|
||||
#ifdef HAL_PWM_ALARM
|
||||
bool toneAlarm_init();
|
||||
void toneAlarm_set_tune(uint8_t tone);
|
||||
|
Loading…
Reference in New Issue
Block a user