2008-12-12 01:52:44

by Li, Zhigang

[permalink] [raw]
Subject: To enablue DID in coming bluez release

Hi all,
Could you please enable this profile in the coming release?
To update:
Add VID,PID,VER setting in main.conf

I think the parse_config also need add code in order to parse these value to main_opt.did.

Thanks

Zhigang


2008-12-19 19:01:35

by Marcel Holtmann

[permalink] [raw]
Subject: RE: To enablue DID in coming bluez release

Hi Zhigang,

please stop top-posting. This is an open source mailing list and we do
bottom posting and inline quoting.

> If USB Vendor ID and Bluetooth Vendor ID are both exist which one you prefer in DID? We can't add both right?

Default is Bluetooth since we are doing Bluetooth here and not USB. USB
would need a specific prefix. So I prefer usb:1223:1233:1223 for
indicating USB ids and without we default to Bluetooth. Care to send a
patch for it.

Regards

Marcel



2008-12-18 05:55:46

by Li, Zhigang

[permalink] [raw]
Subject: RE: To enablue DID in coming bluez release

SGkgTWFyY2VsLA0KSWYgVVNCIFZlbmRvciBJRCBhbmQgQmx1ZXRvb3RoIFZlbmRvciBJRCBhcmUg
Ym90aCBleGlzdCB3aGljaCBvbmUgeW91IHByZWZlciBpbiBESUQ/IFdlIGNhbid0IGFkZCBib3Ro
IHJpZ2h0Pw0KVGhhbmtzDQoNCg0KLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IE1h
cmNlbCBIb2x0bWFubiBbbWFpbHRvOm1hcmNlbEBob2x0bWFubi5vcmddIA0KU2VudDogMjAwOMTq
MTLUwjE4yNUgMzo1OQ0KVG86IExpLCBaaGlnYW5nDQpDYzogSm9oYW4gSGVkYmVyZzsgbGludXgt
Ymx1ZXRvb3RoQHZnZXIua2VybmVsLm9yZw0KU3ViamVjdDogUkU6IFRvIGVuYWJsdWUgRElEIGlu
IGNvbWluZyBibHVleiByZWxlYXNlDQoNCkhpIFpoaWdhbmcsDQoNCnNvIGZpcnN0IHRoaW5ncyBm
aXJzdC4gTk8gdG9wLXBvc3Rpbmcgb24gdGhpcyBtYWlsaW5nIGxpc3QuDQoNCj4gVXBkYXRlZDoN
Cj4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Ckhvd2V2ZXIgdGhlcmUgaXMgb25lIHRoaW5nIG1p
c3NpbmcuIFRoZSBESUQgc3VwcG9ydHMgVVNCIGJhc2VkIHZlbmRvcg0KaWRzIGFuZCBCbHVldG9v
dGggYmFzZWQgb25lcy4gU28gd2UgbmVlZCB0byBzdXBwb3J0IGJvdGguIEZlZWwgZnJlZSB0bw0K
Y29tZSB1cCB3aXRoIHNvbWV0aGluZy4NCg0KUmVnYXJkcw0KDQpNYXJjZWwNCg0KDQo=

2008-12-17 19:59:13

by Marcel Holtmann

[permalink] [raw]
Subject: RE: To enablue DID in coming bluez release

Hi Zhigang,

so first things first. NO top-posting on this mailing list.

> Updated:
> --- a/main.c Tue Dec 16 17:43:24 2008 +0800
> +++ b/main.c Wed Dec 17 11:57:47 2008 +0800
> @@ -174,6 +174,17 @@ static void parse_config(GKeyFile *confi
> main_opts.inqmode = val;
> }
>
> + str = g_key_file_get_string(config, "General",
> + "DeviceID", &err);
> + if (err) {
> + debug("%s", err->message);
> + g_clear_error(&err);
> + } else {
> + debug("deviceid=%s", str);
> + strncpy(main_opts.deviceid, str, sizeof(main_opts.deviceid));
> + g_free(str);
> + }
> +
> main_opts.link_mode = HCI_LM_ACCEPT;
>
> main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF |

