developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 1 | From 352aa2e4a0ff90ef04957c3ba729d5c12716c9d1 Mon Sep 17 00:00:00 2001 |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 2 | From: "Allen.Ye" <allen.ye@mediatek.com> |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 3 | Date: Fri, 18 Nov 2022 17:51:13 +0800 |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 4 | Subject: [PATCH] Add tdk utility functions |
| 5 | |
| 6 | --- |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 7 | .../agent/scripts/tdk_platform_utility.sh | 50 +++++++++++++++++-- |
| 8 | 1 file changed, 46 insertions(+), 4 deletions(-) |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 9 | |
| 10 | diff --git a/platform/turris/agent/scripts/tdk_platform_utility.sh b/platform/turris/agent/scripts/tdk_platform_utility.sh |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 11 | index fefc1947..94917ef4 100755 |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 12 | --- a/platform/turris/agent/scripts/tdk_platform_utility.sh |
| 13 | +++ b/platform/turris/agent/scripts/tdk_platform_utility.sh |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 14 | @@ -37,17 +37,59 @@ getCMMACAddress() |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 15 | echo $macaddress |
| 16 | } |
| 17 | |
| 18 | +getAp0DTIMInterval() |
| 19 | +{ |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 20 | + hostapd_cli -i wifi0 status| grep -i ^dtim | cut -d '=' -f2 |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 21 | +} |
| 22 | + |
| 23 | +getAp1DTIMInterval() |
| 24 | +{ |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 25 | + hostapd_cli -i wifi1 status| grep -i ^dtim | cut -d '=' -f2 |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 26 | +} |
| 27 | + |
| 28 | +getAp0BeaconInterval() |
| 29 | +{ |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 30 | + hostapd_cli -i wifi0 status | grep ^beacon_int | cut -d '=' -f2 |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 31 | +} |
| 32 | + |
| 33 | +getAp1BeaconInterval() |
| 34 | +{ |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 35 | + hostapd_cli -i wifi1 status | grep ^beacon_int | cut -d '=' -f2 |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 36 | +} |
| 37 | + |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 38 | +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 | + |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 48 | # 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;; |
developer | 4a52904 | 2022-11-18 16:45:14 +0800 | [diff] [blame] | 72 | + "getRadio0ObssCoexistenceEnable") |
| 73 | + getRadio0ObssCoexistenceEnable;; |
| 74 | + "getRadio1ObssCoexistenceEnable") |
| 75 | + getRadio1ObssCoexistenceEnable;; |
developer | fb68818 | 2022-06-08 14:48:19 +0800 | [diff] [blame] | 76 | + *) echo "Invalid Argument passed";; |
| 77 | esac |
| 78 | -- |
| 79 | 2.18.0 |
| 80 | |