You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by gi...@git.apache.org on 2017/08/31 18:05:33 UTC

[GitHub] mkiiskila commented on a change in pull request #512: native; support setting hwid for native target via command line argum?

mkiiskila commented on a change in pull request #512: native; support setting hwid for native target via command line argum?
URL: https://github.com/apache/mynewt-core/pull/512#discussion_r136407246
 
 

 ##########
 File path: hw/mcu/native/src/hal_hw_id.c
 ##########
 @@ -22,20 +22,39 @@
 
 #include "hal/hal_bsp.h"
 
+#include "hal_native_priv.h"
+
 #ifndef min
 #define min(a, b) ((a)<(b)?(a):(b))
 #endif
 
+static uint8_t hal_hw_id[HAL_BSP_MAX_ID_LEN];
+static uint8_t hal_hw_id_len;
+
 /*
  * This can be used as the unique hardware identifier for the platform, as
  * it's supposed to be unique for this particular MCU.
  */
 int
 hal_bsp_hw_id(uint8_t *id, int max_len)
 {
+    if (hal_hw_id_len) {
+        memcpy(id, hal_hw_id, hal_hw_id_len);
 
 Review comment:
   Yes, it should. Lemme fix that.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services