blob: 860b873cbae6c78dea61d87bb76adc1fa8363683 [file] [log] [blame]
developer4a529042022-11-18 16:45:14 +08001From 352aa2e4a0ff90ef04957c3ba729d5c12716c9d1 Mon Sep 17 00:00:00 2001
developerfb688182022-06-08 14:48:19 +08002From: "Allen.Ye" <allen.ye@mediatek.com>
developer4a529042022-11-18 16:45:14 +08003Date: Fri, 18 Nov 2022 17:51:13 +0800
developerfb688182022-06-08 14:48:19 +08004Subject: [PATCH] Add tdk utility functions
5
6---
developer4a529042022-11-18 16:45:14 +08007 .../agent/scripts/tdk_platform_utility.sh | 50 +++++++++++++++++--
8 1 file changed, 46 insertions(+), 4 deletions(-)
developerfb688182022-06-08 14:48:19 +08009
10diff --git a/platform/turris/agent/scripts/tdk_platform_utility.sh b/platform/turris/agent/scripts/tdk_platform_utility.sh
developer4a529042022-11-18 16:45:14 +080011index fefc1947..94917ef4 100755
developerfb688182022-06-08 14:48:19 +080012--- a/platform/turris/agent/scripts/tdk_platform_utility.sh
13+++ b/platform/turris/agent/scripts/tdk_platform_utility.sh
developer4a529042022-11-18 16:45:14 +080014@@ -37,17 +37,59 @@ getCMMACAddress()
developerfb688182022-06-08 14:48:19 +080015 echo $macaddress
16 }
17
18+getAp0DTIMInterval()
19+{
developer4a529042022-11-18 16:45:14 +080020+ hostapd_cli -i wifi0 status| grep -i ^dtim | cut -d '=' -f2
developerfb688182022-06-08 14:48:19 +080021+}
22+
23+getAp1DTIMInterval()
24+{
developer4a529042022-11-18 16:45:14 +080025+ hostapd_cli -i wifi1 status| grep -i ^dtim | cut -d '=' -f2
developerfb688182022-06-08 14:48:19 +080026+}
27+
28+getAp0BeaconInterval()
29+{
developer4a529042022-11-18 16:45:14 +080030+ hostapd_cli -i wifi0 status | grep ^beacon_int | cut -d '=' -f2
developerfb688182022-06-08 14:48:19 +080031+}
32+
33+getAp1BeaconInterval()
34+{
developer4a529042022-11-18 16:45:14 +080035+ hostapd_cli -i wifi1 status | grep ^beacon_int | cut -d '=' -f2
developerfb688182022-06-08 14:48:19 +080036+}
37+
developer4a529042022-11-18 16:45:14 +080038+getRadio0ObssCoexistenceEnable()
39+{
40+ cat /nvram/hostapd0.conf | grep ^ht_coex | cut -d '=' -f2
41+}
42+
43+getRadio1ObssCoexistenceEnable()
44+{
45+ cat /nvram/hostapd1.conf | grep ^ht_coex | cut -d '=' -f2
46+}
47+
developerfb688182022-06-08 14:48:19 +080048 # Store the arguments to a variable
49 event=$1
50 processName=$2
51
52 # Invoke the function based on the argument passed
53 case $event in
54- "checkProcess")
55+ "checkProcess")
56 checkProcess;;
57- "killProcess")
58+ "killProcess")
59 killProcess;;
60- "getCMMACAddress")
61+ "getCMMACAddress")
62 getCMMACAddress;;
63- *) echo "Invalid Argument passed";;
64+ "getAp0DTIMInterval")
65+ getAp0DTIMInterval;;
66+ "getAp1DTIMInterval")
67+ getAp1DTIMInterval;;
68+ "getAp0BeaconInterval")
69+ getAp0BeaconInterval;;
70+ "getAp1BeaconInterval")
71+ getAp1BeaconInterval;;
developer4a529042022-11-18 16:45:14 +080072+ "getRadio0ObssCoexistenceEnable")
73+ getRadio0ObssCoexistenceEnable;;
74+ "getRadio1ObssCoexistenceEnable")
75+ getRadio1ObssCoexistenceEnable;;
developerfb688182022-06-08 14:48:19 +080076+ *) echo "Invalid Argument passed";;
77 esac
78--
792.18.0
80