mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-17 01:04:40 +08:00
Inherit the device specific options from the default
This commit is contained in:
parent
e0cbfd7cc7
commit
5ac3c1ef76
@ -97,7 +97,7 @@ extern struct hcid_opts hcid;
|
||||
|
||||
int read_config(char *file);
|
||||
|
||||
struct device_opts *alloc_device_opts(char *addr);
|
||||
struct device_opts *alloc_device_opts(char *ref);
|
||||
|
||||
gboolean io_stack_event(GIOChannel *chan, GIOCondition cond, gpointer data);
|
||||
gboolean io_security_event(GIOChannel *chan, GIOCondition cond, gpointer data);
|
||||
|
@ -78,6 +78,7 @@ static inline void init_device_defaults(struct device_opts *device_opts)
|
||||
{
|
||||
memset(device_opts, 0, sizeof(*device_opts));
|
||||
device_opts->scan = SCAN_PAGE | SCAN_INQUIRY;
|
||||
device_opts->name = strdup("BlueZ");
|
||||
}
|
||||
|
||||
struct device_opts *alloc_device_opts(char *ref)
|
||||
@ -95,7 +96,8 @@ struct device_opts *alloc_device_opts(char *ref)
|
||||
device->next = device_list;
|
||||
device_list = device;
|
||||
|
||||
init_device_defaults(&device->opts);
|
||||
memcpy(&device->opts, &default_device, sizeof(struct device_opts));
|
||||
device->opts.name = strdup(default_device.name);
|
||||
|
||||
return &device->opts;
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ device_opt:
|
||||
| K_NAME dev_name {
|
||||
if (parser_device->name)
|
||||
free(parser_device->name);
|
||||
parser_device->name = $2;
|
||||
parser_device->name = strdup($2);
|
||||
}
|
||||
|
||||
| K_CLASS NUM {
|
||||
|
Loading…
Reference in New Issue
Block a user