3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

client: add property setter for device

This commit is contained in:
Tim Kourt 2018-07-25 12:54:41 -07:00 committed by Denis Kenzior
parent f7171665d1
commit 1e78ed5a7d

View File

@ -31,6 +31,7 @@
#include "device.h" #include "device.h"
#include "display.h" #include "display.h"
#include "network.h" #include "network.h"
#include "properties.h"
struct device { struct device {
bool powered; bool powered;
@ -672,7 +673,29 @@ static enum cmd_status cmd_list(const char *device_name, char *args)
static enum cmd_status cmd_set_property(const char *device_name, char *args) static enum cmd_status cmd_set_property(const char *device_name, char *args)
{ {
return CMD_STATUS_UNSUPPORTED; char *name;
char *value_str;
const struct proxy_interface *proxy =
get_device_proxy_by_name(device_name);
if (!proxy)
return CMD_STATUS_INVALID_VALUE;
if (!properties_parse_args(args, &name, &value_str))
return CMD_STATUS_INVALID_ARGS;
if (!proxy_property_set(proxy, name, value_str,
check_errors_method_callback)) {
l_free(name);
l_free(value_str);
return CMD_STATUS_INVALID_VALUE;
}
l_free(name);
l_free(value_str);
return CMD_STATUS_OK;
} }
static enum cmd_status cmd_connect(const char *device_name, char *args) static enum cmd_status cmd_connect(const char *device_name, char *args)