I always need patches against the latest GIT tree. Otherwise I can't
merge them and submitting them in a proper format helps me to apply
them.

> diff -r 65556502911d main.conf
> --- a/main.conf Tue Dec 16 17:43:24 2008 +0800
> +++ b/main.conf Tue Dec 17 11:57:51 2008 +0800
> @@ -28,3 +28,9 @@ OffMode = NoScan
> # Discover scheduler interval used in Adapter.DiscoverDevices
> # The value is in seconds. Defaults is 0 to use controller scheduler
> DiscoverSchedulerInterval = 0
> +
> +
> +# User verndor and product and version information are used in DID profile
> +# ":" to identify the value. FFFF is reserved for VendorId by default.
> +DeviceID = 1234:5678:abcd

So the option should be commented out by default since otherwise every
installation now uses vendor id 1234 and that is actually a valid one.
Also the description above makes no sense.

I committed a patch by myself to the GIT tree now that should fix this.
However there is one thing missing. The DID supports USB based vendor
ids and Bluetooth based ones. So we need to support both. Feel free to
come up with something.

Regards

Marcel



2008-12-17 03:10:40

by Li, Zhigang

[permalink] [raw]
Subject: RE: To enablue DID in coming bluez release

VXBkYXRlZDoNCi0tLSBhL21haW4uYwlUdWUgRGVjIDE2IDE3OjQzOjI0IDIwMDggKzA4MDANCisr
KyBiL21haW4uYwlXZWQgRGVjIDE3IDExOjU3OjQ3IDIwMDggKzA4MDANCkBAIC0xNzQsNiArMTc0
LDE3IEBAIHN0YXRpYyB2b2lkIHBhcnNlX2NvbmZpZyhHS2V5RmlsZSAqY29uZmkNCiAJCW1haW5f
b3B0cy5pbnFtb2RlID0gdmFsOw0KIAl9DQogDQorCXN0ciA9IGdfa2V5X2ZpbGVfZ2V0X3N0cmlu
Zyhjb25maWcsICJHZW5lcmFsIiwNCisJCQkJCSJEZXZpY2VJRCIsICZlcnIpOw0KKwlpZiAoZXJy
KSB7DQorCQlkZWJ1ZygiJXMiLCBlcnItPm1lc3NhZ2UpOw0KKwkJZ19jbGVhcl9lcnJvcigmZXJy
KTsNCisJfSBlbHNlIHsNCisJCWRlYnVnKCJkZXZpY2VpZD0lcyIsIHN0cik7DQorCQlzdHJuY3B5
KG1haW5fb3B0cy5kZXZpY2VpZCwgc3RyLCBzaXplb2YobWFpbl9vcHRzLmRldmljZWlkKSk7DQor
CQlnX2ZyZWUoc3RyKTsNCisJfQ0KKw0KIAltYWluX29wdHMubGlua19tb2RlID0gSENJX0xNX0FD
Q0VQVDsNCiANCiAJbWFpbl9vcHRzLmxpbmtfcG9saWN5ID0gSENJX0xQX1JTV0lUQ0ggfCBIQ0lf
TFBfU05JRkYgfA0KZGlmZiAtciA2NTU1NjUwMjkxMWQgbWFpbi5jb25mDQotLS0gYS9tYWluLmNv
bmYJVHVlIERlYyAxNiAxNzo0MzoyNCAyMDA4ICswODAwDQorKysgYi9tYWluLmNvbmYJVHVlIERl
YyAxNyAxMTo1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YWluX29wdHMuaW5xbW9kZSA9IHZhbDsNCj4gPiAgCX0NCj4gPiArCXN0ciA9IGdfa2V5X2ZpbGVf
Z2V0X3N0cmluZyhjb25maWcsICJHZW5lcmFsIiwNCj4gDQo+IENvZGluZyBzdHlsZTogYWRkIGVt
cHR5IGxpbmUgYWZ0ZXIgdGhlIGNsb3NpbmcgYnJhY2tldC4NCj4gDQo+ID4gKwkJCQkJIlZJRC9Q
SUQvVkVSIiwgJmVycik7DQo+IA0KPiBEaWQgeW91IGFncmVlIHdpdGggdGhpcyAiVklEL1BJRC9W
RVIiIG5hbWUgd2l0aCBNYXJjZWw/IEknZCBoYXZlIHVzZWQNCj4gc29tZXRoaW5nIGxpa2UgIkRl
dmljZUlEIiwgIkRldmljZUlESW5mbyIgb3IgIkRJREluZm8iLg0KDQpJIHRoaW5rICJEZXZpY2VJ
RCIgc291bmRzIHJlYXNvbmFibGUuIExldHMgdXNlIHRoYXQgb25lLg0KDQpSZWdhcmRzDQoNCk1h
cmNlbA0KDQoNCi0tDQpUbyB1bnN1YnNjcmliZSBmcm9tIHRoaXMgbGlzdDogc2VuZCB0aGUgbGlu
ZSAidW5zdWJzY3JpYmUgbGludXgtYmx1ZXRvb3RoIiBpbg0KdGhlIGJvZHkgb2YgYSBtZXNzYWdl
IHRvIG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5vcmcNCk1vcmUgbWFqb3Jkb21vIGluZm8gYXQgIGh0
dHA6Ly92Z2VyLmtlcm5lbC5vcmcvbWFqb3Jkb21vLWluZm8uaHRtbA0K

2008-12-17 02:38:12

by Marcel Holtmann

[permalink] [raw]
Subject: Re: To enablue DID in coming bluez release

Hi Johan,

> Couple of comments:
>
> On Tue, Dec 16, 2008, Li, Zhigang wrote:
> > main_opts.inqmode = val;
> > }
> > + str = g_key_file_get_string(config, "General",
>
> Coding style: add empty line after the closing bracket.
>
> > + "VID/PID/VER", &err);
>
> Did you agree with this "VID/PID/VER" name with Marcel? I'd have used
> something like "DeviceID", "DeviceIDInfo" or "DIDInfo".

I think "DeviceID" sounds reasonable. Lets use that one.

Regards

Marcel



2008-12-17 02:25:02

by David Sainty

[permalink] [raw]
Subject: Re: To enablue DID in coming bluez release

Typo in main.conf: "verndor"


Li, Zhigang wrote:
> Please check it again.
> Marcel mention it in IRC for VID/PID/VER
>
> --- a/main.c Tue Dec 16 17:43:24 2008 +0800
> +++ b/main.c Wed Dec 17 09:57:37 2008 +0800
> @@ -174,6 +174,17 @@ static void parse_config(GKeyFile *confi
> main_opts.inqmode = val;
> }
>
> + str = g_key_file_get_string(config, "General",
> + "VID/PID/VER", &err);
> + if (err) {
> + debug("%s", err->message);
> + g_clear_error(&err);
> + } else {
> + debug("vid/pid/ver=%s", str);
> + strncpy(main_opts.deviceid, str, sizeof(main_opts.deviceid));
> + g_free(str);
> + }
> +
> main_opts.link_mode = HCI_LM_ACCEPT;
>
> main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF |
> diff -r 65556502911d main.conf
> --- a/main.conf Tue Dec 16 17:43:24 2008 +0800
> +++ b/main.conf Tue Dec 16 17:50:31 2008 +0800
> @@ -28,3 +28,9 @@ OffMode = NoScan
> # Discover scheduler interval used in Adapter.DiscoverDevices
> # The value is in seconds. Defaults is 0 to use controller scheduler
> DiscoverSchedulerInterval = 0
> +
> +
> +# User verndor and product and version information are used in DID profile
> +# ":" to identify the value. FFFF is reserved for VendorId by default.
> +VID/PID/VER = 1234:5678:abcd
> +
>
> Thanks
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Johan Hedberg
> Sent: 2008??12??16?? 18:29
> To: [email protected]
> Subject: Re: To enablue DID in coming bluez release
>
> Hi,
>
> Couple of comments:
>
> On Tue, Dec 16, 2008, Li, Zhigang wrote:
>
>> main_opts.inqmode = val;
>> }
>> + str = g_key_file_get_string(config, "General",
>>
>
> Coding style: add empty line after the closing bracket.
>
>
>> + "VID/PID/VER", &err);
>>
>
> Did you agree with this "VID/PID/VER" name with Marcel? I'd have used
> something like "DeviceID", "DeviceIDInfo" or "DIDInfo".
>
>
>> + strcpy( main_opts.deviceid,str);
>>
>
> First, coding style: remove the extra space after the opening
> parenthesis and add the missing one after the comma. Second, you're
> overflowing main_opts.deviceid if the string provided in main.conf is
> longer than 14 characters. So the call should be:
> strncpy(main_opts.deviceid, src, sizeof(main_opts.deviceid));
>
> Johan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> N?????r??y????b?X??ǧv?^?)޺{.n?+????{?n[???-?)????w*jg????????ݢj/???z?ޖ????譁&?)ߡ?a?????G???h??j:+v???w??٥


2008-12-17 02:17:09

by Li, Zhigang

[permalink] [raw]
Subject: RE: To enablue DID in coming bluez release

UGxlYXNlIGNoZWNrIGl0IGFnYWluLg0KTWFyY2VsIG1lbnRpb24gaXQgaW4gSVJDIGZvciBWSUQv
UElEL1ZFUg0KDQotLS0gYS9tYWluLmMJVHVlIERlYyAxNiAxNzo0MzoyNCAyMDA4ICswODAwDQor
KysgYi9tYWluLmMJV2VkIERlYyAxNyAwOTo1NzozNyAyMDA4ICswODAwDQpAQCAtMTc0LDYgKzE3
NCwxNyBAQCBzdGF0aWMgdm9pZCBwYXJzZV9jb25maWcoR0tleUZpbGUgKmNvbmZpDQogCQltYWlu
X29wdHMuaW5xbW9kZSA9IHZhbDsNCiAJfQ0KIA0KKwlzdHIgPSBnX2tleV9maWxlX2dldF9zdHJp
bmcoY29uZmlnLCAiR2VuZXJhbCIsDQorCQkJCQkiVklEL1BJRC9WRVIiLCAmZXJyKTsNCisJaWYg
KGVycikgew0KKwkJZGVidWcoIiVzIiwgZXJyLT5tZXNzYWdlKTsNCisJCWdfY2xlYXJfZXJyb3Io
JmVycik7DQorCX0gZWxzZSB7DQorCQlkZWJ1ZygidmlkL3BpZC92ZXI9JXMiLCBzdHIpOw0KKwkJ
c3RybmNweShtYWluX29wdHMuZGV2aWNlaWQsIHN0ciw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ZpZGVkIGluIG1haW4uY29uZiBpcw0KbG9uZ2VyIHRoYW4gMTQgY2hhcmFjdGVycy4gU28gdGhl
IGNhbGwgc2hvdWxkIGJlOg0Kc3RybmNweShtYWluX29wdHMuZGV2aWNlaWQsIHNyYywgc2l6ZW9m
KG1haW5fb3B0cy5kZXZpY2VpZCkpOw0KDQpKb2hhbg0KLS0NClRvIHVuc3Vic2NyaWJlIGZyb20g
dGhpcyBsaXN0OiBzZW5kIHRoZSBsaW5lICJ1bnN1YnNjcmliZSBsaW51eC1ibHVldG9vdGgiIGlu
DQp0aGUgYm9keSBvZiBhIG1lc3NhZ2UgdG8gbWFqb3Jkb21vQHZnZXIua2VybmVsLm9yZw0KTW9y
ZSBtYWpvcmRvbW8gaW5mbyBhdCAgaHR0cDovL3ZnZXIua2VybmVsLm9yZy9tYWpvcmRvbW8taW5m
by5odG1sDQo=

2008-12-16 10:29:28

by Johan Hedberg

[permalink] [raw]
Subject: Re: To enablue DID in coming bluez release

Hi,

Couple of comments:

On Tue, Dec 16, 2008, Li, Zhigang wrote:
> main_opts.inqmode = val;
> }
> + str = g_key_file_get_string(config, "General",

Coding style: add empty line after the closing bracket.

> + "VID/PID/VER", &err);

