diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2004-06-12 14:00:04 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2004-06-12 14:00:04 +0000 |
commit | dfcfad85283a8835c5b6c7fa906c4752b5e22d77 (patch) | |
tree | a9630279087926c94777c5d04eaf8f1e01e3c908 /hidd/sdp.c | |
parent | f3ba72e2b071ba40bfe535a4b76193100a956462 (diff) |
Update minor parts of the hidd
Diffstat (limited to 'hidd/sdp.c')
-rw-r--r-- | hidd/sdp.c | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -49,7 +49,7 @@ #include "hidd.h" -int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, struct hidp_connadd_req *req) +int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, uint8_t *subclass, struct hidp_connadd_req *req) { uint32_t range = 0x0000ffff; sdp_session_t *s; @@ -90,16 +90,13 @@ int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, struct hidp_connadd_req *r rec = (sdp_record_t *) pnp_rsp->data; pdlist = sdp_data_get(rec, 0x0201); - if (pdlist) - req->vendor = pdlist->val.uint16; + req->vendor = pdlist ? pdlist->val.uint16 : 0x0000; pdlist = sdp_data_get(rec, 0x0202); - if (pdlist) - req->product = pdlist->val.uint16; + req->product = pdlist ? pdlist->val.uint16 : 0x0000; pdlist = sdp_data_get(rec, 0x0203); - if (pdlist) - req->version = pdlist->val.uint16; + req->version = pdlist ? pdlist->val.uint16 : 0x0000; sdp_record_free(rec); } @@ -125,14 +122,15 @@ int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, struct hidp_connadd_req *r } pdlist = sdp_data_get(rec, 0x0201); - if (pdlist) - req->parser = pdlist->val.uint16; - else - req->parser = 0x0100; + req->parser = pdlist ? pdlist->val.uint16 : 0x0100; + + if (subclass) { + pdlist = sdp_data_get(rec, 0x0202); + *subclass = pdlist ? pdlist->val.uint8 : 0; + } pdlist = sdp_data_get(rec, 0x0203); - if (pdlist) - req->country = pdlist->val.uint8; + req->country = pdlist ? pdlist->val.uint8 : 0; pdlist = sdp_data_get(rec, 0x0206); if (pdlist) { |