I tend to do things the Unix way... :) I have a script hat uses l2ping
to check for the MAC, and then touch a file. MH looks for that file once
a minute and then knows if the phone is in range or not. I can provide
the script and MH code if anyone is interested.

Tim
 
Hi,

I have also a unix solution running for the moment with hcitool. My script tries to make a conection to an remote device and writes some data to a log file on success. MH reads this file and acts when a new line is added to the file. This looks like almost the same as what you describe. For me there are some issues with this method :

If the unix script hangs (which happens from time to time in my case) then MH doesn't know about this. Even when it is started with a process item.
I would like to have different check intervals when a device is in range versus not in range. When I am at home it is good enough for MH to check every 5 minutes but when I am not at home I would like to detect ASAP when my device comes in range again to already turn on the front door light for example. This kind of behaviour is easier to implement from within MH
My mobile phone battery drains quicker when i do Bluetooth connect every 15 seconds for example.

Harder to keep state in between mh restarts.

Not usable on Windows server. No problem for me ;-)

I would also like to see if the load is lower with the NET::Bluetooth PM module because my MH runs on an NSLU2 with verry limited resources.
It also looks cleaner to my to use the NET:Bluetooth module so we can add more bluetooth functionality into mh like file transfers, ical sync, send sms from MH, alert when new devices come in reach when your is isolated for example, etc ...

So this is why i was playing with the perl module.

BTW I played a litle bit with the l2ping command and it is giving "Connection reset by peer" on one of my devices. So it is not usable to start a continious ping command and the script should start the ping every X seconds.

I don't give up yet and will try in implement this the perl way to see if i can add bluetooth support for MH

greetz,
Nico

--
Visit my site at http://www.yow.be