diff --git a/lib/rdk/getDeviceDetails.sh b/lib/rdk/getDeviceDetails.sh index 372ba4b6..343536fc 100755 --- a/lib/rdk/getDeviceDetails.sh +++ b/lib/rdk/getDeviceDetails.sh @@ -278,8 +278,10 @@ getDeviceSerialNumber() getBluetoothMac() { bluetooth_mac="00:00:00:00:00:00" - if [ "$BLUETOOTH_ENABLED" = "true" ]; then - bluetooth_mac=$(getDeviceBluetoothMac) + if [ -f /lib/rdk/readBTAddress-vendor.sh ]; then + bluetooth_mac=`sh /lib/rdk/readBTAddress-vendor.sh` + else + bluetooth_mac=`sh /lib/rdk/readBTAddress-generic.sh` fi echo "$bluetooth_mac" diff --git a/lib/rdk/readBTAddress-generic.sh b/lib/rdk/readBTAddress-generic.sh new file mode 100644 index 00000000..5fdfc3c4 --- /dev/null +++ b/lib/rdk/readBTAddress-generic.sh @@ -0,0 +1,31 @@ +#!/bin/sh +############################################################################## +# If not stated otherwise in this file or this component's LICENSE file the +# following copyright and licenses apply: +# +# Copyright 2020 RDK Management +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################## +# Purpose: This script is used to fetch device Bluetooth Mac information +# Scope: RDK devices. +# Usage: This script is triggered by a systemd service and shell scripts. + +. /etc/include.properties +. /etc/device.properties +. $RDK_PATH/utils.sh + +if [ "$BLUETOOTH_ENABLED" = "true" ]; then + bluetooth_mac=$(getDeviceBluetoothMac) +fi +echo $bluetooth_mac