From f24a052355885877e8f16f55cd31b486124d2004 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 7 Sep 2017 13:21:45 -1000 Subject: [PATCH] board_common:Add PX4 GUID, deprecate other UUID API The form of the PX4 GUID is as follows: offset:0 1 2 - 17 ... Where are a monotonic ordinal number assigned by PX4 to a chip architecture (PX4_SOC_ARCH_ID). The 2 bytes are used to create a globally unique ID when prepended to a padded CPU ID. In the case where the CPU's UUID is shorter than 16 bytes it will be padded with 0's starting at offset [2] until PX4_CPU_MFGUID_BYTE_LENGTH-PX4_CPU_UUID_BYTE_LENGTH -1 I.E. For the STM32 offset:0 1 2 3 4 5 6 - 17 [0][0][0][0]... I.E. For as CPU with a 16 byte UUID offset:0 1 2 - 17 ... --- src/drivers/boards/common/board_common.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/drivers/boards/common/board_common.h b/src/drivers/boards/common/board_common.h index 672de0e8f9..552cbd9ad9 100644 --- a/src/drivers/boards/common/board_common.h +++ b/src/drivers/boards/common/board_common.h @@ -321,7 +321,6 @@ typedef enum board_power_button_state_notification_e { typedef int (*power_button_state_notification_t)(board_power_button_state_notification_e request); - /* UUID * * Define the types used for board UUID, MFG UID and PX4 GUID @@ -742,7 +741,6 @@ __EXPORT int board_get_hw_revision(void); #define board_get_hw_revision() (-1) #endif -#if !defined(BOARD_OVERRIDE_UUID) /************************************************************************************ * Name: board_get_uuid DEPRICATED use board_get_px4_guid * @@ -818,9 +816,7 @@ __EXPORT void board_get_uuid32(uuid_uint32_t uuid_words); // DEPRICATED use boar __EXPORT int board_get_uuid32_formated(char *format_buffer, int size, const char *format, const char *seperator); // DEPRICATED use board_get_px4_guid_formated -#endif // !defined(BOARD_OVERRIDE_UUID) -#if !defined(BOARD_OVERRIDE_MFGUID) /************************************************************************************ * Name: board_get_mfguid * @@ -861,19 +857,19 @@ int board_get_mfguid(mfguid_t mfgid); ************************************************************************************/ int board_get_mfguid_formated(char *format_buffer, int size); // DEPRICATED use board_get_px4_guid_formated -#endif // !defined(BOARD_OVERRIDE_MFGUID) -#if !defined(BOARD_OVERRIDE_PX4_GUID) /************************************************************************************ * Name: board_get_px4_guid * * Description: * All boards either provide a way to retrieve a PX4 Globally unique ID or * define BOARD_OVERRIDE_PX4_GUID. + * The GUID is returned as an array of bytes in MSD @ index 0 - LSD @ index + * PX4_PX4_GUID_BYTE_LENGTH-1 * * The form of the GUID is as follows: * offset:0 1 2 - 17 - * ... + * ... * * * Where are a monotonic ordinal number assigned by * PX4 to a chip architecture (PX4_SOC_ARCH_ID). The 2 bytes are used to @@ -924,7 +920,6 @@ int board_get_px4_guid(px4_guid_t guid); ************************************************************************************/ int board_get_px4_guid_formated(char *format_buffer, int size); -#endif // !defined(BOARD_OVERRIDE_PX4_GUID) /************************************************************************************ * Name: board_mcu_version