<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=60&amp;t=15004&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-04-06T21:07:41+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=60&amp;t=15004&amp;mode</id>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-06T21:07:41+01:00</updated>
<published>2016-04-06T21:07:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157964#p157964</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157964#p157964"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157964#p157964"><![CDATA[
Tak się zastanawiam... Ktoś wrzucił ten kod na stronie w oryginalnej postaci - więc komuś to musiało działać:<br /><!-- m --><a class="postlink" href="http://www.ridgesolutions.ie/index.php/2012/12/13/boost-c-read-from-serial-port-with-timeout-example/" >http://www.ridgesolutions.ie/index.php/ ... t-example/</a><!-- m --><br /><br />Zastanawiam się, czemu ów exception nie działa u mnie (jeśli u tego kogoś działał).<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 6 kwi 2016, o 21:07</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Sparrow-hawk]]></name></author>
<updated>2016-04-06T20:54:29+01:00</updated>
<published>2016-04-06T20:54:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157959#p157959</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157959#p157959"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157959#p157959"><![CDATA[
Wydaje mi się, że powinieneś zacząć od prostszych rzeczy i nabrać doświadczenia w języku C++. <br /><br />Program się kompiluje, więc chyba dobrze? Ale po co funkcja rzuca wyjątek, skoro nie jest wywoływana w bloku:<br />[syntax=cpp]try {<br />  ...<br />}[/syntax]<br />A nawet, gdyby ją tam wywołać, to brakuje jeszcze conajmniej:<br />[syntax=cpp]catch(const char * e) {<br />  std::cout&lt;&lt;e&lt;&lt;std::endl;<br />}[/syntax]<br />Bo przecież coś ten wyjątek musi &quot;złapać&quot;.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10614">Sparrow-hawk</a> — 6 kwi 2016, o 20:54</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-06T14:55:11+01:00</updated>
<published>2016-04-06T14:55:11+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157929#p157929</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157929#p157929"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157929#p157929"><![CDATA[
Niestety po wstawieniu &lt;exception&gt;:<br /><br />[syntax=cpp]#include &lt;string&gt;<br />#include &lt;iostream&gt;<br />#include &lt;exception&gt;<br />#include &lt;boost/asio/serial_port.hpp&gt;<br />#include &lt;boost/asio.hpp&gt;<br />#include &quot;blocking_reader.h&quot;<br /><br />using namespace boost;<br /><br />std::string read_response() {<br /><br />asio::io_service io;<br />asio::serial_port port(io);<br /><br />port.open(&quot;COM3&quot;);<br />port.set_option(asio::serial_port_base::baud_rate(115200));<br /><br />// A blocking reader for this port that<br />// will time out a read after 500 milliseconds.<br />blocking_reader reader(port, 500);<br /><br />char c;<br /><br />std::string rsp;<br /><br />// read from the serial port until we get a<br />// \n or until a read times-out (500ms)<br />while (reader.read_char(c) &amp;&amp; c != '\n') {<br />rsp += c;<br />}<br /><br />if (c != '\n') {<br />// it must have timed out.<br />throw std::exception(&quot;Read timed out!&quot;);<br />}<br /><br />return rsp;<br />}<br /><br />int main()<br />{<br />    std::string response;<br />    std::cout &lt;&lt; &quot;Waiting for response...&quot; &lt;&lt; std::endl;<br />    response = read_response();<br />    std::cout &lt;&lt; &quot;Character is: &quot; &lt;&lt; response &lt;&lt; std::endl;<br />    return 0;<br />}[/syntax]<br /><br />kompilator dalej wywala się w tym samym miejscu.<br /><br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">-------------- Build: Debug in COM_read_with_timeout_second_code (compiler: GNU GCC Compiler)---------------<br /><br />mingw32-g++.exe -Wall -fexceptions -g  -c D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp -o obj\Debug\main.o<br />In file included from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/serial_port.hpp:19:0,<br />                 from D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:4:<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/detail/config.hpp:566:5: warning: #warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. &#91;-Wcpp&#93;<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/detail/config.hpp:567:5: warning: #warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. &#91;-Wcpp&#93;<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/detail/config.hpp:568:5: warning: #warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). &#91;-Wcpp&#93;<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp: In function 'std::string read_response()':<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:34:41: error: no matching function for call to 'std::exception::exception(const char &#91;16&#93;)'<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:34:41: note: candidates are:<br />In file included from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/new:42:0,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/ext/new_allocator.h:34,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/mingw32/bits/c++allocator.h:34,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/allocator.h:48,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/string:43,<br />                 from D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:1:<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:65:5: note: std::exception::exception()<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:65:5: note:   candidate expects 0 arguments, 1 provided<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:62:9: note: std::exception::exception(const std::exception&amp;)<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:62:9: note:   no known conversion for argument 1 from 'const char &#91;16&#93;' to 'const std::exception&amp;'<br />Process terminated with status 1 (0 minute(s), 1 second(s))<br />1 error(s), 3 warning(s) (0 minute(s), 1 second(s))</div><br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 6 minutach ]</span></strong><br /><br />Dodatkowo po zastosowaniu się do:<br /><br /><div class="quotetitle">Sparrow-hawk napisał(a):</div><div class="quotecontent"><br />A tu chyba powinno być tak:<br />[syntax=cpp]f (c != '\n') {<br />                // it must have timed out.<br />                throw &quot;Read timed out!&quot;;<br />        }[/syntax]<br /></div><br /><br />Program kompiluje się, ale dzieje się coś takiego:<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/a281e9702afc3018ec1f9574f83dc6b5.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/a281e9702afc3018ec1f9574f83dc6b5.png" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 6 kwi 2016, o 14:55</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Sparrow-hawk]]></name></author>
<updated>2016-04-06T13:37:17+01:00</updated>
<published>2016-04-06T13:37:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157927#p157927</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157927#p157927"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157927#p157927"><![CDATA[
Zdefiniuj w opcjach projektu: <strong>_WIN32_WINNT=0x0501</strong><br />Brakuje też:<br />[syntax=cpp]#include &lt;exception&gt;[/syntax]<br />A tu chyba powinno być tak:<br />[syntax=cpp]f (c != '\n') {<br />                // it must have timed out.<br />                throw &quot;Read timed out!&quot;;<br />        }[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10614">Sparrow-hawk</a> — 6 kwi 2016, o 13:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-06T09:11:06+01:00</updated>
<published>2016-04-06T09:11:06+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157915#p157915</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157915#p157915"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157915#p157915"><![CDATA[
Poprzedni temat udało mi się wyjaśnić. Rzeczywiście brakowała main-a <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";-)" title="Puszcza oko" /> Ale też nie miałem podpiętego ws2_32:<br /><br /><a href="http://obrazki.elektroda.pl/2845713400_1459886466.png"  class="postlink"><img src="http://obrazki.elektroda.pl/2845713400_1459886466_thumb.jpg" alt="Obrazek" /></a><br /><br />tak więc poprzedni kod już działa:<br /><br />[syntax=c]#include &lt;boost/asio/serial_port.hpp&gt;<br />#include &lt;boost/asio.hpp&gt;<br />#include &lt;iostream&gt;<br /><br />using namespace boost;<br /><br />char read_char() {<br />asio::io_service io;<br />asio::serial_port port(io);<br /><br />port.open(&quot;COM3&quot;);<br />port.set_option(asio::serial_port_base::baud_rate(115200));<br /><br />char c;<br /><br />// Read 1 character into c, this will block<br />// forever if no character arrives.<br />asio::read(port, asio::buffer(&amp;c,1));<br /><br />port.close();<br /><br />return c;<br />}<br /><br />int main()<br />{<br />    char character;<br />    std::cout &lt;&lt; &quot;Waiting for char...&quot; &lt;&lt; std::endl;<br />    character = read_char();<br />    std::cout &lt;&lt; &quot;Character is: &quot; &lt;&lt; character &lt;&lt; std::endl;<br />    return 0;<br />}[/syntax]<br /><br />Działa zgodnie z sugestią <a href="http://www.ridgesolutions.ie/index.php/2012/12/13/boost-c-read-from-serial-port-with-timeout-example/"  class="postlink">autora</a><br /><br /><br /><br />Mam natomiast problem z kolejnym, który już skompilować się nie chce:<br /><br />[syntax=c]#include &lt;string&gt;<br />#include &lt;iostream&gt;<br />#include &lt;boost/asio/serial_port.hpp&gt;<br />#include &lt;boost/asio.hpp&gt;<br />#include &quot;blocking_reader.h&quot;<br /><br />using namespace boost;<br /><br />std::string read_response() {<br /><br />asio::io_service io;<br />asio::serial_port port(io);<br /><br />port.open(&quot;COM3&quot;);<br />port.set_option(asio::serial_port_base::baud_rate(115200));<br /><br />// A blocking reader for this port that<br />// will time out a read after 500 milliseconds.<br />blocking_reader reader(port, 500);<br /><br />char c;<br /><br />std::string rsp;<br /><br />// read from the serial port until we get a<br />// \n or until a read times-out (500ms)<br />while (reader.read_char(c) &amp;&amp; c != '\n') {<br />rsp += c;<br />}<br /><br />if (c != '\n') {<br />// it must have timed out.<br />throw std::exception(&quot;Read timed out!&quot;);<br />}<br /><br />return rsp;<br />}<br /><br />int main()<br />{<br />    char character;<br />    std::cout &lt;&lt; &quot;Waiting for response...&quot; &lt;&lt; std::endl;<br />    character = read_response();<br />    std::cout &lt;&lt; &quot;Character is: &quot; &lt;&lt; character &lt;&lt; std::endl;<br />    return 0;<br />}[/syntax]<br /><br /><br />Z tym coś jest nie tak:<br />[syntax=c]throw std::exception(&quot;Read timed out!&quot;);[/syntax]<br /><br /><br />Build messages:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">||=== Build: Debug in COM_read_with_timeout_second_code (compiler: GNU GCC Compiler) ===|<br />c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\..\include\boost\asio\detail\config.hpp|566|warning: #warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. &#91;-Wcpp&#93;|<br />c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\..\include\boost\asio\detail\config.hpp|567|warning: #warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. &#91;-Wcpp&#93;|<br />c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\..\include\boost\asio\detail\config.hpp|568|warning: #warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). &#91;-Wcpp&#93;|<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp||In function 'std::string read_response()':|<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp|33|error: no matching function for call to 'std::exception::exception(const char &#91;16&#93;)'|<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp|33|note: candidates are:|<br />c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\exception|65|note: std::exception::exception()|<br />c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\exception|65|note:   candidate expects 0 arguments, 1 provided|<br />c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\exception|62|note: std::exception::exception(const std::exception&amp;)|<br />c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\exception|62|note:   no known conversion for argument 1 from 'const char &#91;16&#93;' to 'const std::exception&amp;'|<br />||=== Build failed: 1 error(s), 3 warning(s) (0 minute(s), 1 second(s)) ===|</div><br /><br /><br />Build log:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">-------------- Build: Debug in COM_read_with_timeout_second_code (compiler: GNU GCC Compiler)---------------<br /><br />mingw32-g++.exe -Wall -fexceptions -g  -c D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp -o obj\Debug\main.o<br />In file included from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/serial_port.hpp:19:0,<br />                 from D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:3:<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/detail/config.hpp:566:5: warning: #warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. &#91;-Wcpp&#93;<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/detail/config.hpp:567:5: warning: #warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. &#91;-Wcpp&#93;<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/boost/asio/detail/config.hpp:568:5: warning: #warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). &#91;-Wcpp&#93;<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp: In function 'std::string read_response()':<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:33:41: error: no matching function for call to 'std::exception::exception(const char &#91;16&#93;)'<br />D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:33:41: note: candidates are:<br />In file included from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/new:42:0,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/ext/new_allocator.h:34,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/mingw32/bits/c++allocator.h:34,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/allocator.h:48,<br />                 from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/string:43,<br />                 from D:\Mariusz\Zapisane\Programowanie\COM_read_with_timeout_second_code\main.cpp:1:<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:65:5: note: std::exception::exception()<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:65:5: note:   candidate expects 0 arguments, 1 provided<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:62:9: note: std::exception::exception(const std::exception&amp;)<br />c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/exception:62:9: note:   no known conversion for argument 1 from 'const char &#91;16&#93;' to 'const std::exception&amp;'<br />Process terminated with status 1 (0 minute(s), 1 second(s))<br />1 error(s), 3 warning(s) (0 minute(s), 1 second(s))</div><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 6 kwi 2016, o 09:11</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Sparrow-hawk]]></name></author>
<updated>2016-04-06T07:19:22+01:00</updated>
<published>2016-04-06T07:19:22+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157910#p157910</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157910#p157910"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157910#p157910"><![CDATA[
A może by tak wypadało gdzieś zdefiniować funkcję <strong>int main(int argc, char * argv[]) { }</strong>?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10614">Sparrow-hawk</a> — 6 kwi 2016, o 07:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-05T16:11:45+01:00</updated>
<published>2016-04-05T16:11:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157871#p157871</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157871#p157871"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157871#p157871"><![CDATA[
Teraz, kiedy mam już skompilowane biblioteki boost, wracam z takim tematem:<br /><br />Próbuję skompilować kod ze strony: <!-- m --><a class="postlink" href="http://www.ridgesolutions.ie/index.php/2012/12/13/boost-c-read-from-serial-port-with-timeout-example/" >http://www.ridgesolutions.ie/index.php/ ... t-example/</a><!-- m --> <br /><br />[syntax=c]#include &lt;boost/asio/serial_port.hpp&gt;<br />#include &lt;boost/asio.hpp&gt;<br /><br />using namespace boost;<br /><br />char read_char() {<br />asio::io_service io;<br />asio::serial_port port(io);<br /><br />port.open(&quot;COM3&quot;);<br />port.set_option(asio::serial_port_base::baud_rate(115200));<br /><br />char c;<br /><br />// Read 1 character into c, this will block<br />// forever if no character arrives.<br />asio::read(port, asio::buffer(&amp;c,1));<br /><br />port.close();<br /><br />return c;<br />}[/syntax]<br /><br />Otrzymuję taki komunikat:<br /><!-- m --><a class="postlink" href="http://filmy.elektroda.net/32_1459868671.mp4" >http://filmy.elektroda.net/32_1459868671.mp4</a><!-- m --><br /><br />Z góry dziękuję pięknie za pomoc.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 5 kwi 2016, o 16:11</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-04T06:51:54+01:00</updated>
<published>2016-04-04T06:51:54+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157733#p157733</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157733#p157733"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157733#p157733"><![CDATA[
Sukces:<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/ccf98e2f0abe823ba74f6256819fd67b.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/ccf98e2f0abe823ba74f6256819fd67b.png" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 4 kwi 2016, o 06:51</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-03T22:08:27+01:00</updated>
<published>2016-04-03T22:08:27+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157719#p157719</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157719#p157719"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157719#p157719"><![CDATA[
<div class="quotetitle">robertomic napisał(a):</div><div class="quotecontent"><br />dobra trzymaj<br /><!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=5AmwIwedTCM" >http://www.youtube.com/watch?v=5AmwIwedTCM</a><!-- m --><br /></div><br /><br />1:53 - u niego się buduje, u mnie nie...<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/f9ebe756edfc4854462e54d506b6ab56.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/f9ebe756edfc4854462e54d506b6ab56.png" alt="Obrazek" /></a><br /><br />Dodam, że pobrałem Microsoft Visual Studio:<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/d2d8fc96f3ff19a327836730c579ecb8.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/d2d8fc96f3ff19a327836730c579ecb8.png" alt="Obrazek" /></a><br />i uruchamiam bootstram z Developer Command Prompt. <br /><br />Jutro siędę do tego raz jeszcze.<br /><br />Dobrej nocy.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 3 kwi 2016, o 22:08</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[robertomic]]></name></author>
<updated>2016-04-03T19:16:36+01:00</updated>
<published>2016-04-03T19:16:36+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157672#p157672</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157672#p157672"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157672#p157672"><![CDATA[
a co tam jest napisane ?<br /><br />google translate w łapki i zycie stanie sie prostsze <br />np:   <!-- m --><a class="postlink" href="http://stackoverflow.com/questions/5299468/unable-to-build-boost-libraries-with-gcc" >http://stackoverflow.com/questions/5299 ... s-with-gcc</a><!-- m --><br />tego jest wiecej w wyszukiwarce <br />podpowiem.    cl not regoznized <br />chwila w google i ciach . nie masz zainstalowanego kompilatora visual studio. <br />czyli nie skonfiguraowałes boost . musisz wydac polecenie ktore przed kompilacja boosta ustawi odpowiedni kompilator np gcc ...<br /><br />dobra trzymaj<br /><!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=5AmwIwedTCM" >http://www.youtube.com/watch?v=5AmwIwedTCM</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=13232">robertomic</a> — 3 kwi 2016, o 19:16</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-03T19:22:57+01:00</updated>
<published>2016-04-03T18:40:19+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157662#p157662</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157662#p157662"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157662#p157662"><![CDATA[
<div class="quotetitle">Sparrow-hawk napisał(a):</div><div class="quotecontent"><br />Instalacja bibliotek boost sprawia jedynie trudność, kiedy robi się to na skróty. Jeżeli będziesz dokładnie postępował według tego: <a href="http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html"  class="postlink">http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html</a>, zaczynając od punktu 5. na pewno uda Ci się poprawnie skompilować te biblioteki. I żadna maszyna wirtualna nie jest do tego potrzebna.<br /></div><br /><br />Wykonuję punkt 5.1...<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/c32df67800d4472119ee836c4f8aec3b.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/c32df67800d4472119ee836c4f8aec3b.png" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 3 kwi 2016, o 18:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Sparrow-hawk]]></name></author>
<updated>2016-04-02T13:29:28+01:00</updated>
<published>2016-04-02T13:29:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157531#p157531</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157531#p157531"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157531#p157531"><![CDATA[
Instalacja bibliotek boost sprawia jedynie trudność, kiedy robi się to na skróty. Jeżeli będziesz dokładnie postępował według tego: <a href="http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html"  class="postlink">http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html</a>, zaczynając od punktu 5. na pewno uda Ci się poprawnie skompilować te biblioteki. I żadna maszyna wirtualna nie jest do tego potrzebna.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10614">Sparrow-hawk</a> — 2 kwi 2016, o 13:29</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-01T22:17:10+01:00</updated>
<published>2016-04-01T22:17:10+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157510#p157510</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157510#p157510"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157510#p157510"><![CDATA[
W Win7 32 bit również to samo:<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/80cdf026b8d0fd641c6addee6b2e4630.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/80cdf026b8d0fd641c6addee6b2e4630.png" alt="Obrazek" /></a><br /><br /><br />Poddałem się i pobrałem skompilowane: <br /><!-- m --><a class="postlink" href="https://sourceforge.net/projects/boost/files/boost-jam/3.1.18/boost-jam-3.1.18-1-ntx86.zip/download" >https://sourceforge.net/projects/boost/ ... p/download</a><!-- m --><br /><br />Niestety są kolejne niespodzianki. Jak krew z nosa normalnie:<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/2cfdace48b0a68a0f969282c70ce73ff.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/2cfdace48b0a68a0f969282c70ce73ff.png" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 1 kwi 2016, o 22:17</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-01T21:13:40+01:00</updated>
<published>2016-04-01T21:13:40+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157507#p157507</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157507#p157507"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157507#p157507"><![CDATA[
Myślałem, że mam coś z systemem nie tak, a tu się okazuje, że na maszynie wirtualnej dzieje się to samo.<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/0833083b20a5ff33ec677a480e26f477.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/0833083b20a5ff33ec677a480e26f477.png" alt="Obrazek" /></a><br /><br />Mi pomysły się wyczerpały. <br /><br />Ewentualnie dajćie proszę znać, czy u was działa.<br /><br />Dzięki.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 1 kwi 2016, o 21:13</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-01T19:52:56+01:00</updated>
<published>2016-04-01T19:52:56+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157500#p157500</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157500#p157500"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157500#p157500"><![CDATA[
Próbuję skompilować boost za poradnikiem:<br /><!-- m --><a class="postlink" href="http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef" >http://wiki.codeblocks.org/index.php?ti ... wsQuickRef</a><!-- m --><br /><br />Niestety otrzymuję taki feedback:<br /><br /><a href="https://obrazkiforum.atnel.pl/7975/f482cca0d5e6ab66addadf4af84c7f84.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7975/f482cca0d5e6ab66addadf4af84c7f84.png" alt="Obrazek" /></a><br /><br />W logu znajduję to:<br /><br /><!-- m --><a class="postlink" href="http://pastebin.com/aWadasnM" >http://pastebin.com/aWadasnM</a><!-- m --><br /><br />Z góry dziękuję pięknie za pomoc.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 1 kwi 2016, o 19:52</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-01T18:39:04+01:00</updated>
<published>2016-04-01T18:39:04+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157494#p157494</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157494#p157494"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157494#p157494"><![CDATA[
<div class="quotetitle">Sparrow-hawk napisał(a):</div><div class="quotecontent"><br />Piszesz, że masz najnowsze biblioteki, a czy te biblioteki skompilowałeś? Jakiego w ogóle używasz kompilatora?<br /></div><br /><br />Kurcze, nie wiedziałem, że za tym stoi jakaś wyższa filozofia. <br /><br />Po prostu wypakowałem zawartość:<br /><strong>boost_1_60_0.zip\boost_1_60_0\boost\</strong><br /><br />do lokalizacji:<br /><strong>c:\Program Files (x86)\CodeBlocks\MinGW\include\boost\</strong><br /><br />I takie programy jak <a href="http://pastebin.com/U3GT0az3"  class="postlink">-&gt; ten &lt;-</a> zaczęły się poprawnie kompilować.<br /><br />Z tego, co piszesz wynika jednak, że powinienem część bibliotek samodzielnie skompilować? No nic idę poczytać. Może coś doczytam.<br /><br />Znalazłem jeszcze to:<br /><!-- m --><a class="postlink" href="http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef" >http://wiki.codeblocks.org/index.php?ti ... wsQuickRef</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 1 kwi 2016, o 18:39</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Sparrow-hawk]]></name></author>
<updated>2016-04-01T11:51:47+01:00</updated>
<published>2016-04-01T11:51:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157472#p157472</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157472#p157472"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157472#p157472"><![CDATA[
Większość bibliotek z Boost jest typu &quot;header-only&quot;, co oznacza, że wystarczające jest dołączenie do projektu odpowiednich plików nagłówkowych. Polecam zajrzeć tu: <a href="http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html"  class="postlink">http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html</a><br /><br />Ale w przypadku korzystania z Boost.Asio wymagane jest zlinkowanie biblioteki Boost.System <a href="http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/using.html"  class="postlink">http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/using.html</a><br /><br />Piszesz, że masz najnowsze biblioteki, a czy te biblioteki skompilowałeś? Jakiego w ogóle używasz kompilatora?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10614">Sparrow-hawk</a> — 1 kwi 2016, o 11:51</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-01T08:45:28+01:00</updated>
<published>2016-04-01T08:45:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157468#p157468</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157468#p157468"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157468#p157468"><![CDATA[
<div class="quotetitle">marmur napisał(a):</div><div class="quotecontent"><br />Wygląda to tak, jakbyś nie miał do projektu dodanych źródeł boost. W jaki sposób go includujesz? I czy nie trzeba go czasem dodać ręcznie do projektu?<br /></div><br /><br />Jeśli chodzisz o biblioteki boost, to mam je (i działają w innych projektach). Np. ten kod działa bez problemu: <!-- m --><a class="postlink" href="http://pastebin.com/U3GT0az3" >http://pastebin.com/U3GT0az3</a><!-- m --> (a też korzysta z boost).<br /><br />Mam najnowsze biblioteki pobrane ze strony domowej boost: <!-- m --><a class="postlink" href="http://www.boost.org/" >http://www.boost.org/</a><!-- m --><br /><br />Czyżby te biblioteki zmieniły się na tyle, że kod na nich się już nie kompiluje / przestał się kompilować ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 1 kwi 2016, o 08:45</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Sparrow-hawk]]></name></author>
<updated>2016-04-01T08:17:55+01:00</updated>
<published>2016-04-01T08:17:55+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157466#p157466</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157466#p157466"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157466#p157466"><![CDATA[
Nie masz zlinkowanej z projektem biblioteki boost_system. I pewnie jeszcze opcja -lws2_32 też się tutaj przyda.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10614">Sparrow-hawk</a> — 1 kwi 2016, o 08:17</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[marmur]]></name></author>
<updated>2016-04-01T08:11:14+01:00</updated>
<published>2016-04-01T08:11:14+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157465#p157465</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157465#p157465"/>
<title type="html"><![CDATA[Re: boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157465#p157465"><![CDATA[
Wygląda to tak, jakbyś nie miał do projektu dodanych źródeł boost. W jaki sposób go includujesz? I czy nie trzeba go czasem dodać ręcznie do projektu?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10570">marmur</a> — 1 kwi 2016, o 08:11</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mes mariusz]]></name></author>
<updated>2016-04-01T07:09:54+01:00</updated>
<published>2016-04-01T07:09:54+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157461#p157461</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157461#p157461"/>
<title type="html"><![CDATA[boost c++ read from serial port with timeout example]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15004&amp;p=157461#p157461"><![CDATA[
Cześć. <br /><br />Mimo, że mam najnowsze biblioteki boost nie mogę skompilować kodu ze strony: <br /><br /><!-- m --><a class="postlink" href="http://www.ridgesolutions.ie/index.php/2012/12/13/boost-c-read-from-serial-port-with-timeout-example/" >http://www.ridgesolutions.ie/index.php/ ... t-example/</a><!-- m --><br /><br />Dostaję takie komunikaty przy próbie kompilacji: <br /><br />- kodu pierwszego:<br /><br /><!-- m --><a class="postlink" href="http://i.imgur.com/g5AgeT5.png" >http://i.imgur.com/g5AgeT5.png</a><!-- m --><br /><!-- m --><a class="postlink" href="http://i.imgur.com/7PtGUxY.png" >http://i.imgur.com/7PtGUxY.png</a><!-- m --><br /><br />- kodu drugiego:<br /><br /><!-- m --><a class="postlink" href="http://i.imgur.com/TQRYQOn.png" >http://i.imgur.com/TQRYQOn.png</a><!-- m --><br /><br />Jeśli ktoś może mnie naprowadzić na przyczynę, będę wdzięczny.<br /><br />Wygląda jakby coś było nie tak z bibliotekami boost. Czyżby od czasu napisania wpisu na stronie, biblioteki zmieniły się na tyle, że kod nie chce się już kompilować?<br /><br />Dzięki piękne.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7975">mes mariusz</a> — 1 kwi 2016, o 07:09</p><hr />
]]></content>
</entry>
</feed>