blob: 33fb7d05a8f8096ff057f60f7585e1f1c26f61d1 [file] [log] [blame]
developerfb688182022-06-08 14:48:19 +08001From 9cb7739f4c26a770b76a6694f6e2b483f492e337 Mon Sep 17 00:00:00 2001
2From: "Allen.Ye" <allen.ye@mediatek.com>
3Date: Wed, 8 Jun 2022 10:36:58 +0800
4Subject: [PATCH] Add tdk utility functions
5
6---
7 platform/turris/agent/scripts/tdk_platform_utility.sh | 36 ++++++++++++++++++++++++---
8 1 file changed, 32 insertions(+), 4 deletions(-)
9
10diff --git a/platform/turris/agent/scripts/tdk_platform_utility.sh b/platform/turris/agent/scripts/tdk_platform_utility.sh
11index fefc194..210d8a9 100755
12--- a/platform/turris/agent/scripts/tdk_platform_utility.sh
13+++ b/platform/turris/agent/scripts/tdk_platform_utility.sh
14@@ -37,17 +37,45 @@ getCMMACAddress()
15 echo $macaddress
16 }
17
18+getAp0DTIMInterval()
19+{
20+ hostapd_cli -i wifi0 status| grep -i dtim | cut -d '=' -f2
21+}
22+
23+getAp1DTIMInterval()
24+{
25+ hostapd_cli -i wifi1 status| grep -i dtim | cut -d '=' -f2
26+}
27+
28+getAp0BeaconInterval()
29+{
30+ hostapd_cli -i wifi0 status | grep beacon_int | cut -d '=' -f2
31+}
32+
33+getAp1BeaconInterval()
34+{
35+ hostapd_cli -i wifi0 status | grep beacon_int | cut -d '=' -f2
36+}
37+
38 # Store the arguments to a variable
39 event=$1
40 processName=$2
41
42 # Invoke the function based on the argument passed
43 case $event in
44- "checkProcess")
45+ "checkProcess")
46 checkProcess;;
47- "killProcess")
48+ "killProcess")
49 killProcess;;
50- "getCMMACAddress")
51+ "getCMMACAddress")
52 getCMMACAddress;;
53- *) echo "Invalid Argument passed";;
54+ "getAp0DTIMInterval")
55+ getAp0DTIMInterval;;
56+ "getAp1DTIMInterval")
57+ getAp1DTIMInterval;;
58+ "getAp0BeaconInterval")
59+ getAp0BeaconInterval;;
60+ "getAp1BeaconInterval")
61+ getAp1BeaconInterval;;
62+ *) echo "Invalid Argument passed";;
63 esac
64--
652.18.0
66