Skip to content

Commit

Permalink
Work for #17 : Now we have ssid
Browse files Browse the repository at this point in the history
  • Loading branch information
npyl committed Aug 19, 2018
1 parent a4cb740 commit 9964b9d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/darwin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,24 @@ int update_meminfo() {
#ifdef BUILD_WLAN

void update_wlan_stats(struct net_stat *ns) {
CWWiFiClient *client = [CWWiFiClient sharedWiFiClient];
CWInterface *interface = [client interfaceWithName:[NSString stringWithUTF8String:ns->dev]];

if (!interface)
return;

const char *essid = [interface ssid].UTF8String;

if (essid == nullptr)
return;

/*
* Setup
*/
memcpy(ns->essid, essid, sizeof(char)*strlen(essid));
}

#endif
#endif /* BUILD_WLAN */

int update_net_stats() {
struct net_stat *ns;
Expand Down

0 comments on commit 9964b9d

Please sign in to comment.