Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand the remove_network_profile() API #27

Closed
lxjmaster opened this issue May 26, 2018 · 1 comment
Closed

Expand the remove_network_profile() API #27

lxjmaster opened this issue May 26, 2018 · 1 comment

Comments

@lxjmaster
Copy link

lxjmaster commented May 26, 2018

Inherit WifiUtil class from _wifiutil_win and add the following code in your subclass.

def remove_network_profile(self, obj, name):
"""Remove the specified AP settings."""

profile_name_list = super().network_profile_name_list(obj)
for profile_name in profile_name_list:
    if name == profile_name:
       super()._logger.debug("delete profile: %s", profile_name)
       str_buf = create_unicode_buffer(profile_name)
       ret = super()._wlan_delete_profile(super()._handle, obj['guid'], str_buf)
       super()._logger.debug("delete result %d", ret)
   else:
       pass

And then,use the method remove_network_profile(iface._raw_obj,profile.ssid) to remove the profile.
The iface is a interface object.

@lxjmaster lxjmaster changed the title 拓展remove_network_profile Expand the remove_network_profile() API May 29, 2018
@awkman
Copy link
Owner

awkman commented Jan 20, 2019

Thanks for providing this inspire sample. I finished the remove_network_profile() implementation.

@awkman awkman closed this as completed Jan 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants