Skip to content

Commit 65d2584

Browse files
authored
Merge pull request #221 from ksaipr036/978
RDKBACCL-978: Modifying the speedtest-client binary to RefSpeedtestClient
2 parents ad6fbbf + 6743810 commit 65d2584

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include recipes-ccsp/ccsp/ccsp_common_bananapi.inc
22

3+
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
4+
SRC_URI += "file://SpeedReference.sh"
5+
36
do_install_append () {
4-
install -m 0755 ${S}/scripts/speedtest.sh ${D}/usr/ccsp/tad
7+
install -m 755 ${WORKDIR}/SpeedReference.sh ${D}/usr/ccsp/tad/speedtest.sh
58
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#This script is used to enable / start the speedtest tool
2+
LOG_FILE=/rdklogs/logs/speedtest-init.log
3+
4+
log_message() {
5+
echo "$(date +"[%Y-%m-%d %H:%M:%S]") $1" >> $LOG_FILE
6+
}
7+
8+
execute_speedtest() {
9+
log_message "$1"
10+
$2
11+
}
12+
13+
log_message "Enabling / Starting speedtest..."
14+
. /etc/device.properties
15+
16+
# If Device.IP.Diagnostics.X_RDKCENTRAL-COM_SpeedTest.ClientType exists, then:
17+
# Device.IP.Diagnostics.X_RDKCENTRAL-COM_SpeedTest.ClientType = 1 implies the C client should run.
18+
ST_CLIENT_TYPE=`dmcli eRT retv Device.IP.Diagnostics.X_RDKCENTRAL-COM_SpeedTest.ClientType`
19+
server_ip=`dmcli eRT retv Device.IP.Diagnostics.X_RDKCENTRAL-COM_SpeedTest.Argument`
20+
21+
if [ "x$ST_CLIENT_TYPE" = 'x1' ]; then
22+
if [ -f /usr/bin/RefSpeedtestClient ]; then
23+
if [ ! -z "$server_ip" ]; then
24+
execute_speedtest "Executing speedtest-client-c for $Box_Type" "nice -n 19 /usr/bin/RefSpeedtestClient $server_ip"
25+
else
26+
execute_speedtest "Executing speedtest-client-c for $BOX_TYPE" "nice -n 19 /usr/bin/RefSpeedtestClient"
27+
fi
28+
else
29+
log_message "Unsupported device model"
30+
fi
31+
else
32+
log_message "Unsupported client"
33+
fi

0 commit comments

Comments
 (0)