<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://blogs.forum.nokia.com/styles/rss.css" type="text/css"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns="http://my.netscape.com/rdf/simple/0.9/"
>

 <channel>
  <title>Open Source Bluetooth PAN&#039;s Forum Nokia Blog</title>
  <link>http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog</link>
  <description>A Forum Nokia Blog</description>
 </channel>
    <item>
   <title>BlueZ port using P.I.P.S. environment</title>
   <description>&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;After unsatisfactory attempt to port BlueZ system to Symbian due to &lt;/span&gt;&lt;em&gt;&lt;span&gt;&amp;lt;sys/signal.h&amp;gt; &lt;/span&gt;&lt;/em&gt;&lt;span&gt;differences, David advised me to look at &lt;strong&gt;P.I.P.S&lt;/strong&gt; libraries. P.I.P.S. are Symbian libraries that are compatible with &lt;strong&gt;&lt;span style=&quot;color: #000000&quot;&gt;POSIX &lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;color: #000000&quot;&gt;standard.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;a href=&quot;http://developer.symbian.com/wiki/display/oe/P.I.P.S.+Home&quot;&gt;http://developer.symbian.com/wiki/display/oe/P.I.P.S.+Home&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;That could mean &lt;span style=&quot;color: #000000&quot;&gt;reducing efforts while migrating the project to mobile device.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #000000&quot;&gt;That was true on several positions. But there still was a trouble with &amp;lt;sys/system.h&amp;gt;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #000000&quot;&gt;It has &lt;/span&gt;&lt;em&gt;&lt;span style=&quot;color: #000000&quot;&gt;sigaction&lt;/span&gt;&lt;/em&gt;&lt;span style=&quot;color: #000000&quot;&gt;{} structure inside. But BlueZ needs &lt;/span&gt;&lt;em&gt;&lt;span style=&quot;color: #000000&quot;&gt;sigaction&lt;/span&gt;&lt;/em&gt;&lt;span style=&quot;color: #000000&quot;&gt;() function too.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #000000&quot;&gt;I don&amp;rsquo;t know, if the trouble is that BlueZ doesn&amp;rsquo;t support POSIX. Or it is a Symbian&amp;rsquo;s trait. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #000000&quot;&gt;But there is a paragraph here &lt;a href=&quot;http://developer.symbian.com/wiki/download/attachments/1411/PIPS_Essential_Booklet.pdf&quot;&gt;http://developer.symbian.com/wiki/download/attachments/1411/PIPS_Essential_Booklet.pdf&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #000000&quot;&gt;[PIPS_Essential_Booklet.pdf]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Which says: &amp;ldquo;&lt;/span&gt;&lt;em&gt;&lt;span style=&quot;font-size: 16pt&quot;&gt;The P.I.P.S. environment does not support signals&lt;/span&gt;&lt;/em&gt;&lt;span&gt;&amp;rdquo;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Other functions that are not supported:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;span&gt;sigfillset()&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;span&gt;sigdelset()&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;I had to examine what Signals are used for. I came to conclusion that they are used to &lt;strong&gt;halt&lt;/strong&gt; child processes.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;span&gt;Sigaction()&lt;/span&gt;&lt;/em&gt;&lt;span&gt;function was used to specify the action to be associated with a specific signal. After that the process generates his child instance (with &lt;strong&gt;&lt;em&gt;fork&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;exec&lt;/em&gt;&lt;/strong&gt;) which can be killed by sending &amp;ldquo;halt&amp;rdquo; signal with this statement:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;span&gt;kill(pid, SIGHUP)&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;So, I did not still find the replacement to this function to kill child processes. I&amp;rsquo;m thinking about Symbian&amp;rsquo;s &lt;/span&gt;&lt;em&gt;&lt;span&gt;RProcess&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span&gt; class&lt;/span&gt;&lt;/em&gt;&lt;span&gt;. Any ideas?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;I found that Carbide C++ is very strict to data types. Even more strict than unix c.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;I had to replace statements like:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;span&gt;struct bnep_setup_conn_req *req;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;span&gt;req = (void *) pkt;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;&lt;span&gt;to&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;span&gt;req = (struct bnep_setup_conn_req *) pkt;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;At this 2 documents:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;a href=&quot;http://www3.symbian.com/faq.nsf/0/D23BCB0AF8B1DC168025729F003FF465?OpenDocument&quot;&gt;http://www3.symbian.com/faq.nsf/0/D23BCB0AF8B1DC168025729F003FF465?OpenDocument&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;a href=&quot;http://www3.symbian.com/faq.nsf/0/0C3AC88AA406F6108025729F00402E3A?OpenDocument&quot;&gt;http://www3.symbian.com/faq.nsf/0/0C3AC88AA406F6108025729F00402E3A?OpenDocument&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;I found recommendations how to substitute ther &amp;ldquo;&lt;em&gt;fork&lt;/em&gt;&amp;rdquo;, &amp;ldquo;&lt;em&gt;exec&lt;/em&gt;&amp;rdquo; operations with other posix functions. The main is &lt;/span&gt;&lt;em&gt;&lt;span&gt;posix_spawn().&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;I tried to follow this idea, outflanking the forks and execs with &lt;/span&gt;&lt;em&gt;&lt;span&gt;posix_spawn().&lt;/span&gt;&lt;/em&gt;&lt;span&gt;It worked well.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;At &lt;/span&gt;&lt;em&gt;&lt;span&gt;run_script()&lt;/span&gt;&lt;/em&gt;&lt;span&gt; function there is instruction:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;em&gt;&lt;span&gt;execv(script, argv);&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;Before&lt;/span&gt;&lt;em&gt;&lt;span&gt; run_script()&lt;/span&gt;&lt;/em&gt;&lt;span&gt;is used, the &amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;span&gt;fork()&lt;/span&gt;&lt;/em&gt;&lt;span&gt;function is called to create the instance of program itself.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;This &lt;/span&gt;&lt;span style=&quot;letter-spacing: -1pt&quot;&gt;&amp;ldquo;&lt;em&gt;execv+fork&lt;/em&gt;&amp;rdquo;&lt;/span&gt;&lt;span&gt;pair is replaced by one &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;em&gt;&lt;span style=&quot;letter-spacing: -1pt&quot;&gt;posix_spawn(&amp;amp;Childpid,script,NULL,NULL,argv,NULL);&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;call.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;There are still lots of goals to reach. I don&amp;rsquo;t know how to pass command line arguments to Carbide&amp;rsquo;s console application.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The sdp.c is not implemented in this version of port because it still makes too much errors and it will take time to solve.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;I think there will be resulting GUI application which will run main PAND console instances. After that they should get into single signed SIS installation file.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Please look the sources of port using P.I.P.S. at my CVS repository &lt;a href=&quot;http://bluspan.cvs.sourceforge.net/bluspan/pand_port_06/&quot;&gt;http://bluspan.cvs.sourceforge.net/bluspan/pand_port_06/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;span&gt;The CVS checkout process to Carbide C++ IDE is described in my post: &lt;a href=&quot;http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog/general/2007/11/02/get-project-from-cvs-to-carbide-c&quot; target=&quot;_blank&quot;&gt;Get project from CVS to Carbide C++&lt;/a&gt;.&lt;/span&gt; &lt;div style=&quot;text-indent: 35.4pt&quot;&gt;&lt;/div&gt;&lt;span&gt;Please, checkout the newest &lt;/span&gt;&lt;span style=&quot;font-size: 18pt&quot;&gt;pand_port_06 &lt;/span&gt;&lt;span&gt;version.&lt;/span&gt;&lt;/div&gt;</description>
   <link>http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog/2007/10/16/bluez-port-using-p.i.p.s.-environment</link>
      <pubDate>Tue, 16 Oct 2007 15:01:58 +0300</pubDate>   
  </item>
  </rdf:RDF>

