diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/device.c | 3 | ||||
| -rw-r--r-- | src/hcid.h | 1 | ||||
| -rw-r--r-- | src/main.c | 9 | 
3 files changed, 12 insertions, 1 deletions
| diff --git a/src/device.c b/src/device.c index d9af8d03..b920d5a2 100644 --- a/src/device.c +++ b/src/device.c @@ -1836,7 +1836,8 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)  		device_browse(device, bonding->conn, bonding->msg,  				NULL, FALSE); -	} else if (!device->discov_active && !device->discov_timer) { +	} else if (!device->discov_active && !device->discov_timer && +			main_opts.reverse_sdp) {  		/* If we are not initiators and there is no currently active  		 * discovery or discovery timer, set the discovery timer */  		debug("setting timer for reverse service discovery"); @@ -56,6 +56,7 @@ struct main_opts {  	uint16_t	link_mode;  	uint16_t	link_policy;  	gboolean	remember_powered; +	gboolean	reverse_sdp;  	uint8_t		scan;  	uint8_t		mode; @@ -193,6 +193,14 @@ static void parse_config(GKeyFile *config)  		g_free(str);  	} +	boolean = g_key_file_get_boolean(config, "General", +						"ReverseServiceDiscovery", &err); +	if (err) { +		g_clear_error(&err); +	} else +		main_opts.reverse_sdp = boolean; + +  	main_opts.link_mode = HCI_LM_ACCEPT;  	main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF | @@ -545,6 +553,7 @@ static void init_defaults(void)  	main_opts.name	= g_strdup("BlueZ");  	main_opts.discovto	= HCID_DEFAULT_DISCOVERABLE_TIMEOUT;  	main_opts.remember_powered = TRUE; +	main_opts.reverse_sdp = TRUE;  	if (gethostname(main_opts.host_name, sizeof(main_opts.host_name) - 1) < 0)  		strcpy(main_opts.host_name, "noname"); | 
