Request with RSSI
A message that is not in the archive (sent off-list or not yet received): 1150787688.18381.0.camel@localhost
Marcel,
I want to get RSSI value when inquiring, and my dongole support the feature:
mylinux:/home/lucharse# hciconfig hci0 features
hci0: Type: USB
BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10
Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00 0x00
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <SCO link> <HV2 packets> <HV3 packets>
<u-law log> <A-law log> <CVSD> <power control>
<transparent SCO> <broadcast encrypt> <enhanced iscan>
<interlaced iscan> <interlaced pscan> <inquiry with RSSI>
<AFH cap. slave> <AFH cap. master> <AFH class. master>I set the inquiry mode to 1 which is inquiry with RSSI:
mylinux:/home/lucharse# hciconfig hci0 inqmode 1
mylinux:/home/lucharse# hciconfig hci0 inqmode
hci0: Type: USB
BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10
Inquiry mode: Inquiry with RSSIBut when I use the sample code from from Scott W Gifford(http://sourceforge.net/mailarchive/message.php?msg_id=10195457) which is claimed to inquiry with RSSI, the output shows that the inquiry result without RSSI value. and the hcidump(-X -V) show the event type is EVT_INQUIRY_RESULT.
mylinux:/home/lucharse/testcase# ./a.out activate_rssi: err=0 begin_inquiry: starting Polling... Got event! Type is 2 inquiry_result: num 1 00:0F:B3:9B:04:D3: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:14:A4:D7:52:48: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:14:A4:D7:52:91: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:20:E0:7A:F4:E6: ? Polling... Polling... Program finished. cancel_inquiry: err=0
while using hcidump -X -V:
mylinux:/home/lucharse/# hcidump -X -V
HCI sniffer - Bluetooth packet analyzer ver 1.31
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Write Inquiry Mode (0x03|0x0045) plen 1
mode 1Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4
Write Inquiry Mode (0x03|0x0045) ncmd 1
status 0x00
< HCI Command: Inquiry (0x01|0x0001) plen 5
lap 0x9e8b33 len 48 num 0Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
Inquiry (0x01|0x0001) status 0x00 ncmd 1
Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16
bdaddr 00:0F:B3:9B:04:D3 mode 1 clkoffset 0x10e4 class 0x020104
Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16
bdaddr 00:14:A4:D7:52:48 mode 1 clkoffset 0x7c5a class 0x72010c
Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16
bdaddr 00:14:A4:D7:52:91 mode 1 clkoffset 0x4c9b class 0x72010c
Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16
bdaddr 00:20:E0:7A:F4:E6 mode 1 clkoffset 0x6ec5 class 0x00010c
< HCI Command: Inquiry Cancel (0x01|0x0002) plen 0
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4
Inquiry Cancel (0x01|0x0002) ncmd 1
status 0x00in your last mail, you ask me to to use hcidump(-X -V), but I can't see the RSSI value.
The sample code I used uses the HCI raw socket, and I review the DBus API(bluez-utils-3.1), I don't know which API can give me the RSSI wheng inquirying.
How do you think about it?
Hi,
Quoted 4 lines
I have the same problem, I have called "hciconfig hci0 inqmode 1"
first to switch the feature, but I still have the the problem I only can get the inquiry result without RSSI value.
I am sure that my dongle supports the feature.
if you run "hcidump -X -V" and then start an inquiry you should see the new inquiry result with RSSI event. However the inquiry() API call of the Bluetooth library can't handle the RSSI value. Even if the kernel sees it. There is no way to get it back to the application. So you either gonna use the HCI raw socket or the new BlueZ D-Bus API to actually get the RSSI value.
Regards
Marcel
Marcel Holtmann <[email protected]> 写道:
Hi,
Quoted 4 lines
In fact, the code I used to inquiry with rssi from Scott W Gifford
(http://sourceforge.net/mailarchive/message.php?msg_id=10195457) uses the raw socket, but I can only getEVT_INQUIRY_RESULTevent type. So, raw socket can't give me the rssi value. How do you think about it?
please summarize your problem and repost to the BlueZ developer mailing list address. You used the wrong address and I didn't see it last time.
Regards
Marcel
With respects,
Mingfan.Lu
---------------------------------
抢注雅虎免费邮箱-3.5G容量,20M附件!
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi,
Quoted 79 lines
I want to get RSSI value when inquiring, and my dongole support the
feature:mylinux:/home/lucharse# hciconfig hci0 features hci0: Type: USB BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10 Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00 0x00 <3-slot packets> <5-slot packets> <encryption> <slot offset> <timing accuracy> <role switch> <sniff mode> <RSSI> <channel quality> <SCO link> <HV2 packets> <HV3 packets> <u-law log> <A-law log> <CVSD> <power control> <transparent SCO> <broadcast encrypt> <enhanced iscan> <interlaced iscan> <interlaced pscan> <inquiry with RSSI> <AFH cap. slave> <AFH cap. master> <AFH class. master>I set the inquiry mode to 1 which is inquiry with RSSI:
mylinux:/home/lucharse# hciconfig hci0 inqmode 1 mylinux:/home/lucharse# hciconfig hci0 inqmode hci0: Type: USB BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10 Inquiry mode: Inquiry with RSSIBut when I use the sample code from from Scott W
Gifford(http://sourceforge.net/mailarchive/message.php?msg_id=10195457) which is claimed to inquiry with RSSI, the output shows that the inquiry result without RSSI value. and the hcidump(-X -V) show the event type isEVT_INQUIRY_RESULT.mylinux:/home/lucharse/testcase# ./a.out activate_rssi: err=0 begin_inquiry: starting Polling... Got event! Type is 2 inquiry_result: num 1 00:0F:B3:9B:04:D3: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:14:A4:D7:52:48: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:14:A4:D7:52:91: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:20:E0:7A:F4:E6: ? Polling... Polling... Program finished. cancel_inquiry: err=0while using hcidump -X -V:
mylinux:/home/lucharse/# hcidump -X -V HCI sniffer - Bluetooth packet analyzer ver 1.31 device: hci0 snap_len: 1028 filter: 0xffffffff < HCI Command: Write Inquiry Mode (0x03|0x0045) plen 1 mode 1Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4Write Inquiry Mode (0x03|0x0045) ncmd 1 status 0x00 < HCI Command: Inquiry (0x01|0x0001) plen 5 lap 0x9e8b33 len 48 num 0Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4Inquiry (0x01|0x0001) status 0x00 ncmd 1Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:0F:B3:9B:04:D3 mode 1 clkoffset 0x10e4 class 0x020104Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:14:A4:D7:52:48 mode 1 clkoffset 0x7c5a class 0x72010cQuoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:14:A4:D7:52:91 mode 1 clkoffset 0x4c9b class 0x72010cQuoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:20:E0:7A:F4:E6 mode 1 clkoffset 0x6ec5 class 0x00010c< HCI Command: Inquiry Cancel (0x01|0x0002) plen 0
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4Inquiry Cancel (0x01|0x0002) ncmd 1 status 0x00
Quoted 8 lines
in your last mail, you ask me to to use hcidump(-X -V), but I can't see the RSSI value.
The sample code I used uses the HCI raw socket, and I review the DBus API(bluez-utils-3.1), I don't know which API can give me the RSSI wheng inquirying.
How do you think about it?
this is strange. If "hciconfig hci0 inqmode" tells you that you use Inquiry with RSSI then you should get the Inquiry with RSSI Results. What hardware is this (hciconfig hci0 version).
Regards
Marcel
Quoted 1 line
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
mylinux:/home/lucharse/ContentPushing # hciconfig hci0 version
hci0: Type: USB
BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10
HCI Ver: 1.2 (0x2) HCI Rev: 0x1f4 LMP Ver: 1.2 (0x2) LMP Subver: 0x1f4
Manufacturer: Integrated System Solution Corp. (57)Marcel Holtmann <[email protected]> 写道: Hi,
Quoted 78 lines
I want to get RSSI value when inquiring, and my dongole support the feature:
mylinux:/home/lucharse# hciconfig hci0 features hci0: Type: USB BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10 Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00 0x00 <3-slot packets> <5-slot packets> > offset>Quoted 6 lines
packets>
RSSI>
I set the inquiry mode to 1 which is inquiry with RSSI:
mylinux:/home/lucharse# hciconfig hci0 inqmode 1 mylinux:/home/lucharse# hciconfig hci0 inqmode hci0: Type: USB BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10 Inquiry mode: Inquiry with RSSIBut when I use the sample code from from Scott W
Gifford(http://sourceforge.net/mailarchive/message.php?msg_id=10195457) which is claimed to inquiry with RSSI, the output shows that the inquiry result without RSSI value. and the hcidump(-X -V) show the event type isEVT_INQUIRY_RESULT.mylinux:/home/lucharse/testcase# ./a.out activate_rssi: err=0 begin_inquiry: starting Polling... Got event! Type is 2 inquiry_result: num 1 00:0F:B3:9B:04:D3: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:14:A4:D7:52:48: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:14:A4:D7:52:91: ? Polling... Got event! Type is 2 inquiry_result: num 1 00:20:E0:7A:F4:E6: ? Polling... Polling... Program finished. cancel_inquiry: err=0while using hcidump -X -V:
mylinux:/home/lucharse/# hcidump -X -V HCI sniffer - Bluetooth packet analyzer ver 1.31 device: hci0 snap_len: 1028 filter: 0xffffffff < HCI Command: Write Inquiry Mode (0x03|0x0045) plen 1 mode 1Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4Write Inquiry Mode (0x03|0x0045) ncmd 1
status0x00
< HCI Command: Inquiry (0x01|0x0001) plen 5
lap0x9e8b33len 48 num 0Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4Inquiry (0x01|0x0001) status
0x00ncmd 1Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:0F:B3:9B:04:D3 mode 1 clkoffset
0x10e4class0x020104Quoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:14:A4:D7:52:48 mode 1 clkoffset
0x7c5aclass0x72010cQuoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:14:A4:D7:52:91 mode 1 clkoffset
0x4c9bclass0x72010cQuoted 1 line
HCI Event: Inquiry Result (
0x02) plen 16bdaddr 00:20:E0:7A:F4:E6 mode 1 clkoffset
0x6ec5class0x00010c< HCI Command: Inquiry Cancel (0x01|0x0002) plen 0Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4Inquiry Cancel (0x01|0x0002) ncmd 1
status0x00
Quoted 8 lines
in your last mail, you ask me to to use hcidump(-X -V), but I can't see the RSSI value.
The sample code I used uses the HCI raw socket, and I review the DBus API(bluez-utils-3.1), I don't know which API can give me the RSSI wheng inquirying.
How do you think about it?
this is strange. If "hciconfig hci0 inqmode" tells you that you use Inquiry with RSSI then you should get the Inquiry with RSSI Results. What hardware is this (hciconfig hci0 version).
Regards
Marcel
Quoted 1 line
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
With respects,
Mingfan.Lu
__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
Marcel Holtmann
maintainerHi,
Quoted 6 lines
mylinux:/home/lucharse/ContentPushing # hciconfig hci0 version
hci0: Type: USBBD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10 HCI Ver: 1.2 (0x2) HCI Rev: 0x1f4 LMP Ver: 1.2 (0x2) LMPSubver:
0x1f4
Manufacturer: Integrated System Solution Corp. (57)
this chips firmware is totally broken. I just checked mine and I am seeing the same. No Inquiry with RSSI Result events.
However their support for Inquiry with RSSI is simply not there. See my tested inquiry mode settings:
# hciconfig hci0 inqmode 5
# sudo hciconfig hci0 inqmode
hci0: Type: USB
BD Address: 22:22:22:22:22:22 ACL MTU: 678:8 SCO MTU: 48:10
Inquiry mode: Unknown (0x05)So they store the value somewhere, but that's it.
If you wanna really use Inquiry with RSSI, then you might wanna make sure you get a CSR BlueCore4 based dongle. They simply work.
Regards
Marcel
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
I can't understand your test , why you set the mode 5?
what is the relation between your result and the problem?
Marcel Holtmann <[email protected]> :
Hi,
Quoted 6 lines
mylinux:/home/lucharse/ContentPushing # hciconfig hci0 version
hci0: Type: USB
BD Address: 00:11:67:19:3D:EC ACL MTU: 678:8 SCO MTU: 48:10 HCI Ver: 1.2 (0x2) HCI Rev:0x1f4LMP Ver: 1.2 (0x2) LMP
Subver:0x1f4
Manufacturer: Integrated System Solution Corp. (57)
this chips firmware is totally broken. I just checked mine and I am seeing the same. No Inquiry with RSSI Result events.
However their support for Inquiry with RSSI is simply not there. See my tested inquiry mode settings:
# hciconfig hci0 inqmode 5 # sudo hciconfig hci0 inqmode hci0: Type: USB BD Address: 22:22:22:22:22:22 ACL MTU: 678:8 SCO MTU: 48:10 Inquiry mode: Unknown (0x05)
So they store the value somewhere, but that's it.
If you wanna really use Inquiry with RSSI, then you might wanna make sure you get a CSR BlueCore4 based dongle. They simply work.
Regards
Marcel
With respects,
Mingfan.Lu
---------------------------------
Mp3疯狂搜-新歌热歌高速下
Marcel Holtmann
maintainerHi,
Quoted 2 lines
I can't understand your test , why you set the mode 5? what is the relation between your result and the problem?
it means that they support the inquiry mode command, but don't do actually anything with it. Setting it to 5 is not allowed. So this command should fail and later on it should retrieve only 0 or 1 as valid values, but it doesn't. This leads to the conclusion that they only store the inquiry mode value somewhere, but never evaluate it. And this means they will never switch to Inquiry with RSSI as you have seen before.
Regards
Marcel
Quoted 1 line
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
[Bluez-devel] 回复: Re: 回复: Re: 回复: Re: RE: RE: FWD�� Re: Re:Request with RSSI
Hi,
I reviewed the hciconfig.c.
If you set mode 5, it just output like you test. I can see any limitation of the mode num, 5 it can be dealt with. So, I don't think it can give such a conclusion you claimed.
static void cmd_inq_mode(int ctl, int hdev, char *opt)
{
int dd;
dd = hci_open_dev(hdev);
if (dd < 0) {
fprintf(stderr, "Can't open device hci%d: %s (%d)\n",
hdev, strerror(errno), errno);
exit(1);
}
if (opt) {
uint8_t mode = atoi(opt);
if (hci_write_inquiry_mode(dd, mode, 2000) < 0) {
fprintf(stderr, "Can't set inquiry mode on hci%d: %s (%d)\n",
hdev, strerror(errno), errno);
exit(1);
}
} else {
uint8_t mode;
if (hci_read_inquiry_mode(dd, &mode, 1000) < 0) {
fprintf(stderr, "Can't read inquiry mode on hci%d: %s (%d)\n",
hdev, strerror(errno), errno);
exit(1);
}
print_dev_hdr(&di); printf("\tInquiry mode: ");
switch (mode) {
case 0:
printf("Standard Inquiry\n");
break;
case 1:
printf("Inquiry with RSSI\n");
break;
case 2:
printf("Inquiry with RSSI or Extended Inquiry\n"); break;
default:
printf("Unknown (0x%02x)\n", mode);
break;
}
}
hci_close_dev(dd);
}
Marcel Holtmann <[email protected]> 写道:
Hi,
Quoted 2 lines
I can't understand your test , why you set the mode 5? what is the relation between your result and the problem?
it means that they support the inquiry mode command, but don't do actually anything with it. Setting it to 5 is not allowed. So this command should fail and later on it should retrieve only 0 or 1 as valid values, but it doesn't. This leads to the conclusion that they only store the inquiry mode value somewhere, but never evaluate it. And this means they will never switch to Inquiry with RSSI as you have seen before.
Regards
Marcel
Quoted 1 line
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
With respects,
Mingfan.Lu
---------------------------------
雅虎免费邮箱-3.5G容量,20M附件
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerRe: [Bluez-devel] 回复: Re: 回复: Re: 回复: Re: RE: RE: FWD�� Re: Re:Request with RSSI
Hi,
Quoted 4 lines
I reviewed the
hciconfig.c.
If you set mode 5, it just output like you test. I can see any
limitation of the mode num, 5 it can be dealt with. So, I don't think it can give such a conclusion you claimed.
this has nothing to do with our code. The chip must refuse any values other than 0 and 1. And such a behavior leads the conclusion that their implementation doesn't care about the inquiry mode at all. Otherwise they would have been more careful with the implementation.
Anyway, the firmware of this chip is broken. Get yourself a working dongle from CSR and you can use Inquiry with RSSI. Otherwise you can't.
Regards
Marcel
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Re: [Bluez-deve]Re: Re:: Re: RE: RE: FWD:Re: Re:Request with RSSI
I see. Thank you for your patience and nice answer.
I will get a new dongle :)
ps, is there any plan for official document for bluez, although the bluez is being under development.
Marcel Holtmann <[email protected]> 写道:
Hi,
Quoted 4 lines
I reviewed the
hciconfig.c.
If you set mode 5, it just output like you test. I can see any limitation of the mode num, 5 it can be dealt with. So, I don't think it can give such a conclusion you claimed.
this has nothing to do with our code. The chip must refuse any values other than 0 and 1. And such a behavior leads the conclusion that their implementation doesn't care about the inquiry mode at all. Otherwise they would have been more careful with the implementation.
Anyway, the firmware of this chip is broken. Get yourself a working dongle from CSR and you can use Inquiry with RSSI. Otherwise you can't.
Regards
Marcel
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
With respects,
Mingfan.Lu
---------------------------------
抢注雅虎免费邮箱-3.5G容量,20M附件!
Marcel Holtmann
maintainerRe: [Bluez-devel] [Bluez-deve]Re: Re:: Re: RE: RE: FWD:Re: Re:Request with RSSI
Hi,
Quoted 2 lines
ps, is there any plan for official document for bluez, although the bluez is being under development.
what do you mean by document. We have manpages for all commands and there are some howtos you can find on the web.
Regards
Marcel
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel