|
@@ -0,0 +1,35 @@
|
|
|
+/*
|
|
|
+ * stm32_uid.c
|
|
|
+ *
|
|
|
+ * Created on: 25.07.2016
|
|
|
+ * Author: balbekova
|
|
|
+ */
|
|
|
+
|
|
|
+#include "stm32_uid.h"
|
|
|
+
|
|
|
+#ifdef PRINTF_STDLIB
|
|
|
+#include <stdio.h>
|
|
|
+#endif
|
|
|
+#ifdef PRINTF_CUSTOM
|
|
|
+#include "tinystdio.h"
|
|
|
+#endif
|
|
|
+
|
|
|
+#include <string.h>
|
|
|
+
|
|
|
+
|
|
|
+void GetSTM32IDStr(char* str, uint8_t* len)
|
|
|
+{
|
|
|
+ uint8_t i;
|
|
|
+ char TempStr[33];
|
|
|
+
|
|
|
+ memset(TempStr, 0, 33);
|
|
|
+ for(i = 0; i < 12; i++)
|
|
|
+ {
|
|
|
+ sprintf(TempStr, "%02X", STM32_UUID[i]);
|
|
|
+ *len = strlen(TempStr);
|
|
|
+ strncat(str, TempStr, *len);
|
|
|
+ }
|
|
|
+ *len = strlen(str);
|
|
|
+}
|
|
|
+
|
|
|
+
|