From 75468723950eeec1a8b20d2f5051739e084a4af7 Mon Sep 17 00:00:00 2001
From: Wojciech Zmuda <wojciech.zmuda@huawei.com>
Date: Tue, 20 Apr 2021 23:37:53 +0200
Subject: [PATCH] zephyr-blueprint-smarthome-sensors: substitute MAC address of
 a device

Multiple IoT devices in the Smart Home blueprint are to be
programmed with firmware built from the same sources. That
sources specify MAC address of the BLE interface of the device.
Multiple devices cannot work at once with the same MAC, so in
that case user should have possibility to specify the address
in build time.

Variable SMART_HOME_SENSORS_MAC can be provided to Bitbake.
If detected, its value is used as MAC address for devices
using zephyr-blueprint-smarthome-sensors image.

Signed-off-by: Wojciech Zmuda <wojciech.zmuda@huawei.com>
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 .../zephyr-kernel/zephyr-blueprint-smarthome-sensors.bb         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta-ohos-blueprints/recipes-kernel/zephyr-kernel/zephyr-blueprint-smarthome-sensors.bb b/meta-ohos-blueprints/recipes-kernel/zephyr-kernel/zephyr-blueprint-smarthome-sensors.bb
index f4648261..6cc6c0c3 100644
--- a/meta-ohos-blueprints/recipes-kernel/zephyr-kernel/zephyr-blueprint-smarthome-sensors.bb
+++ b/meta-ohos-blueprints/recipes-kernel/zephyr-kernel/zephyr-blueprint-smarthome-sensors.bb
@@ -8,6 +8,8 @@ SUMMARY = "SmartHome blueprint image: sensors"
 DESCRIPTION = "Zephyr based image targeting sensors board"
 LICENSE = "Apache-2.0"
 
+MAC = "${SMART_HOME_SENSORS_MAC}"
+
 # Comment out features not used by this image
 do_configure_append() {
 	sed -i '/^CONFIG_GROVE_LED_CTRL/ s/./#&/' ${ZEPHYR_SRC_DIR}/prj.conf
-- 
GitLab