diff --git a/knx_iot_virtual_pb.c b/knx_iot_virtual_pb.c index 0b51e2d..541c2c1 100644 --- a/knx_iot_virtual_pb.c +++ b/knx_iot_virtual_pb.c @@ -431,7 +431,14 @@ app_init(void) /* set the firmware version 0.7.0 */ oc_core_set_device_fwv(0, 0, 7, 0); - + + char mid[5]; + strncpy(mid, g_serial_number, 5); // mid = first 4 digits of sn + mid[4] = '\0'; + long int mid_num = strtol(mid, NULL, 16); + + /* manufactorer id */ + oc_core_set_device_mid(0, (uint32_t)mid_num); /* set the hardware type*/ // 123456789012 diff --git a/knx_iot_virtual_sa.c b/knx_iot_virtual_sa.c index 1e1d40c..6638023 100644 --- a/knx_iot_virtual_sa.c +++ b/knx_iot_virtual_sa.c @@ -475,6 +475,14 @@ app_init(void) /* set the firmware version 0.7.0 */ oc_core_set_device_fwv(0, 0, 7, 0); + + char mid[5]; + strncpy(mid, g_serial_number, 5); // mid = first 4 digits of sn + mid[4] = '\0'; + long int mid_num = strtol(mid, NULL, 16); + + /* manufactorer id */ + oc_core_set_device_mid(0, (uint32_t)mid_num); /* set the hardware type*/ // 123456789012