Dear Users,
My project is to work with rssi/tpl/lq. My initial goal is to read them and show them graphically with some handy features!
I have gone through hcitool.c (most of the code) and tried to exactly copy the necessary things only to retrieve RSSI. But, I couldn't call "hci_read_rssi" as them. Compiling my program gave this error:
mySignalScan.c:102: warning: implicit declaration of function `hci_read_rssi'
mySignalScan.c: At top level:
/tmp/cc4x36ri.o(.text+0x25b): In function `cmd_rssi':
: undefined reference to `hci_read_rssi'
collect2: ld returned 1 exit status
I couldn't find "hci_read_rssi" function listed in my current "hci_lib.h" header file. I have exactly all the header files added as in "hcitool.c". hcitool works just fine and gives me the values (e.g. rssi, lq). But my aim is to have those values in my program so that, I can use them in my desired way! I wonder how hcitool could call "hci_read_rssi" file and I can't.
I tried to write my "hci_read_rssi" function stated exactly the same way as in "hci.c". But my program gives this error while run and couldn't retrieve RSSI:
Read RSSI failed: Input/output error
Upto calling to "my_hci_read_rssi" (my function imitating the main hci_read_rssi function), all the things are alright. I checked the connection information and printed them out:
Device name: Mahtab
Device Address: 00:13:70:C3:88:37
Handle: 6
Role: 1
Direction: 1
Link mode: 5
State: 1
** These were also exactly the same values shown by my KDE-bluetooth utilities about the connection.
I made the connection with the following command:
rfcomm connect 0 00:13:70:C3:88:37
Connected /dev/rfcomm0 to 00:13:70:C3:88:37 on channel 1
Press CTRL-C for hangup
hcidump shows exactly the same sequence for both my program and while ran
"hcitool rssi 00:13:70:C3:88:37".
My Program:
< HCI Command: Read RSSI (0x05|0x0005) plen 2
> HCI Event: Command Complete (0x0e) plen 7
hcitool rssi 00:13:70:C3:88:37:
< HCI Command: Read RSSI (0x05|0x0005) plen 2
> HCI Event: Command Complete (0x0e) plen 7
Right now, I am stuck. I will appreciate any suggestions.
Thanks
Mahtab
---------------------------------
Yahoo! DSL Something to write home about. Just $16.99/mo. or less
Hi Mahtab,
> You are right. I have fedora core 3 in my lab and I think it comes
> with this version of bluez.
> [root@70-52 mahtab]# rpm -qa bluez*
> bluez-bluefw-1.0-6
> bluez-pin-0.23-3
> bluez-hcidump-1.11-1
> bluez-utils-2.10-2
> bluez-libs-devel-2.10-2
> bluez-libs-2.10-2
> bluez-utils-cups-2.10-2
>
> I thought I had installed the recent bluez packages and was looking
> into the codes of bluez-2.24 packages. That explains the error.
> Anyway, I could solve the problem of my_hci_read_rssi function - it
> was a stupid typo. I should have literally copied your hci_read_rssi
> function rather than typing it myself. But again, I am not fond of
> your choice of variables either (rq, rp etc. :P which was the reason
> of my typo). :D
>
> As I will be making a GUI version considering only RSSI, LQ & TPL
> part, I think I will not go into installing the newer version of bluez
> (I also work on my ancient Laptop which has bluez-2.4-1).
> I have chosen GTK+ for dealing with the GUI version. Any suggestions
> on that?
> My work is to record RSSI, LQ and TPL correcponding to a location
> (i.e. location fingerprint) in a user-friendly way!
since graphical applications are event driven you might wanna use the
HCI raw interface directly instead of calling the API functions, but
that would be only a minor detail. Otherwise there shouldn't be any big
problems.
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Hi Marcel,
You are right. I have fedora core 3 in my lab and I think it comes with this version of bluez.
[root@70-52 mahtab]# rpm -qa bluez*
bluez-bluefw-1.0-6
bluez-pin-0.23-3
bluez-hcidump-1.11-1
bluez-utils-2.10-2
bluez-libs-devel-2.10-2
bluez-libs-2.10-2
bluez-utils-cups-2.10-2
I thought I had installed the recent bluez packages and was looking into the codes of bluez-2.24 packages. That explains the error.
Anyway, I could solve the problem of my_hci_read_rssi function - it was a stupid typo. I should have literally copied your hci_read_rssi function rather than typing it myself. But again, I am not fond of your choice of variables either (rq, rp etc. :P which was the reason of my typo). :D
As I will be making a GUI version considering only RSSI, LQ & TPL part, I think I will not go into installing the newer version of bluez (I also work on my ancient Laptop which has bluez-2.4-1).
I have chosen GTK+ for dealing with the GUI version. Any suggestions on that?
My work is to record RSSI, LQ and TPL correcponding to a location (i.e. location fingerprint) in a user-friendly way!
Thanks
Mahtab
Marcel Holtmann <[email protected]> wrote: Hi Mahtab,
> My project is to work with rssi/tpl/lq. My initial goal is to read
> them and show them graphically with some handy features!
>
> I have gone through hcitool.c (most of the code) and tried to exactly
> copy the necessary things only to retrieve RSSI. But, I couldn't call
> "hci_read_rssi" as them. Compiling my program gave this error:
>
> mySignalScan.c:102: warning: implicit declaration of function
> `hci_read_rssi'
> mySignalScan.c: At top level:
> /tmp/cc4x36ri.o(.text+0x25b): In function `cmd_rssi':
> : undefined reference to `hci_read_rssi'
> collect2: ld returned 1 exit status
looks like you need to install a newer bluez-libs package.
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
Yahoo! Photos ? Showcase holiday pictures in hardcover
Photo Books. You design it and we?ll bind it!
Hi Mahtab,
> My project is to work with rssi/tpl/lq. My initial goal is to read
> them and show them graphically with some handy features!
>
> I have gone through hcitool.c (most of the code) and tried to exactly
> copy the necessary things only to retrieve RSSI. But, I couldn't call
> "hci_read_rssi" as them. Compiling my program gave this error:
>
> mySignalScan.c:102: warning: implicit declaration of function
> `hci_read_rssi'
> mySignalScan.c: At top level:
> /tmp/cc4x36ri.o(.text+0x25b): In function `cmd_rssi':
> : undefined reference to `hci_read_rssi'
> collect2: ld returned 1 exit status
looks like you need to install a newer bluez-libs package.
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users