<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JoPa.Fr &#187; Développement</title>
	<atom:link href="http://www.jopa.fr/index.php/tag/developpement/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jopa.fr</link>
	<description>001100010BIDOUILLE11101010111100010LIBRE1000100111100101</description>
	<lastBuildDate>Tue, 10 Jan 2012 21:59:31 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Evolus Pencil Project &#8211; Des dessins d&#8217;IHM en quelques clics&#8230;</title>
		<link>http://www.jopa.fr/index.php/2010/07/31/evolus-pencil-project-des-dessins-dihm-en-quelques-clics/</link>
		<comments>http://www.jopa.fr/index.php/2010/07/31/evolus-pencil-project-des-dessins-dihm-en-quelques-clics/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 19:52:34 +0000</pubDate>
		<dc:creator>Jopa</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Planet-Libre]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Logiciels Libres]]></category>

		<guid isPermaLink="false">http://www.jopa.fr/?p=2357</guid>
		<description><![CDATA[Pour les phases d&#8217;analyse ou l&#8217;écriture de spécifications pour des projets logiciels, j&#8217;étais à la recherche d&#8217;un outil permettant de dessiner, bêtement et rapidement, des maquettes d&#8217;écrans, de formulaires ou de page web. Ce type d&#8217;application ne manque pas parmi les logiciels commerciaux, mais n&#8217;est pas forcément facile à dénicher dans le monde libre. Bien [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://www.jopa.fr/wp-content/uploads/2010/07/evolus_pencil.png"><img class="alignleft size-full wp-image-2358" title="evolus_pencil" src="http://www.jopa.fr/wp-content/uploads/2010/07/evolus_pencil.png" alt="" width="294" height="204" /></a>Pour les phases d&#8217;analyse ou l&#8217;écriture de spécifications pour des projets logiciels, j&#8217;étais à la recherche d&#8217;un outil permettant de dessiner, bêtement et rapidement, des maquettes d&#8217;écrans, de formulaires ou de page web. Ce type d&#8217;application ne manque pas parmi les logiciels commerciaux, mais n&#8217;est pas forcément facile à dénicher dans le monde libre.</p>
<p style="text-align: justify;">Bien sûr, nous pouvons toujours nous en sortir avec <a title="Dia" href="http://projects.gnome.org/dia/" target="_blank">Dia</a>, <a href="http://www.inkscape.org/?lang=fr" target="_blank">Inkscape</a>, <a href="http://www.openoffice.org/" target="_blank">Openoffice</a> ou <a href="http://www.tuxpaint.org/?lang=fr" target="_blank">tout autre logiciel</a> permettant le tracé de formes géométriques, mais le fait de de disposer de modèles de composants (widgets), à l&#8217;échelle, facilement positionables et alignables apportent un confort non négligeable.</p>
<p style="text-align: justify;">Vous l&#8217;avez compris, <em><a href="http://pencil.evolus.vn" target="_blank">Evolus </a></em><em><a href="http://pencil.evolus.vn" target="_blank">Pencil Project</a> </em>rempli parfaitement ce rôle.</p>
<p style="text-align: justify;"><span id="more-2357"></span></p>
<p style="text-align: justify;"><em>Pencil Project, </em>à ne pas confondre avec l&#8217;outil de dessin et d&#8217;animation 2D du même nom (<a href="http://www.pencil-animation.org/" target="_blank">pencil</a>),<em> </em>est une extension <em>Firefox</em>, développée sous <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">licence GPL</a> par la société Vietnamienne <a href="http://www.evolus.vn/" target="_blank">Evolus</a>. Elle est tout de même disponible en version &laquo;&nbsp;<em>standalone</em>&laquo;&nbsp;, grâce à une exécution avec Xulrunner.</p>
<p style="text-align: justify;">L&#8217;interface est sobre et la prise en main extrêmement rapide. L&#8217;application est fournie avec plusieurs styles de &laquo;&nbsp;<em>widgets</em>&nbsp;&raquo; qui s&#8217;intègrent dans votre maquette par un simple glissé / déposé. Des guides dynamiques aident au positionnement des composants. Les principales fonctions de dessin vectoriel sont disponibles (dessus, dessous, alignement, agrandissement, rotation, etc&#8230;) et permettent de <em>fignoler </em>la mise en page pour un résultat très propre.</p>
<p style="text-align: center;"><a href="http://www.jopa.fr/wp-content/uploads/2010/07/pencil.png"><img class="aligncenter size-full wp-image-2364" title="pencil" src="http://www.jopa.fr/wp-content/uploads/2010/07/pencil.png" alt="" width="460" height="354" /></a></p>
<p style="text-align: center;"><span style="color: #333399;"><em><span style="color: #800000;">Copie d&#8217;écran</span></em></span></p>
<p style="text-align: justify;">L&#8217;enregistrement des fichier se fait sous l&#8217;extension &laquo;&nbsp;.ep&nbsp;&raquo;, un format XML propre à <em>Evolus Pencil.</em> Pour la réutilisation d&#8217;un dessin dans un document ou tout simplement pour l&#8217;impression, il faut passer par un export au format <a href="http://http://fr.wikipedia.org/wiki/Portable_Network_Graphics" target="_blank">PNG</a>. Des exports vers d&#8217;autres formats (OpenOffice, Word, PDF, &#8230; ) sont prévus moyennant l&#8217;ajout de &laquo;&nbsp;templates&nbsp;&raquo;. A ce jour, je n&#8217;ai pas exploré cette piste, le format <em>PNG</em> me convenant parfaitement. Je regrette juste l&#8217;impossibilité d&#8217;imprimer directement depuis l&#8217;application.</p>
<p style="text-align: center;"><a href="http://www.jopa.fr/wp-content/uploads/2010/07/Cotations.png"><img class="size-full wp-image-2360  aligncenter" title="Cotations" src="http://www.jopa.fr/wp-content/uploads/2010/07/Cotations.png" alt="" width="504" height="635" /></a></p>
<p style="text-align: center;"><span style="color: #800000;"><em>Exemple de maquette  ( le message d&#8217;erreur a été vu sur : </em></span><a href="http://www.risacher.com/la-rache" target="_blank"><span style="color: #800000;"><em>http://www.risacher.com/la-rache</em></span></a><span style="color: #800000;"><em> )</em></span></p>
<p style="text-align: left;"><strong>Lien :</strong></p>
<p style="text-align: center;"><a href="http://pencil.evolus.vn"><img class="size-full wp-image-2393 aligncenter" title="stencil_logo" src="http://www.jopa.fr/wp-content/uploads/2010/07/stencil_logo1.png" alt="" width="407" height="274" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jopa.fr/index.php/2010/07/31/evolus-pencil-project-des-dessins-dihm-en-quelques-clics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pam et Mir:ror : une authentification RFID sous Linux</title>
		<link>http://www.jopa.fr/index.php/2009/07/16/linux-pam-et-mirror-une-authentification-rfid/</link>
		<comments>http://www.jopa.fr/index.php/2009/07/16/linux-pam-et-mirror-une-authentification-rfid/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 23:10:03 +0000</pubDate>
		<dc:creator>Jopa</dc:creator>
				<category><![CDATA[Bidouilles]]></category>
		<category><![CDATA[Configurations]]></category>
		<category><![CDATA[Planet-Libre]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mir:ror]]></category>
		<category><![CDATA[rfid]]></category>
		<category><![CDATA[Sécurité]]></category>

		<guid isPermaLink="false">http://www.jopa.fr/?p=1461</guid>
		<description><![CDATA[Cette pluvieuse journée du 14 juillet m&#8217;a permis de poursuivre mes petits travaux sur le lecteur rfid &#171;&#160;Mir:ror&#160;&#187;. Dans les articles précédents, je me suis surtout intéressé au déclenchement d&#8217;événements en fonction des puces rfid détectées (ou pas) par le lecteur, oubliant l&#8217;essence même du RFID : l&#8217;authentification. J&#8217;ai donc profité de ce temps à [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><img class="alignleft size-full wp-image-1462" title="pam_mirror" src="http://www.jopa.fr/wp-content/uploads/2009/07/pam_mirror.jpg" alt="pam_mirror" width="201" height="204" />Cette pluvieuse journée du 14 juillet m&#8217;a permis de poursuivre mes petits travaux sur le lecteur rfid &laquo;&nbsp;Mir:ror&nbsp;&raquo;. Dans les articles précédents, je me suis surtout intéressé au déclenchement d&#8217;événements en fonction des puces <em>rfid </em>détectées (ou pas) par le lecteur, oubliant l&#8217;essence même du RFID : l&#8217;authentification. J&#8217;ai donc profité de ce temps à ne pas mettre mon chat dehors pour écrire un module <a title="http://fr.wikipedia.org/wiki/Pluggable_Authentication_Modules" href="http://fr.wikipedia.org/wiki/Pluggable_Authentication_Modules">PAM (Pluggable Authentification Module)</a> permettant d&#8217;authentifier un utilisateur via le <em>Mir:ror</em>.</p>
<p style="text-align: justify;">L&#8217;idée est simple : si mon <em>Mir:ror</em> est connecté à l&#8217;ordinateur et qu&#8217;un fichier contenant mon <em>rfid </em>est présent dans mon répertoire, je veux pouvoir ouvrir ma session à l&#8217;aide d&#8217;une puce <em>RFID </em>(carte, badge, ztamp:s, laaaaapin&#8230;) à la place de saisir mon mot de passe.</p>
<p style="text-align: justify;"><span id="more-1461"></span></p>
<p style="text-align: justify;">Je ne vais pas m&#8217;attarder ici à décrire la manière dont est codé le module, je vous laisse le soin de lire les sources&#8230; Je vais me contenter d&#8217;expliquer son installation et son utilisation.</p>
<h2>Mise en garde :</h2>
<p style="text-align: justify;">Pour plusieurs raisons dont la simplification du module et mes piètres talents de développeur, il va sans dire que ce petit programme ne doit pas être utilisé en environnement sécurisé. Par contre, pour la maison, c&#8217;est plutôt fun !</p>
<p style="text-align: justify;"><em>Nous touchons ici à une partie sensible du système : l&#8217;authentification. Les manipulations ci-dessous sont donc à réaliser avec prudence.</em></p>
<h2>Compilation :</h2>
<p>Pour pouvoir compiler <em>pam_mir-ror</em>, il nous faut installer un version récente de la librairie de développement pam (libpam-dev). J&#8217;ai utilisé la version 1.0.1 proposée par défaut sous Debian Lenny.</p>
<p><span style="color: #800000;">$ sudo aptitude install libpam-dev</span></p>
<p>L&#8217;archive contenant les sources est téléchargeable ci-dessous :</p>
<ul>
<li><a href="http://www.jopa.fr/wp-content/uploads/2009/07/pam_mir-ror.0.2.tar.gz">pam_mir-ror.0.2.tar.gz</a></li>
</ul>
<p style="text-align: justify;">Une fois téléchargée, il faut la décompresser et tout simplement lancer la commande &laquo;&nbsp;make&nbsp;&raquo;.</p>
<p><span style="color: #800000;">$ tar -xvzf pam_mir-ror.0.2.tar.gz<br />
$ cd pam_mir-ror.0.2<br />
$ make</span></p>
<p style="text-align: justify;">Si tout se passe bien, nous devrions obtenir deux binaires :</p>
<ul style="text-align: justify;">
<li>read_mir-ror : Un petit outil permettant la lecture à partir du Mir:ror,</li>
<li style="text-align: justify;">pam_mir-ror.so : Le module pam.</li>
</ul>
<h2 style="text-align: justify;">read_mir-ror</h2>
<p style="text-align: justify;">Le petit outil read_mir-ror va nous permettre de tester le lecteur. Il suffit de l&#8217;exécuter et d&#8217;approcher une puce rfid.</p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo ./read_mirror<br />
0000D0081A025303420200D2</span></p>
<p style="text-align: justify;">La série de chiffres affichée n&#8217;est rien d&#8217;autre que l&#8217;ID de l&#8217;objet détecté.</p>
<p style="text-align: justify;"><em>Il est préférable d&#8217;utiliser read_mirror avec les droits root, au moins la première fois, pour l&#8217;accès au périphérique mir:ror. Par défaut, le mir:ror n&#8217;est accessible que par root. Les droits du handler sont changés à la première utilisation de la fonction de détection (inclue dans l&#8217;outil et le module). Il serait certainement plus propre de coder un petit outil qui serait automatiquement lancé par udev ou hotplug au branchement du Mir:ror, mais pour un module PAM, ce n&#8217;est pas très important.<br />
</em></p>
<h2 style="text-align: justify;">Génération du fichier utilisateur</h2>
<p style="text-align: justify;">Le même outil (read_mir-ror), va nous permettre de générer le fichier <em>.authtag </em>contenant le rfid propre à chaque utilisateur :</p>
<p style="text-align: justify;">Pour l&#8217;utilisateur courant :</p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo ./read_mirror &gt; ~/.authtag<br />
$ sudo chmod 400 ~/.authtag</span></p>
<p style="text-align: justify;">Pour un autre utilisateur  (toto):</p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo ./read_mirror &gt; /home/toto/.authtag<br />
$ sudo chmod 400 /home/toto/.authtag</span></p>
<p style="text-align: justify;">Il faut bien entendu présenter la puce au lecteur juste après la commande <em>./read_mirror</em>.<br />
Le fichier .authtag doit maintenant contenir le tag :</p>
<p><span style="color: #800000;">$ cat ~/.authtag</span><br />
<span style="color: #800000;">0000D0081A025303420200D2</span></p>
<h2 style="text-align: justify;">Module PAM  :  pam_mir:ror.so</h2>
<p style="text-align: justify;">Pour qu&#8217;il soit utilisable par PAM, il faut que <em>pam_mir:ror.so</em> soit présent dans /lib/security (lib64/security pour une architecture 64 bits)</p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo cp pam_mir-ror.so /lib/security</span></p>
<p style="text-align: justify;">ou pour un module 64 bits :</p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo cp pam_mir-ror.so /lib64/securit</span>y</p>
<p style="text-align: justify;">La dernière étape va être l&#8217;ajout du module à PAM. Pour cela, il nous faut éditer le fichier :<br />
<em>/etc/pam.d/common-auth </em>pour y ajouter, avant les modules pam_unix.so ou pam_unix2.so :</p>
<p style="text-align: justify;"><em>auth             sufficient         pam_mir-ror.so</em></p>
<p style="text-align: justify;"><em>/etc/pam.d/common-auth</em></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1461code2'); return false;">View Code</a> INI</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14612"><td class="code" id="p1461code2"><pre class="ini" style="font-family:monospace;">#
# /etc/pam.d/common-auth - authentication settings common to all services
...
auth    sufficient                      pam_mir-ror.so
# here are the per-package modules <span style="">&#40;</span>the <span style="color: #933;">&quot;Primary&quot;</span> block<span style="">&#41;</span>
auth    <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>success<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1 default=ignore<span style="">&#93;</span></span>      pam_unix.so nullok_secure</span>
# here's the fallback if no module succeeds
auth    requisite                       pam_deny.so
# prime the stack with a positive return value if there isn't one already<span style="color: #666666; font-style: italic;">;</span>
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth    required                        pam_permit.so
# and here are more per-package modules <span style="">&#40;</span>the <span style="color: #933;">&quot;Additional&quot;</span> block<span style="">&#41;</span>
# end of pam-auth-update config</pre></td></tr></table></div>

<p style="text-align: justify;">Avant de rebooter frénétiquement la machine pour voir ce que ça peut donner avec <em>gdm</em>,  je conseille vivement de tester sur une console (crtl-alt-F1 par exemple)&#8230; Comme expliqué en début d&#8217;article, nous touchons ici à une partie sensible du système et c&#8217;est mieux de garder la main pour éviter des pirouettes telles qu&#8217;un redémarrage en single user ou à partir d&#8217;un liveCD pour réparer.</p>
<p style="text-align: justify;">J&#8217;ai fait en sorte que le module loggue un minimum. En fonction du système, ces logs sont visibles dans /var/log/auth.log ou /var/log/syslog.</p>
<p style="text-align: justify;"><a href="http://www.jopa.fr/wp-content/uploads/2009/07/shell1.png"><img class="aligncenter size-full wp-image-1478" title="shell" src="http://www.jopa.fr/wp-content/uploads/2009/07/shell1.png" alt="shell" width="457" height="263" /></a></p>
<p style="text-align: justify;">Dernière version des sources : <a href="http://www.jopa.fr/wp-content/uploads/2009/07/pam_mir-ror.0.2.tar.gz">pam_mir-ror.0.2.tar.gz</a></p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://www.jopa.fr/index.php/2009/07/16/linux-pam-et-mirror-une-authentification-rfid/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Mir:ror mon beau Mir:ror&#8230;Comment puis-je te comprendre ?</title>
		<link>http://www.jopa.fr/index.php/2009/07/12/violet-mirror-acces-device-c/</link>
		<comments>http://www.jopa.fr/index.php/2009/07/12/violet-mirror-acces-device-c/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 00:22:12 +0000</pubDate>
		<dc:creator>Jopa</dc:creator>
				<category><![CDATA[Bidouilles]]></category>
		<category><![CDATA[Divers]]></category>
		<category><![CDATA[Planet-Libre]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mir:ror]]></category>
		<category><![CDATA[rfid]]></category>

		<guid isPermaLink="false">http://www.jopa.fr/?p=1415</guid>
		<description><![CDATA[Dans mon précédent article, je présentais mir:ror, le petit lecteur RFID commercialisé par la société Violet.  Après avoir survolé leur application &#171;&#160;Mirware&#160;&#187; et mis en évidence les limites de son utilisation, je vais mettre &#171;&#160;les mains dans le cambouis&#160;&#187; pour essayer de comprendre comment communiquer avec Mir:ror.  L&#8217;idée étant de pouvoir coder de petits outils [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><img class="alignright size-medium wp-image-1437" title="miror" src="http://www.jopa.fr/wp-content/uploads/2009/07/miror-300x254.jpg" alt="miror" width="184" height="156" />Dans mon <a title="http://www.jopa.fr/index.php/2009/07/07/violet-mirror-linux" href="http://www.jopa.fr/index.php/2009/07/07/violet-mirror-linux">précédent article</a>, je présentais <em>mir:ror</em>, le petit lecteur RFID commercialisé par la société <a title="http://www.violet.net/" href="http://www.violet.net/">Violet</a>.  Après avoir survolé leur application &laquo;&nbsp;Mirware&nbsp;&raquo; et mis en évidence les limites de son utilisation, je vais mettre &laquo;&nbsp;les mains dans le cambouis&nbsp;&raquo; pour essayer de comprendre comment communiquer avec Mir:ror.  L&#8217;idée étant de pouvoir coder de petits outils capables de réagir à des tags RFID.</p>
<p style="text-align: justify;"><span id="more-1415"></span></p>
<p style="text-align: justify;">D&#8217;un point de vu système, Mir:ror est directement reconnu sous Linux et accessible via le handler de périphérique /dev/hidraw<em>X</em> (où <em>X</em> est le numéro de périphérique, normalement &laquo;&nbsp;0&#8243; si c&#8217;est le premier appareil du genre connecté).</p>
<p style="text-align: justify;">La petite application &laquo;&nbsp;<em>discover-device</em>&laquo;&nbsp;, fournie avec <em>Mirware</em>, permet de le détecter automatiquement :</p>
<p style="text-align: justify;"><img class="aligncenter size-full wp-image-1417" title="discover-device" src="http://www.jopa.fr/wp-content/uploads/2009/07/discover-device.png" alt="discover-device" width="457" height="246" /></p>
<p style="text-align: justify;">Attention tout de même aux droits, le périphérique n&#8217;est par défaut accessible que par <em>root</em>, il faudra lui changer les droits ou utiliser le script &laquo;&nbsp;<em>installer.sh</em>&nbsp;&raquo; pour le faire, avant de pouvoir l&#8217;exploiter avec un utilisateur standard.</p>
<p style="text-align: justify;">Commençons par voir ce qu&#8217;il se passe avec un simple &laquo;&nbsp;cat&nbsp;&raquo; du fichier :</p>
<p style="text-align: justify;"><img class="size-full wp-image-1421 aligncenter" title="cat-miror" src="http://www.jopa.fr/wp-content/uploads/2009/07/cat-miror.png" alt="cat-miror" width="457" height="246" /></p>
<p style="text-align: justify;">Des hiéroglyphes s&#8217;affichent lorsque nous approchons ou retirons un tag&#8230; C&#8217;est plutôt bon signe, et visiblement c&#8217;est binaire ! Nous devrions y voir plus clair avec un affichage en hexadécimal.  <em>Hexdump</em> est idéal pour ça !</p>
<p style="text-align: justify;"><img class="aligncenter size-full wp-image-1422" title="hexdump" src="http://www.jopa.fr/wp-content/uploads/2009/07/hexdump.png" alt="hexdump" width="457" height="246" /></p>
<p style="text-align: justify;">La première ligne (0000 0000 0000 0000 0000 0000 0000 0000 *) nous indique que tant qu&#8217;il ne se passe rien, on lit des zéros&#8230; Où&#8230;Qu&#8217;on lit des zéros tant qu&#8217;il ne se passe rien ! (c&#8217;est plutôt normal).<br />
Les deux lignes suivantes (0102 0000 d008 1a02 5303 4202 00d2 0000 &#8211; 0000 0000 0000 0000 0000 0000 0000 0000) s&#8217;affichent lorsqu&#8217;un tag est approché, les deux dernières ( 0202 0000 d008 1a02 5303 4202 00d2 0000 &#8211; 0000 0000 0000 0000 0000 0000 0000 0000 ) lorsqu&#8217;on éloigne le tag.</p>
<p style="text-align: justify;">Après plusieurs tests, j&#8217;en déduis assez facilement que les deux premiers octets (0102 ou 0202) codent l&#8217;évènement. J&#8217;en ai repéré 4 types :</p>
<ul style="text-align: justify;">
<li>0&#215;0102 : Tag rfid détecté,</li>
<li>0&#215;0202 : Tag rfid retiré,</li>
<li>0&#215;0501 : Le mir:ror est mis à l&#8217;envert,</li>
<li>0&#215;0401 : Le mir:ror est remis à l&#8217;endroit.</li>
</ul>
<p style="text-align: justify;">Les 12 octets suivants semblent identifier la puce RFID.</p>
<p style="text-align: justify;">A titre de test, écrivons rapidement un petit bout de code C, prenant le device en paramètre et affichant les évènements et le tag associé :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1415code7'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14157"><td class="code" id="p1415code7"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Jopa - Petit test du Mir:ror : test_mirror.c</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  FILE <span style="color: #339933;">*</span>mirror<span style="color: #339933;">;</span>
  <span style="color: #993333;">short</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> block<span style="color: #339933;">;</span>
  <span style="color: #993333;">short</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> event<span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> tag<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">25</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Vérification du paramètre (device)</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>argc<span style="color: #339933;">!=</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Usage : %s mirror_device <span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        exit<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Ouverture du fichier device</span>
  mirror <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;rb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>mirror<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Accès à  %s impossible !<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        exit<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Boucle en lecture</span>
  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     fread<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>event<span style="color: #339933;">,</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>mirror<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>event<span style="color: #339933;">!=</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Evenement detecté, lecture de l'ID</span>
        <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">6</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            fread<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>block<span style="color: #339933;">,</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>mirror<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            sprintf<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>tag<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">*</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%04X&quot;</span><span style="color: #339933;">,</span>block<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">//Affichage en fonction de l'événement</span>
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Tag On</span>
            <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x102</span> <span style="color: #339933;">:</span>
                <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%s : ON<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>tag<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Tag Off</span>
             <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x202</span> <span style="color: #339933;">:</span>
                 <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%s : OFF<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>tag<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Mirror envers</span>
             <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x501</span> <span style="color: #339933;">:</span>
                 <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;MIR:ROR ENVERS<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Mirror endroit</span>
             <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x401</span> <span style="color: #339933;">:</span>
                   <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;MIR:ROR ENDROIT<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Default</span>
             <span style="color: #b1b100;">default</span> <span style="color: #339933;">:</span>
                   <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Evénement inconnu<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//switch</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//if (event</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//while (1)</span>
<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// main()</span></pre></td></tr></table></div>

<p style="text-align: justify;">En quelques lignes, nous ouvrons le périphérique dont le handler est passé en paramètre et bouclons sur sa lecture, 2 octets par 2 octets.<br />
Quand autre chose que &laquo;&nbsp;0&#8243; est détecté, c&#8217;est forcément un changement d&#8217;état. Nous lisons ensuite l&#8217;identifiant de la puce RFID.<br />
La dernière partie affiche un message en fonction de l&#8217;évènement détecté.</p>
<p style="text-align: justify;">Il ne reste plus qu&#8217;à le compiler et le tester :<br />
<span style="color: #800000;">$ gcc test_mirror.c -o test_mirror<br />
$ ./test_mirror</span></p>
<p><img class="aligncenter size-full wp-image-1434" title="test_mirror" src="http://www.jopa.fr/wp-content/uploads/2009/07/test_mirror.png" alt="test_mirror" width="497" height="331" /></p>
<p><span style="color: #800000;">Pour compléter l&#8217;exemple, nous pouvons rajouter l&#8217;exécution d&#8217;un script associé au tag et à son approche ou son éloignement. Les scripts pourraient être stockés dans le répertoire de l&#8217;utilisateur et porter l&#8217;<em>&lt;id&gt;-on.sh</em> ou l&#8217;<em>&lt;id&gt;-off.sh</em> comme nom. Pour l&#8217;exemple :</span></p>
<ul>
<li>0000D0081A025303420200D2-on.sh : Lancement de Firefox sur le blog de Jopa</li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1415code8'); return false;">View Code</a> SH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14158"><td class="code" id="p1415code8"><pre class="sh" style="font-family:monospace;">#!/bin/sh
firefox http://www.jopa.fr</pre></td></tr></table></div>

<ul>
<li>0000D0081A025303420200D2-off.sh : Lancement de Thunderbird</li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1415code9'); return false;">View Code</a> SH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14159"><td class="code" id="p1415code9"><pre class="sh" style="font-family:monospace;">#!/bin/sh
thunderbird</pre></td></tr></table></div>

<p><span style="color: #800000;">$ chmod +x ~/0000D0081A025303420200D2-*.sh</span></p>
<p style="text-align: justify;">Adaptons un peu le code en ajoutant une variable pour le nom du script et une commande &laquo;&nbsp;<em>system</em>&nbsp;&raquo; dans le <em>&laquo;&nbsp;switch/case&nbsp;&raquo;</em>.</p>
<p style="text-align: justify;">

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1415code10'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p141510"><td class="code" id="p1415code10"><pre class="c" style="font-family:monospace;">   <span style="color: #666666; font-style: italic;">// Jopa - Test Mir:ror</span>
&nbsp;
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  FILE <span style="color: #339933;">*</span>mirror<span style="color: #339933;">;</span>
  <span style="color: #993333;">short</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> block<span style="color: #339933;">;</span>
  <span style="color: #993333;">short</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> event<span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> tag<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">25</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// Ajout d'un variable script</span>
  <span style="color: #993333;">char</span> script<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">256</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Vérification du paramètre (device)</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>argc<span style="color: #339933;">!=</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Usage : %s mirror_device <span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        exit<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Ouverture du fichier device</span>
  mirror <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;rb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>mirror<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Accès à  %s impossible !<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        exit<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Boucle en lecture</span>
  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     fread<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>event<span style="color: #339933;">,</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>mirror<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>event<span style="color: #339933;">!=</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Evenement detecté, lecture de l'ID</span>
        <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">6</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            fread<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>block<span style="color: #339933;">,</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>mirror<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            sprintf<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>tag<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">*</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%04X&quot;</span><span style="color: #339933;">,</span>block<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">//Affichage en fonction de l'événement</span>
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Tag On</span>
            <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x102</span> <span style="color: #339933;">:</span>
                <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%s : ON<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>tag<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #666666; font-style: italic;">//Construction du nom de script et exécution</span>
                sprintf<span style="color: #009900;">&#40;</span>script<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;./%s-on.sh&quot;</span><span style="color: #339933;">,</span>tag<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                system<span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Tag Off</span>
             <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x202</span> <span style="color: #339933;">:</span>
                 <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%s : OFF<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>tag<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #666666; font-style: italic;">//Construction du nom de script et exécution</span>
                 sprintf<span style="color: #009900;">&#40;</span>script<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;./%s-off.sh&quot;</span><span style="color: #339933;">,</span>tag<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 system<span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Mirror envers</span>
             <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x501</span> <span style="color: #339933;">:</span>
                 <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;MIR:ROR ENVERS<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Mirror endroit</span>
             <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x401</span> <span style="color: #339933;">:</span>
                   <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;MIR:ROR ENDROIT<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #666666; font-style: italic;">//Default</span>
             <span style="color: #b1b100;">default</span> <span style="color: #339933;">:</span>
                   <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Evénement inconnu&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//switch</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//if (event</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//while (1)</span>
<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// main()</span></pre></td></tr></table></div>

<p style="text-align: justify;">Ceci n&#8217;est bien entendu qu&#8217;un exemple, écrit rapidement et pas forcément très propre. Mais il permet de mettre en évidence la simplicité avec laquelle il est possible d&#8217;accéder à des informations RFID et ouvre la porte sur des développements qui peuvent être rapidement prometteurs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jopa.fr/index.php/2009/07/12/violet-mirror-acces-device-c/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Eclipse-PDT sur Ubuntu (AMD-64)</title>
		<link>http://www.jopa.fr/index.php/2009/04/19/eclipse-pdt-sur-ubuntu-amd-64/</link>
		<comments>http://www.jopa.fr/index.php/2009/04/19/eclipse-pdt-sur-ubuntu-amd-64/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 10:33:33 +0000</pubDate>
		<dc:creator>Jopa</dc:creator>
				<category><![CDATA[Configurations]]></category>
		<category><![CDATA[Divers]]></category>
		<category><![CDATA[Evènements]]></category>
		<category><![CDATA[Planet-Libre]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jopa.fr/?p=1259</guid>
		<description><![CDATA[Je suis habitué à développer mes petits projets php grâce à mon éditeur préféré Vi (Vim), via des connexions ssh sur mes serveurs distants &#8211; Ah ben oui M&#8217;sieur ! C&#8217;est de la vielle école ça &#8230;d&#8217;la vielle école !  &#8211; Certains projets prenant de l&#8217;importance, ça commence à devenir vraiment sportif de jongler d&#8217;un [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><img class="alignleft size-medium wp-image-1262" title="capture-eclipse-platform" src="http://www.jopa.fr/wp-content/uploads/2009/04/capture-eclipse-platform-300x194.png" alt="capture-eclipse-platform" width="300" height="194" />Je suis habitué à développer mes petits projets <em>php</em> grâce à mon éditeur préféré Vi (<em>Vim</em>), via des connexions <em>ssh</em> sur mes serveurs distants &#8211; Ah ben oui M&#8217;sieur ! C&#8217;est de la vielle école ça &#8230;d&#8217;la vielle école !  &#8211; Certains projets prenant de l&#8217;importance, ça commence à devenir vraiment sportif de jongler d&#8217;un fichier à l&#8217;autre et quasi impossible d&#8217;avoir un aperçu global de l&#8217;architecture. J&#8217;ai finalement décidé de franchir le pas et de passer sous Eclipse (Eclipse-PDT plus exactement).</p>
<p style="text-align: justify;">Je me suis prestement rendu sur le site officiel (<a href="http://www.eclipse.org/pdt/">http://www.eclipse.org/pdt/</a>) et j&#8217;ai malheureusement constaté que le framework PDT n&#8217;était pas disponible dans les téléchargements, pour l&#8217;architecture <em>AMD-64</em>&#8230;Pas d&#8217;bol !</p>
<p style="text-align: justify;">Heureusement, la version développement (<em>ganymede</em> de son petit nom), semble permettre l&#8217;installation de <em>PDT</em> sous forme de plug-in, directement depuis son interface, y compris pour les architectures 64 bits&#8230;.Je vais détailler par la suite la marche suivie pour arriver au but !</p>
<p style="text-align: justify;"><span id="more-1259"></span></p>
<h2 style="text-align: justify;">Java</h2>
<p style="text-align: justify;">Il me faut commencer par installer le <em>JRE</em> de <em>Sun</em>. Et oui&#8230;<em>Eclipse</em>, c&#8217;est Java avant tout !<br />
Il est possible d&#8217;utiliser l&#8217;installation binaire disponible chez <em>Sun</em> :<a title="http://java.com/en/download/linux_manual.jsp?locale=en&amp;host=java.com:80" href="http://java.com/en/download/linux_manual.jsp?locale=en&amp;host=java.com:80"> http://java.com/en/download/linux_manual.jsp?locale=en&amp;host=java.com:80</a>, ou tout simplement la commande <em>aptitude</em> d&#8217;<em>Ubuntu</em> :</p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo aptitude install sun-java6-jre</span></p>
<p style="text-align: justify;">Si plusieurs environnement java sont installés, il est nécessaire de spécifier l&#8217;environnement actif par défaut</p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo update-java-alternatives -l<br />
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun<br />
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk<br />
java-6-sun 63 /usr/lib/jvm/java-6-sun<br />
java-gcj 1042 /usr/lib/jvm/java-gcj</span></p>
<p style="text-align: justify;"><span style="color: #800000;">$ sudo update-java-alternatives -s java-6-sun</span></p>
<h2 style="text-align: justify;"><em>Eclipse</em> IDE</h2>
<p style="text-align: justify;">La version 64 bits est téléchargeable ici : <a title="http://www.eclipse.org/downloads/" href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a>.</p>
<p style="text-align: justify;">Il suffit de télécharger et décompresser l&#8217;archive à l&#8217;emplacement voulu (<em>/usr/local/eclipse </em>par exemple) et le tour est joué.</p>
<p style="text-align: justify;"><span style="color: #800000;">$ cd /usr/local<br />
$ sudo tar -xvzf ~/eclipse-jee-ganymede-SR2-linux-gtk-x86_64.tar.gz</span></p>
<p style="text-align: justify;">Si tout est bon, l&#8217;exécutable présent à la racine du répertoire devrait lancer l&#8217;application.</p>
<p style="text-align: justify;"><span style="color: #800000;">$ /usr/local/eclipse/eclipse &amp;</span></p>
<p style="text-align: justify;"><span style="color: #800000;"><img class="aligncenter size-large wp-image-1268" title="capture-java-ee-http-12700150118-wse-wsexplorer-wsexplorerjsporgeclipsewstwsexplorer0-eclipse-platform1" src="http://www.jopa.fr/wp-content/uploads/2009/04/capture-java-ee-http-12700150118-wse-wsexplorer-wsexplorerjsporgeclipsewstwsexplorer0-eclipse-platform1-1024x700.png" alt="capture-java-ee-http-12700150118-wse-wsexplorer-wsexplorerjsporgeclipsewstwsexplorer0-eclipse-platform1" width="496" height="338" /><br />
</span></p>
<p style="text-align: justify;">Ben c&#8217;est super tout ça ! Me voici doté  d&#8217;un bel environnement de développement <em>java</em>&#8230;Mais M&#8217;sieur, M&#8217;sieur, c&#8217;est du <em>php</em> que je veux faire moi !</p>
<h2 style="text-align: justify;">Et pour PHP alors ?</h2>
<p style="text-align: justify;">La suite n&#8217;est pas plus compliquée, l&#8217;installation d&#8217;<em>add-ons </em>se fait par le menu &laquo;&nbsp;<em>Help-&gt;Software Update-&gt; Avaible Software</em>&laquo;&nbsp;.  Les boutons <em>Add Sites</em> et<em> Manage Sites</em> vont me permettre d&#8217;ajouter des sites de téléchargement supplémentaires.</p>
<p style="text-align: justify;">Pour faire fonctionner <em>PDT</em>, il me faut d&#8217;abord installer la dernière version du &laquo;&nbsp;<em>Dynamic Language Toolkit</em>&nbsp;&raquo; (DLK pour les intimes). Pour cela, j&#8217;ajoute le site :</p>
<p style="text-align: justify;"><span style="color: #800000;">http://download.eclipse.org/technology/dltk/updates-dev/1.0/</span></p>
<p style="text-align: justify;">et installe : <em><span style="color: #800000;">Dynamic Languages Toolkit &#8211; Core Frameworks (Incubation)</span> </em>par la liste des logiciels disponibles depuis ce site.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1275" title="capture-software-updates-and-add-ons2" src="http://www.jopa.fr/wp-content/uploads/2009/04/capture-software-updates-and-add-ons2.png" alt="capture-software-updates-and-add-ons2" width="538" height="368" /></p>
<p style="text-align: left;">Finalement, j&#8217;utilise la même méthode pour installer PDT :</p>
<ul>
<li>Ajout du site :<span style="color: #800000;"><em> http://phpeclipse.sourceforge.net/update/stable/1.2.x/</em></span>,</li>
<li>Installation de  :<span style="color: #800000;"><em> PHPEclipse</em></span>.</li>
</ul>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-1276" title="capture-software-updates-and-add-ons-1" src="http://www.jopa.fr/wp-content/uploads/2009/04/capture-software-updates-and-add-ons-1.png" alt="capture-software-updates-and-add-ons-1" width="538" height="368" /></p>
<p style="text-align: justify;">Après redémarrage, le chargement de l&#8217;environnement <em>PHP</em> se fait via le menu &laquo;&nbsp;<em>Windows-&gt;Open Perspectives</em>&laquo;&nbsp;.</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-1278" title="capture-java-ee-bourse-include-class_pf_entree_incphp-eclipse-platform" src="http://www.jopa.fr/wp-content/uploads/2009/04/capture-java-ee-bourse-include-class_pf_entree_incphp-eclipse-platform-1024x621.png" alt="capture-java-ee-bourse-include-class_pf_entree_incphp-eclipse-platform" width="540" height="328" /></p>
<p style="text-align: left;">
<p style="text-align: justify;">D&#8217;autres plugins bien sympathiques existent, notemment en matière de déboggage, d&#8217;accès à des projets, serveurs ou répertoires distants, etc&#8230; Ceci feront peut-être l&#8217;objet d&#8217;un prochain billet.</p>
<p style="text-align: left;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://www.jopa.fr/index.php/2009/04/19/eclipse-pdt-sur-ubuntu-amd-64/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

