mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
client: add property setter for device
This commit is contained in:
parent
f7171665d1
commit
1e78ed5a7d
@ -31,6 +31,7 @@
|
||||
#include "device.h"
|
||||
#include "display.h"
|
||||
#include "network.h"
|
||||
#include "properties.h"
|
||||
|
||||
struct device {
|
||||
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)
|
||||
{
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user