diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2012-03-28 12:03:13 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-03-28 13:15:02 +0300 |
commit | e2f915b21efbd39b0cb690d6304c23a8c4eb6254 (patch) | |
tree | dcd3f7face27eca90cab39149a80daeca56c0b42 /src/sdpd-server.c | |
parent | f7eb756f5289a35fab6085c4f86556b7bd50cb87 (diff) | |
download | bluez-e2f915b21efbd39b0cb690d6304c23a8c4eb6254.tar.gz |
Parse config DeviceID string on bluetoothd startup
Instead of parsing config DeviceID string on sdp server startup, parse
it in main while reading config file. This allow to store logical DID
values in main_opts (instead of raw config string) and make use of them
in bluetoothd code.
Diffstat (limited to 'src/sdpd-server.c')
-rw-r--r-- | src/sdpd-server.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/sdpd-server.c b/src/sdpd-server.c index a92ae2cd5..1d9509e00 100644 --- a/src/sdpd-server.c +++ b/src/sdpd-server.c @@ -45,6 +45,7 @@ #include <glib.h> +#include "hcid.h" #include "log.h" #include "sdpd.h" @@ -227,7 +228,7 @@ static gboolean io_accept_event(GIOChannel *chan, GIOCondition cond, gpointer da return TRUE; } -int start_sdp_server(uint16_t mtu, const char *did, uint32_t flags) +int start_sdp_server(uint16_t mtu, uint32_t flags) { int compat = flags & SDP_SERVER_COMPAT; int master = flags & SDP_SERVER_MASTER; @@ -240,20 +241,8 @@ int start_sdp_server(uint16_t mtu, const char *did, uint32_t flags) return -1; } - if (did && strlen(did) > 0) { - const char *ptr = did; - uint16_t vid = 0x0000, pid = 0x0000, ver = 0x0000; - - vid = (uint16_t) strtol(ptr, NULL, 16); - ptr = strchr(ptr, ':'); - if (ptr) { - pid = (uint16_t) strtol(ptr + 1, NULL, 16); - ptr = strchr(ptr + 1, ':'); - if (ptr) - ver = (uint16_t) strtol(ptr + 1, NULL, 16); - register_device_id(vid, pid, ver); - } - } + if (main_opts.did_source > 0) + register_device_id(); io = g_io_channel_unix_new(l2cap_sock); g_io_channel_set_close_on_unref(io, TRUE); |