diff options
author | Aylur <[email protected]> | 2024-08-04 00:13:02 +0200 |
---|---|---|
committer | Aylur <[email protected]> | 2024-08-04 00:13:02 +0200 |
commit | 99e46734e2a23a2bb9d1aa6e1775eda85105ce0e (patch) | |
tree | 47f125694cbc67681c5d65fa538066c3d03558f3 /src/accesspoint.vala | |
parent | 7662145390f87dc6e50286e9e3458d2b41b33577 (diff) |
add: custom accesspoint
Diffstat (limited to 'src/accesspoint.vala')
-rw-r--r-- | src/accesspoint.vala | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/accesspoint.vala b/src/accesspoint.vala new file mode 100644 index 0000000..cc2eb4b --- /dev/null +++ b/src/accesspoint.vala @@ -0,0 +1,37 @@ +public class AstalNetwork.AccessPoint : Object { + private Wifi wifi; + private NM.AccessPoint ap; + + public uint bandwidth { get { return ap.bandwidth; } } + public string bssid { owned get { return ap.bssid; } } + public uint frequency { get { return ap.frequency; } } + public int last_seen { get { return ap.last_seen; } } + public uint max_bitrate { get { return ap.max_bitrate; } } + public uint8 strength { get { return ap.strength; } } + public NM.80211Mode mode { get { return ap.mode; } } + public NM.80211ApFlags flags { get { return ap.flags; } } + public NM.80211ApSecurityFlags rsn_flags { get { return ap.rsn_flags; } } + public NM.80211ApSecurityFlags wpa_flags { get { return ap.wpa_flags; } } + + public string? ssid { + owned get { + if (ap.ssid == null) + return null; + + return (string)NM.Utils.ssid_to_utf8(ap.ssid.get_data()); + } + } + + internal AccessPoint(Wifi wifi, NM.AccessPoint ap) { + this.wifi = wifi; + this.ap = ap; + ap.notify.connect((pspec) => { + if (get_class().find_property(pspec.name) != null) + notify_property(pspec.name); + }); + } + + // TODO: connect to ap + // public signal void auth(); + // public void try_connect(string? password) { } +} |