<?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>MRo Blog &#187; gammu</title>
	<atom:link href="http://blog.mro.name/tag/gammu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mro.name</link>
	<description>Marcus Rohrmoser mobile Software</description>
	<lastBuildDate>Wed, 23 Jun 2010 11:32:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Transfer Phone Numbers from gammu to the Mac Adressbook</title>
		<link>http://blog.mro.name/2009/03/transfer-phone-numbers-from-gammu-to-the-mac-adressbook/</link>
		<comments>http://blog.mro.name/2009/03/transfer-phone-numbers-from-gammu-to-the-mac-adressbook/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 13:34:28 +0000</pubDate>
		<dc:creator>mro</dc:creator>
				<category><![CDATA[Articles in english]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[6610]]></category>
		<category><![CDATA[Addressbook]]></category>
		<category><![CDATA[gammu]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[vCard]]></category>

		<guid isPermaLink="false">http://blog.mro.name/?p=761</guid>
		<description><![CDATA[ok, make yourself comfortable, fasten your seatbelt and stop smoking. This will be quite a journey: Get gammu and backup the phone data: $ gammu backup phonedata.txt -yes open phonedata.txt and save it in &#8220;MacRoman&#8221; encoding with Unix line endings run it through this ruby script: #!/usr/bin/ruby -w -- &#160; # http://www.rubycentral.com/pickaxe/ # http://homepage.mac.com/phrogz/CSV2vCard_v2.html &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>ok, make yourself comfortable, fasten your seatbelt and stop smoking. This will be quite a journey:</p>
<p><span id="more-761"></span></p>
<ol>
<li>Get <a href="http://gammu.org">gammu</a> and backup the phone data:<br />
<code>$ gammu backup phonedata.txt -yes</code></li>
<li>open <code>phonedata.txt</code> and save it in &#8220;MacRoman&#8221; encoding with Unix line endings</li>
<li>run it through this <a href="http://www.rubycentral.com/pickaxe/">ruby</a> script:

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby -w -- </span>
&nbsp;
<span style="color:#008000; font-style:italic;"># http://www.rubycentral.com/pickaxe/</span>
<span style="color:#008000; font-style:italic;"># http://homepage.mac.com/phrogz/CSV2vCard_v2.html</span>
&nbsp;
records = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
fields = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
eor = <span style="color:#006600; font-weight:bold;">/</span>^<span style="color:#006600; font-weight:bold;">&#91;</span> \t<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">*</span>$<span style="color:#006600; font-weight:bold;">/</span>
bor = <span style="color:#006600; font-weight:bold;">/</span>^\<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>^<span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">9</span>\<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span>\<span style="color:#006600; font-weight:bold;">&#93;</span>$<span style="color:#006600; font-weight:bold;">/</span>
etype = <span style="color:#006600; font-weight:bold;">/</span>^Entry<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span>Type\s<span style="color:#006600; font-weight:bold;">+</span>=\s<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#40;</span>\S<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">/</span>
etext = <span style="color:#006600; font-weight:bold;">/</span>^Entry<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span>Text\s<span style="color:#006600; font-weight:bold;">+</span>=\s<span style="color:#006600; font-weight:bold;">+</span><span style="color:#996600;">&quot;(.*)&quot;</span><span style="color:#006600; font-weight:bold;">/</span>
&nbsp;
record_type = <span style="color:#0000FF; font-weight:bold;">nil</span>
entry_type = <span style="color:#0000FF; font-weight:bold;">nil</span>
tmp = <span style="color:#0000FF; font-weight:bold;">nil</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$stdin</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>l<span style="color:#006600; font-weight:bold;">|</span>
	<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>eor =~ l<span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#006666;">0</span>
		records<span style="color:#006600; font-weight:bold;">&#91;</span>record_type<span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">if</span> records<span style="color:#006600; font-weight:bold;">&#91;</span>record_type<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>?
		records<span style="color:#006600; font-weight:bold;">&#91;</span>record_type<span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&amp;</span>lt;<span style="color:#006600; font-weight:bold;">&amp;</span>lt; tmp <span style="color:#9966CC; font-weight:bold;">if</span> tmp
<span style="color:#008000; font-style:italic;">#		puts '-- EOR --'</span>
		record_type = entry_type = tmp = <span style="color:#0000FF; font-weight:bold;">nil</span>
		<span style="color:#9966CC; font-weight:bold;">next</span>
	<span style="color:#9966CC; font-weight:bold;">end</span>
	m = bor.<span style="color:#9900CC;">match</span> l
	<span style="color:#9966CC; font-weight:bold;">if</span> m
<span style="color:#008000; font-style:italic;">#		puts &quot;#{m[1]} - #{m[2]}&quot;</span>
		record_type = <span style="color:#996600;">&quot;#{m[1]}&quot;</span>
		tmp = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
		<span style="color:#9966CC; font-weight:bold;">next</span>
	<span style="color:#9966CC; font-weight:bold;">end</span>
	<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#996600;">'PhonePBK'</span> == record_type
		m = etype.<span style="color:#9900CC;">match</span> l
<span style="color:#008000; font-style:italic;">#		raise &quot;Parse Error: #{l}&quot; if entry_type.nil? &amp;amp;&amp;amp; m.nil?</span>
		<span style="color:#9966CC; font-weight:bold;">if</span> m
			entry_type = <span style="color:#996600;">&quot;#{m[2]}&quot;</span>
		<span style="color:#9966CC; font-weight:bold;">else</span>
			m = etext.<span style="color:#9900CC;">match</span> l
			<span style="color:#9966CC; font-weight:bold;">if</span> m
				<span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#996600;">'Parse Error'</span> <span style="color:#9966CC; font-weight:bold;">if</span> entry_type.<span style="color:#0000FF; font-weight:bold;">nil</span>?
				<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#996600;">'Name'</span> == entry_type
					name = <span style="color:#996600;">&quot;#{m[2]}&quot;</span>.<span style="color:#CC0066; font-weight:bold;">split</span> <span style="color:#996600;">' '</span>
					tmp<span style="color:#006600; font-weight:bold;">&#91;</span>entry_type = <span style="color:#996600;">'LastName'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;#{name[name.length-1]}&quot;</span>
					fields<span style="color:#006600; font-weight:bold;">&#91;</span>entry_type<span style="color:#006600; font-weight:bold;">&#93;</span> = entry_type
					name<span style="color:#006600; font-weight:bold;">&#91;</span>name.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">nil</span>
					name.<span style="color:#9900CC;">compact</span>!
&nbsp;
					count = <span style="color:#006666;">0</span>
					name.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>tn<span style="color:#006600; font-weight:bold;">|</span>
						tmp<span style="color:#006600; font-weight:bold;">&#91;</span>entry_type = <span style="color:#996600;">&quot;Name_#{count}&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = tn
						fields<span style="color:#006600; font-weight:bold;">&#91;</span>entry_type<span style="color:#006600; font-weight:bold;">&#93;</span> = entry_type
						count <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>
					<span style="color:#9966CC; font-weight:bold;">end</span>
				<span style="color:#9966CC; font-weight:bold;">else</span>
					fields<span style="color:#006600; font-weight:bold;">&#91;</span>entry_type<span style="color:#006600; font-weight:bold;">&#93;</span> = entry_type
<span style="color:#008000; font-style:italic;">#					puts &quot;#{entry_type} = #{m[2]}&quot;</span>
					tmp<span style="color:#006600; font-weight:bold;">&#91;</span>entry_type<span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;#{m[2]}&quot;</span>
				<span style="color:#9966CC; font-weight:bold;">end</span>
				entry_type = <span style="color:#0000FF; font-weight:bold;">nil</span>
			<span style="color:#9966CC; font-weight:bold;">end</span>
		<span style="color:#9966CC; font-weight:bold;">end</span>
	<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
keys = fields.<span style="color:#9900CC;">keys</span>.<span style="color:#9900CC;">sort</span>
sep = <span style="color:#996600;">','</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\#</span>#{keys.join(sep)}&quot;</span>
records<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'PhonePBK'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>item<span style="color:#006600; font-weight:bold;">|</span>
	tmp = <span style="color:#996600;">''</span>
	keys.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>key<span style="color:#006600; font-weight:bold;">|</span>
		v = item<span style="color:#006600; font-weight:bold;">&#91;</span>key<span style="color:#006600; font-weight:bold;">&#93;</span>
		v = <span style="color:#996600;">''</span> <span style="color:#9966CC; font-weight:bold;">if</span> v.<span style="color:#0000FF; font-weight:bold;">nil</span>?
		v.<span style="color:#CC0066; font-weight:bold;">gsub!</span> <span style="color:#996600;">&quot;'&quot;</span>, <span style="color:#996600;">&quot;''&quot;</span>
		tmp = <span style="color:#996600;">&quot;#{tmp}'#{v}'#{sep}&quot;</span>
	<span style="color:#9966CC; font-weight:bold;">end</span>
	<span style="color:#CC0066; font-weight:bold;">puts</span> tmp
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

</li>
<li>run the result through a <a href="http://homepage.mac.com/phrogz/CSV2vCard_v2.html">csv to vcard converter</a>,</li>
<li>remove all single quotes <code>'</code> from the vcards,</li>
<li>import the vcards into the osx addressbook.</li>
</ol>
<p>And guess what &#8211; that really works! The script is quite a hack but does the job. I thought about rewriting it using closures prior publishing but left it as a homework to you.</p>
<p>[<strong>Update</strong>] Maybe <a href="http://europe.nokia.com/get-support-and-software/product-support/isync">iSync</a> would have done the trick, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mro.name/2009/03/transfer-phone-numbers-from-gammu-to-the-mac-adressbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2ME &amp; Maven2</title>
		<link>http://blog.mro.name/2008/10/j2me-maven2/</link>
		<comments>http://blog.mro.name/2008/10/j2me-maven2/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 22:05:16 +0000</pubDate>
		<dc:creator>mro</dc:creator>
				<category><![CDATA[Articles in english]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[gammu]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[maven2]]></category>

		<guid isPermaLink="false">http://blog.mro.name/?p=124</guid>
		<description><![CDATA[Huh! I just found out, there is a fine Maven2 Plugin for J2ME. It comes with an archetype to jump-start developing J2ME applications with maven. Use the archetype like this: $ mvn archetype:create -DarchetypeGroupId=com.pyx4me -DarchetypeArtifactId=j2me-simple -DarchetypeVersion=2.0.3-SNAPSHOT -DremoteRepositories=http://www.pyx4me.com/maven2 -DgroupId=org.example -DartifactId=myapp And if you develop against a nokia phone, it comes even better &#8211; there&#8217;s a gammu [...]]]></description>
			<content:encoded><![CDATA[<p>Huh! I just found out, there is a fine<a href="http://pyx4me.com/pyx4me-maven-plugins/j2me-maven-plugin/"> Maven2 Plugin for J2ME</a>. It comes with an <a href="http://pyx4me.com/pyx4me-archetypes/j2me-simple/index.html">archetype</a> to jump-start developing J2ME applications with <a href="http://maven.apache.org/">maven</a>.</p>
<p>Use the archetype like this:</p>
<pre>$ mvn archetype:create -DarchetypeGroupId=com.pyx4me
-DarchetypeArtifactId=j2me-simple -DarchetypeVersion=2.0.3-SNAPSHOT
-DremoteRepositories=http://www.pyx4me.com/maven2 -DgroupId=org.example
-DartifactId=myapp</pre>
<p>And if you develop against a nokia phone, it comes even better &#8211; there&#8217;s a <a href="http://pyx4me.com/pyx4me-maven-plugins/gammu-maven-plugin/">gammu maven plugin</a>, too!</p>
<p>Also check out this <a href="http://codeforfun.wordpress.com/2008/06/23/build-native-blackberry-apps-natively-on-a-mac-using-maven/">blog featuring maven2 &amp; j2me</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mro.name/2008/10/j2me-maven2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokia 6610 &amp; Linux (gentoo stable, amd64)</title>
		<link>http://blog.mro.name/2008/10/nokia-6610-linux-gentoo-stable-amd64/</link>
		<comments>http://blog.mro.name/2008/10/nokia-6610-linux-gentoo-stable-amd64/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 12:42:12 +0000</pubDate>
		<dc:creator>mro</dc:creator>
				<category><![CDATA[Artikel auf deutsch]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[6610]]></category>
		<category><![CDATA[gammu]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[IrDA]]></category>
		<category><![CDATA[Nokia]]></category>

		<guid isPermaLink="false">http://blog.mro.name/?p=42</guid>
		<description><![CDATA[Auch von einem Linux Rechner aus kann man auf Mobiltelefone zugreifen, allerdings sind ein paar Vorbereitungen nötig. Siehe dazu auch die Gentoo IrDA Anleitung. Ausgangspunkt ist ein Nokia 6610 Mobilfon, ein Gentoo AMD64 stable Rechner und ein Cytronix IR-USB Dongle. Zunächst wollen ein paar Kernel Einstellungen gesetzt sein: Networking ---&#62; &#60;M&#62; IrDA (infrared) subsystem support [...]]]></description>
			<content:encoded><![CDATA[<p>Auch von einem Linux Rechner aus kann man auf Mobiltelefone zugreifen, allerdings sind ein paar Vorbereitungen nötig. Siehe dazu auch die <a href="http://gentoo-wiki.com/IrDA">Gentoo IrDA Anleitung</a>.</p>
<p>Ausgangspunkt ist ein <a href="http://www.forum.nokia.com/devices/6610">Nokia 6610</a> Mobilfon, ein <a href="http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml">Gentoo AMD64 stable</a> Rechner und ein <a href="http://www.google.de/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.sigmatel.com%2Fproducts%2Fportable%2Fwireless%2Fstir4200.aspx&amp;ei=xJ3kSNWDDJj20AWv_qH0DA&amp;usg=AFQjCNGjCXaTOxnBzWVhHGA8jHKqvTm-Vw&amp;sig2=wqSL28ar6VUbgWFtClzICw">Cytronix IR-USB Dongle</a>.</p>
<p>Zunächst wollen ein paar Kernel Einstellungen gesetzt sein:</p>
<pre>Networking  ---&gt;
        &lt;M&gt; IrDA (infrared) subsystem support  ---&gt;
           &lt;M&gt; IrCOMM protocol
        Infrared-port device drivers  ---&gt;
             &lt;M&gt; IrDA USB dongles
             &lt;M&gt; SigmaTel STIr4200 bridge (EXPERIMENTAL)</pre>
<p>Damit die Module automatisch geladen werden:</p>
<pre>$ cat /etc/modprobe.d/irda
alias irda0 stir4200
$ sudo update-modules</pre>
<p>Ein paar Pakete installieren:</p>
<pre>$ sudo emerge irda-utils gammu</pre>
<p>und <a href="http://www.gammu.org/">gammu</a> einstellen:</p>
<pre>$ cat ~/.gammurc
[gammu]
name = Nokia 6610
# port=/dev/ircomm0
connection = irdaphonet
synchronizetime = yes
# rsslevel = teststable
startinfo = yes
usephonedb = yes
# UsePhoneDB=yes</pre>
<p>Das Telephon noch auf Infrarot lauschen lassen, und schon sollte es klappen:</p>
<pre>$ sudo irattach irda0 -s;sleep 10;gammu --identify
INFO: there is later testing Gammu (1.20.94 instead of 1.20.0) available!
Manufacturer         : Nokia
Model                : 6610 (NHL-4U)
Firmware             : 5.52 C (19-09-03)
Hardware             : 0660
IMEI                 : 352927001317658
Original IMEI        : 352927/00/131765/8
Manufactured         : 11/2003
Product code         : 0510460
UEM                  : 8</pre>
<p>Das war&#8217;s.</p>
<p>Jetzt läßt sich per gammu das Telephon inspizieren, z.B.</p>
<pre>$ gammu getfilesystem
    c:/1.   SFolder "C (Permanent_memory)"
    c:/5.  HS |-- Folder "Empf. Dateien"
    c:/2.   S |-- Folder "Galerie"
    c:/3.   S |    |-- Folder "Bilder"
   c:/37.     |    |    |-- "Cell.jpg"
   c:/40.     |    |    |-- "Clock.jpg"
   c:/39.     |    |    |-- "Crisp.jpg"
...</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.mro.name/2008/10/nokia-6610-linux-gentoo-stable-amd64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
