summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-07-04 15:41:53 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-07-04 15:41:53 +0000
commit50111729540851e01dd1471d4ce742ee44f437e7 (patch)
tree9686d48b501bafc9c2968fdb548343d4d4fb24bc
parentf21d9765a64fc97cf269727b7762fd1d277fedec (diff)
Make use of new subclass field
-rw-r--r--hidd/hidd.h2
-rw-r--r--hidd/main.c5
-rw-r--r--hidd/sdp.c8
3 files changed, 6 insertions, 9 deletions
diff --git a/hidd/hidd.h b/hidd/hidd.h
index 451bea4e..cd0c102c 100644
--- a/hidd/hidd.h
+++ b/hidd/hidd.h
@@ -29,4 +29,4 @@
#define L2CAP_PSM_HIDP_CTRL 0x11
#define L2CAP_PSM_HIDP_INTR 0x13
-int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, uint8_t *subclass, struct hidp_connadd_req *req);
+int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, struct hidp_connadd_req *req);
diff --git a/hidd/main.c b/hidd/main.c
index e4202643..c265848b 100644
--- a/hidd/main.c
+++ b/hidd/main.c
@@ -156,7 +156,6 @@ static int create_device(int ctl, int csk, int isk, int timeout)
struct hidp_connadd_req req;
struct sockaddr_l2 addr;
socklen_t addrlen;
- uint8_t subclass;
bdaddr_t src, dst;
char bda[18];
int err;
@@ -183,14 +182,14 @@ static int create_device(int ctl, int csk, int isk, int timeout)
req.flags = 0;
req.idle_to = timeout * 60;
- err = get_hid_device_info(&src, &dst, &subclass, &req);
+ err = get_hid_device_info(&src, &dst, &req);
if (err < 0)
goto error;
ba2str(&dst, bda);
syslog(LOG_INFO, "New HID device %s (%s)", bda, req.name);
- if (subclass == 0x40) {
+ if (req.subclass & 0x40) {
}
err = ioctl(ctl, HIDPCONNADD, &req);
diff --git a/hidd/sdp.c b/hidd/sdp.c
index 467129b2..31020130 100644
--- a/hidd/sdp.c
+++ b/hidd/sdp.c
@@ -49,7 +49,7 @@
#include "hidd.h"
-int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, uint8_t *subclass, struct hidp_connadd_req *req)
+int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, struct hidp_connadd_req *req)
{
uint32_t range = 0x0000ffff;
sdp_session_t *s;
@@ -124,10 +124,8 @@ int get_hid_device_info(bdaddr_t *src, bdaddr_t *dst, uint8_t *subclass, struct
pdlist = sdp_data_get(rec, 0x0201);
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, 0x0202);
+ req->subclass = pdlist ? pdlist->val.uint8 : 0;
pdlist = sdp_data_get(rec, 0x0203);
req->country = pdlist ? pdlist->val.uint8 : 0;