Did you agree with this "VID/PID/VER" name with Marcel? I'd have used
something like "DeviceID", "DeviceIDInfo" or "DIDInfo".

> + strcpy( main_opts.deviceid,str);

First, coding style: remove the extra space after the opening
parenthesis and add the missing one after the comma. Second, you're
overflowing main_opts.deviceid if the string provided in main.conf is
longer than 14 characters. So the call should be:
strncpy(main_opts.deviceid, src, sizeof(main_opts.deviceid));

Johan

2008-12-16 09:59:57

by Li, Zhigang

[permalink] [raw]
Subject: RE: To enablue DID in coming bluez release

UmVzZW5kOg0KDQotLS0gYS9tYWluLmMJVHVlIERlYyAxNiAxNzo0MzoyNCAyMDA4ICswODAwDQor
KysgYi9tYWluLmMJVHVlIERlYyAxNiAxNzo0NDo0MyAyMDA4ICswODAwDQpAQCAtMTczLDYgKzE3
MywxNiBAQCBz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KDQo+IENv
dWxkIHlvdSBwbGVhc2UgZW5hYmxlIHRoaXMgcHJvZmlsZSBpbiB0aGUgY29taW5nIHJlbGVhc2U/
DQo+IFRvIHVwZGF0ZToNCj4gQWRkIFZJRCxQSUQsVkVSIHNldHRpbmcgaW4gbWFpbi5jb25mDQo+
IA0KPiBJIHRoaW5rIHRoZSBwYXJzZV9jb25maWcgYWxzbyBuZWVkIGFkZCBjb2RlIGluIG9yZGVy
IHRvIHBhcnNlIHRoZXNlIHZhbHVlIHRvIG1haW5fb3B0LmRpZC4NCg0KSSB3YXMgZXhwZWN0aW5n
IHRoYXQgeW91IHNlbmQgbWUgYSBwYXRjaCBmb3IgaXQuDQoNClJlZ2FyZHMNCg0KTWFyY2VsDQoN
Cg0K

2008-12-16 07:55:51

by Li, Zhigang

[permalink] [raw]
Subject: RE: To enablue DID in coming bluez release

Please see the attached
The patch is validated in my pc with 4.18 version and works fine.
If it's ok for you please merge it into upstream.
Thanks


-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: 2008??12??12?? 9:56
To: Li, Zhigang
Cc: [email protected]
Subject: Re: To enablue DID in coming bluez release

Hi Zhigang,

> Could you please enable this profile in the coming release?
> To update:
> Add VID,PID,VER setting in main.conf
>
> I think the parse_config also need add code in order to parse these value to main_opt.did.

I was expecting that you send me a patch for it.

Regards

Marcel



Attachments:
main.conf (1.06 kB)
main.conf
main.c (16.82 kB)
main.c
Download all attachments

2008-12-12 01:55:31

by Marcel Holtmann

[permalink] [raw]
Subject: Re: To enablue DID in coming bluez release

Hi Zhigang,

> Could you please enable this profile in the coming release?
> To update:
> Add VID,PID,VER setting in main.conf
>
> I think the parse_config also need add code in order to parse these value to main_opt.did.

I was expecting that you send me a patch for it.

Regards

Marcel