[rdkb][common][app][Add tx and rx antenna uci commands]
[Description]
Add tx and rx antenna uci commands for wifi-test-tool.
[Release-log]
N/A
Change-Id: Ib91c6de7ba95c16c654776dfe8c1ce577d8943ec
diff --git a/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c b/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c
index f1e4c1f..84cdc92 100644
--- a/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c
+++ b/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c
@@ -156,6 +156,16 @@
radio_param->disabled = FALSE;
}
+void set_rxant(wifi_radio_param *radio_param, char *mask)
+{
+ radio_param->rxantenna = strtol(mask, NULL, 16);
+}
+
+void set_txant(wifi_radio_param *radio_param, char *mask)
+{
+ radio_param->txantenna = strtol(mask, NULL, 16);
+}
+
void set_radionum(wifi_intf_param *intf_param, char *phy_name)
{
int radio_num = 0;
@@ -272,6 +282,12 @@
fprintf(stderr, "Start setting radio\n");
+ if (radio_parameter.txantenna != 0 && radio_parameter.txantenna == radio_parameter.rxantenna) {
+ ret = wifi_setRadioTxChainMask(radio_parameter.radio_index, radio_parameter.txantenna);
+ if (ret != RETURN_OK)
+ fprintf(stderr, "[Set Tx Chain mask failed!!!]\n");
+ }
+
// Get current radio setting
ret = wifi_getRadioOperatingParameters(radio_parameter.radio_index, &operationParam);
if (ret != RETURN_OK)
@@ -529,6 +545,10 @@
set_country(&radio_param, op->v.string);
else if (strcmp(op->e.name, "noscan") == 0)
set_noscan(&radio_param, op->v.string);
+ else if (strcmp(op->e.name, "rxantenna") == 0)
+ set_rxant(&radio_param, op->v.string);
+ else if (strcmp(op->e.name, "txantenna") == 0)
+ set_txant(&radio_param, op->v.string);
else
fprintf(stderr, "[%s %s not set!]\n", op->e.name, op->v.string);
} else {