HAL_PX4: implement system id without formatting

This commit is contained in:
bugobliterator 2018-09-28 21:14:19 +05:30 committed by Andrew Tridgell
parent bb6b176785
commit 144bbb293f
2 changed files with 12 additions and 1 deletions

View File

@ -132,6 +132,16 @@ bool PX4Util::get_system_id(char buf[40])
return true;
}
bool PX4Util::get_system_id_unformatted(uint8_t buf[], uint8_t &len)
{
uint8_t serialid[12];
get_board_serial(serialid);
len = MIN(12, len);
memcpy(buf, serialid, len);
return true;
}
/**
how much free memory do we have in bytes.
*/

View File

@ -37,7 +37,8 @@ public:
/*
get system identifier (STM32 serial number)
*/
bool get_system_id(char buf[40]);
bool get_system_id(char buf[40]) override;
bool get_system_id_unformatted(uint8_t buf[], uint8_t &len) override;
uint32_t available_memory(void) override;