maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Request] N900 Bluetooth Identifier (https://talk.maemo.org/showthread.php?t=41669)

Lord Awesome 2010-02-08 14:01

Re: [Request] N900 Bluetooth Identifier
 
Just leave the bluetooth name set to Nokia N900. Or if you're feeling a little creative you could add N900 onto whatever it's currently set to.

stobbsc 2010-02-08 14:04

Re: [Request] N900 Bluetooth Identifier
 
that would be the easy way of doing things :)

robota 2010-02-09 12:29

Re: [Request] N900 Bluetooth Identifier
 
Quote:

Originally Posted by stobbsc (Post 516255)
that would be the easy way of doing things :)

so the app should just scan for other devices with N900 in the name and if possible verify that the device name contains this string - I have BT always on.

stobbsc 2010-02-09 12:31

Re: [Request] N900 Bluetooth Identifier
 
Well I was hoping the app could scan for the LAP codes I posted earlier, and if it finds a device with one then you get a message or something.

Also perhaps if someone tries to pair with you can they have one of those lap codes that you get told it's an N900 trying to connect, not sure if that is possible though

robbiem 2010-02-09 13:12

Re: [Request] N900 Bluetooth Identifier
 
I changed my bt name as soon as i got my n900, the LAP codes is a good idea. why not incorporate both, as in either. n900 in the name or the 00:BD:3A lap, which seems very common for n900.

stobbsc 2010-02-09 13:15

Re: [Request] N900 Bluetooth Identifier
 
Thats a good idea. I think I covered most if not all the lap codes earlier.

robota 2010-02-09 16:10

Re: [Request] N900 Bluetooth Identifier
 
Example to detect: 00:BD:3A and 00:BD:3B ... (expand with \| as address separator)

Code:

#!/bin/bash
a=`hcitool scan --class |\
awk '/BD Address/ {print substr($3,0,8)}' |\
grep '00:BD:3A\|00:BD:3B'`;
echo $a;
if [ "$a" ]
then
dbus-send --type=method_call \
--dest=org.freedesktop.Notifications \
/org/freedesktop/Notifications \
org.freedesktop.Notifications.SystemNoteDialog \
string:'Pizza! N900 here!' uint32:0 string:'OK'
fi;

Save code to: ~/n900finder.sh
Make executable: chmod 755 ~/n900finder.sh
and add a shortcut on your desktop or execute from xterminal (~/n900finder.sh).

It shows an alert (Pizza) if found, otherwise it does nothing.

You can schedule using cron or add a loop and a sleep to have it running in the background.

stobbsc 2010-02-09 16:25

Re: [Request] N900 Bluetooth Identifier
 
wow that seemed pretty straight forward.

I've never coded for Maemo beofre but jsut been reading up about MADDE:http://wiki.maemo.org/MADDE

So I guess I should try MADDE out and use/adapt your code to becoming an app ;-)

Thanks for the starting blocks :-)

robota 2010-02-09 16:29

Re: [Request] N900 Bluetooth Identifier
 
To test execute:

hcitool scan --class

from your Xterminal on N900, copy a BT address (first 6 digits) and replace 00:BD:3A (line #4) with the LAP you copied. Now the alert should appear if that device is discoverable.

Nicer would be to add a handful of python or perl to incorporate the name of the detected device in the alert ...

robota 2010-02-09 16:31

Re: [Request] N900 Bluetooth Identifier
 
Quote:

Originally Posted by stobbsc (Post 517907)
wow that seemed pretty straight forward.

I've never coded for Maemo beofre but jsut been reading up about MADDE:http://wiki.maemo.org/MADDE

So I guess I should try MADDE out and use/adapt your code to becoming an app ;-)

Thanks for the starting blocks :-)

That part is for you, never to late to code!


All times are GMT. The time now is 07:06.

vBulletin® Version 3.8.8