summaryrefslogtreecommitdiffstats
path: root/hcid/security.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-07-07 19:36:35 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-07-07 19:36:35 +0000
commitbee20248caf216429bba4e2d1f104f9aab03596d (patch)
treeacb120c6ed4bd61703123f61d3f75ecd021a5863 /hcid/security.c
parent20f65cf4e0ab67ac3e528d84a877a5fe6161904a (diff)
Support class of device and RSSI values in D-Bus message
Diffstat (limited to 'hcid/security.c')
-rw-r--r--hcid/security.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/hcid/security.c b/hcid/security.c
index 148c3237..108887ce 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -493,13 +493,16 @@ static void remote_version_information(int dev, bdaddr_t *sba, void *ptr)
static void inquiry_result(int dev, bdaddr_t *sba, int plen, void *ptr)
{
- uint8_t num = *(uint8_t *)ptr++;
+ uint8_t num = *(uint8_t *) ptr++;
int i;
for (i = 0; i < num; i++) {
inquiry_info *info = ptr;
+ uint32_t class = info->dev_class[0]
+ | (info->dev_class[1] << 8)
+ | (info->dev_class[2] << 16);
- hcid_dbus_inquiry_result(sba, &info->bdaddr);
+ hcid_dbus_inquiry_result(sba, &info->bdaddr, class, 0);
ptr += INQUIRY_INFO_SIZE;
}
@@ -507,7 +510,7 @@ static void inquiry_result(int dev, bdaddr_t *sba, int plen, void *ptr)
static void inquiry_result_with_rssi(int dev, bdaddr_t *sba, int plen, void *ptr)
{
- uint8_t num = *(uint8_t *)ptr++;
+ uint8_t num = *(uint8_t *) ptr++;
int i;
if (!num)
@@ -516,16 +519,24 @@ static void inquiry_result_with_rssi(int dev, bdaddr_t *sba, int plen, void *ptr
if ((plen - 1) / num == INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE) {
for (i = 0; i < num; i++) {
inquiry_info_with_rssi_and_pscan_mode *info = ptr;
+ uint32_t class = info->dev_class[0]
+ | (info->dev_class[1] << 8)
+ | (info->dev_class[2] << 16);
- hcid_dbus_inquiry_result(sba, &info->bdaddr);
+ hcid_dbus_inquiry_result(sba, &info->bdaddr,
+ class, info->rssi);
ptr += INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE;
}
} else {
for (i = 0; i < num; i++) {
inquiry_info_with_rssi *info = ptr;
+ uint32_t class = info->dev_class[0]
+ | (info->dev_class[1] << 8)
+ | (info->dev_class[2] << 16);
- hcid_dbus_inquiry_result(sba, &info->bdaddr);
+ hcid_dbus_inquiry_result(sba, &info->bdaddr,
+ class, info->rssi);
ptr += INQUIRY_INFO_WITH_RSSI_SIZE;
}