Skip to content
Snippets Groups Projects
Commit 53874a25 authored by clohr's avatar clohr
Browse files

Cas d'usage avec blueproximity

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/C/trunk@1260 b32b6428-25c9-4566-ad07-03861ab6144f
parent fba04e76
No related branches found
No related tags found
No related merge requests found
## generic-sender
# generic-sender
This is a dummy xAAL device.
It waits for (json) data on a named unix pipe.
Then it sends those data on the xAAL bus via attributesChange notifications.
It also can reply to getAttributes request with the last known data and the associated date.
* Motion
To be hosnest, this small xAAL device was designed to work with "motion"
http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome
## Motion
To be hosnest, this small xAAL device was designed to work with [motion][http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome]
Motion is a program that monitors one or many local or remote webcams and detect motions on pictures.
It then can record frames, movies, log events on databases, etc.
......@@ -15,12 +14,29 @@ Among those functionnalities, it can execute a command when it detects motions.
I propose to use this.
For instance, let's start "motion" and "generic-sender" in parallel.
Le's "./generic-sender.pipe" be the named pipe listened by generic-sender
Le's `./generic-sender.pipe` be the named pipe listened by generic-sender
The config file of motion could contain:
on_event_start echo '{"motion":"start"}' > ./generic-sender.pipe
on_event_end echo '{"motion":"end"}' > ./generic-sender.pipe
on_motion_detected echo '{"motion":"detected"}' > ./generic-sender.pipe
on_event_start echo '{"motion":"start"}' > ./generic-sender.pipe
on_event_end echo '{"motion":"end"}' > ./generic-sender.pipe
on_motion_detected echo '{"motion":"detected"}' > ./generic-sender.pipe
See "motion.conf" for details.
Finally, one get a powerfull xAAL motion sensor without efforts.
## BlueProximity
Another usercase is to use this small xAAL device in conjuntion with [blueproximity][http://blueproximity.sourceforge.net/]
BlueProximity is a programm designed to detect your bluetooth device (e.g., your smartphone) and lock/unlock your session on your desktop.
This is a "bluetooth smart lock" service. Do not confuse with Bluetooth LE beacon profile.
The idea here is to reuse it. Instead of sending commands to the screensaver to lock/unlock your session, I propose to sends json messages to the small xAAL device presented here.
Note: to configure blueproximity, you first need to pair your device and your desktop (without any active connexion).
Then, setup something like this:
lock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"coming"}' > ./generic-sender.pipe
unlock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"leaving"}' > ./generic-sender.pipe
proximity_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"present"}' > ./generic-sender.pipe
You also have to tune timers in proximity thresholds (not realy a distance, but in radio signal level)
Then, put your configuration file in $HOME/.blueproximity/xxxx.conf
See `blueproximity_xAAL.conf` for details.
device_mac = 44:80:EB:F3:C3:C1
device_channel = 2
lock_distance = 6
lock_duration = 3
unlock_distance = 4
unlock_duration = 1
lock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"coming"}' > ./generic-sender.pipe
unlock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"leaving"}' > ./generic-sender.pipe
proximity_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"present"}' > ./generic-sender.pipe
proximity_interval = 10
buffer_size = 1
log_to_syslog = False
log_syslog_facility = local7
log_to_file = False
log_filelog_filename = /home/user/blueproximity.log
## generic-sender
# generic-sender
This is a dummy xAAL device.
It waits for (json) data on a named unix pipe.
Then it sends those data on the xAAL bus via attributesChange notifications.
It also can reply to getAttributes request with the last known data and the associated date.
* Motion
To be hosnest, this small xAAL device was designed to work with "motion"
http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome
## Motion
To be hosnest, this small xAAL device was designed to work with [motion][http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome]
Motion is a program that monitors one or many local or remote webcams and detect motions on pictures.
It then can record frames, movies, log events on databases, etc.
......@@ -15,12 +14,29 @@ Among those functionnalities, it can execute a command when it detects motions.
I propose to use this.
For instance, let's start "motion" and "generic-sender" in parallel.
Le's "./generic-sender.pipe" be the named pipe listened by generic-sender
Le's `./generic-sender.pipe` be the named pipe listened by generic-sender
The config file of motion could contain:
on_event_start echo '{"motion":"start"}' > ./generic-sender.pipe
on_event_end echo '{"motion":"end"}' > ./generic-sender.pipe
on_motion_detected echo '{"motion":"detected"}' > ./generic-sender.pipe
on_event_start echo '{"motion":"start"}' > ./generic-sender.pipe
on_event_end echo '{"motion":"end"}' > ./generic-sender.pipe
on_motion_detected echo '{"motion":"detected"}' > ./generic-sender.pipe
See "motion.conf" for details.
Finally, one get a powerfull xAAL motion sensor without efforts.
## BlueProximity
Another usercase is to use this small xAAL device in conjuntion with [blueproximity][http://blueproximity.sourceforge.net/]
BlueProximity is a programm designed to detect your bluetooth device (e.g., your smartphone) and lock/unlock your session on your desktop.
This is a "bluetooth smart lock" service. Do not confuse with Bluetooth LE beacon profile.
The idea here is to reuse it. Instead of sending commands to the screensaver to lock/unlock your session, I propose to sends json messages to the small xAAL device presented here.
Note: to configure blueproximity, you first need to pair your device and your desktop (without any active connexion).
Then, setup something like this:
lock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"coming"}' > ./generic-sender.pipe
unlock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"leaving"}' > ./generic-sender.pipe
proximity_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"present"}' > ./generic-sender.pipe
You also have to tune timers in proximity thresholds (not realy a distance, but in radio signal level)
Then, put your configuration file in $HOME/.blueproximity/xxxx.conf
See `blueproximity_xAAL.conf` for details.
device_mac = 44:80:EB:F3:C3:C1
device_channel = 2
lock_distance = 6
lock_duration = 3
unlock_distance = 4
unlock_duration = 1
lock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"coming"}' > ./generic-sender.pipe
unlock_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"leaving"}' > ./generic-sender.pipe
proximity_command = echo '{"proximityDevice":"Nexus6_Christophe", "proximityStatus":"present"}' > ./generic-sender.pipe
proximity_interval = 10
buffer_size = 1
log_to_syslog = False
log_syslog_facility = local7
log_to_file = False
log_filelog_filename = /home/user/blueproximity.log
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment