Skip to content

Commit

Permalink
Make stable release of tmo_shell on DevEdge
Browse files Browse the repository at this point in the history
These changes need work with the appropriate experts.

Signed-off-by: Dennis Ruffer <Dennis.Ruffer1@T-Mobile.com>
  • Loading branch information
DRuffer-tmo committed Jun 1, 2023
1 parent 9abcd5e commit 048a655
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
11 changes: 6 additions & 5 deletions samples/tmo_shell/src/tmo_ble_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ static struct bt_data ibeacon_custom[2] = {

#if CONFIG_WIFI

/* DaR TODO Removed What now?
static struct net_mgmt_event_callback ble_demo_mgmt_cb;
static void ble_sample_wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb,
Expand All @@ -765,7 +766,7 @@ static void ble_sample_wifi_mgmt_event_handler(struct net_mgmt_event_callback *c
ssid_len = res->ssid_length;
rssi = res->rssi;
}
}
} */

void ble_wifi_status_retrieve(void *a, void *b, void *c)
{
Expand All @@ -774,9 +775,9 @@ void ble_wifi_status_retrieve(void *a, void *b, void *c)
ARG_UNUSED(c);
while (1) {
k_sem_take(&wifi_status_refresh_sem, K_FOREVER);
struct net_if *iface = net_if_get_by_index(2); //Hardcoded for now
/* struct net_if *iface = net_if_get_by_index(2); Hardcoded for now */

net_mgmt(NET_REQUEST_WIFI_STATUS, iface, NULL, 0);
/* net_mgmt(NET_REQUEST_WIFI_STATUS, iface, NULL, 0); DaR TODO ? */
}
}

Expand Down Expand Up @@ -933,12 +934,12 @@ static int tmo_ble_demo_init()
}
}

#ifdef CONFIG_WIFI
#if 0 /* DaR TODO def CONFIG_WIFI */
net_mgmt_init_event_callback(&ble_demo_mgmt_cb,
ble_sample_wifi_mgmt_event_handler,
NET_EVENT_WIFI_STATUS_RESULT);

net_mgmt_add_event_callback(&ble_demo_mgmt_cb);
net_mgmt_add_event_callback(&ble_demo_mgmt_cb);
#endif
setup_buttons();

Expand Down
2 changes: 1 addition & 1 deletion samples/tmo_shell/src/tmo_http_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ int tmo_http_download(int devid, char url[], char filename[], char *auth_key)
req.response = response_cb_download;
req.recv_buf = mxfer_buf;
req.recv_buf_len = 4096;
req.packet_timeout = 10000;
/* req.packet_timeout = 10000; DaR TODO Where is this */

ret = tmo_offload_init(devid);
if (ret != 0) {
Expand Down
15 changes: 9 additions & 6 deletions samples/tmo_shell/src/tmo_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,15 @@ static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb)

bool status_requested = false;

/* DaR TODO Unused
static void handle_wifi_status_result(struct net_mgmt_event_callback *cb)
{
if (!status_requested) {
return;
} else {
status_requested = false;
}
const struct wifi_status_result *entry =
(const struct wifi_status_result *)cb->info;
Expand All @@ -195,7 +197,7 @@ static void handle_wifi_status_result(struct net_mgmt_event_callback *cb)
"\n%-4s | %-12s | %-32s %-5s | %-4s | %-4s | %-5s | %-15s | %s\n",
"Mode", "State", "SSID", "(len)", "Chan", "RSSI", "Sec", "IPv4", "IPv6");
bool has_ip6 = entry->ip6.s6_addr32[0] || entry->ip6.s6_addr32[1]
|| entry->ip6.s6_addr32[2] || entry->ip6.s6_addr32[3];
|| entry->ip6.s6_addr32[2] || entry->ip6.s6_addr32[3];
print(context.shell, SHELL_NORMAL, "%-4s | %-12s | %-32s %-5u | %-4u | %-4d | %-5s | %-15s | %s\n",
(entry->ap_mode ? " AP" : " ST"),
(entry->connected ? "Connected" : "Disconnected"),
Expand All @@ -207,8 +209,8 @@ static void handle_wifi_status_result(struct net_mgmt_event_callback *cb)
sizeof(ip4_string_buf)) : ""),
((has_ip6) ?
net_addr_ntop(AF_INET6, &entry->ip6, ip6_string_buf,
sizeof(ip6_string_buf)) : ""));
}
sizeof(ip6_string_buf)) : ""));
} */

static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
Expand All @@ -226,9 +228,10 @@ static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb,
case NET_EVENT_WIFI_DISCONNECT_RESULT:
handle_wifi_disconnect_result(cb);
break;
/* DaR TODO
case NET_EVENT_WIFI_STATUS_RESULT:
handle_wifi_status_result(cb);
break;
break; */
default:
break;
}
Expand Down Expand Up @@ -447,12 +450,12 @@ int cmd_wifi_status(const struct shell *shell, size_t argc, char *argv[])
#endif

context.shell = shell;

/* DaR TODO Remove Now what?
if (net_mgmt(NET_REQUEST_WIFI_STATUS, iface, NULL, 0)) {
shell_fprintf(shell, SHELL_WARNING, "Status request failed\n");
return -ENOEXEC;
}
} */
return 0;
}

Expand Down

0 comments on commit 048a655

Please sign in to comment.