<?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=46&amp;t=8027&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-08-18T17:07:10+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=46&amp;t=8027&amp;mode</id>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2014-08-18T17:07:10+01:00</updated>
<published>2014-08-18T17:07:10+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91924#p91924</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91924#p91924"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91924#p91924"><![CDATA[
<div class="quotetitle">stachn napisał(a):</div><div class="quotecontent"><br />Czytając ostatni wpis na stronie to sądzę ze niestety nie będzie obszerniejszego wyjaśnienia<br /></div><br /><br />będzie będzie trwa przenoszenie strony <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><br />trochę cierpliwości<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 18 sie 2014, o 17:07</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[stachn]]></name></author>
<updated>2014-08-18T08:01:29+01:00</updated>
<published>2014-08-18T08:01:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91870#p91870</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91870#p91870"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91870#p91870"><![CDATA[
Czytając ostatni wpis na stronie to sądzę ze niestety nie będzie obszerniejszego wyjaśnienia<br /> <div class="quotetitle">SunRiver napisał(a):</div><div class="quotecontent"><br />co do strzałki -&gt; to po prostu można powiedzieć &quot;przypisanie&quot; choć to możliwe że zbyt duże uproszczenie z grubsza można powiedzieć że podobne jest do &gt;&gt; w gcc dla AVR niemniej postaram się niektóre rzeczy wyjaśnić w arcie na stronie. gdyż dużo pisania będzie<br /></div><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=765">stachn</a> — 18 sie 2014, o 08:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[stachn]]></name></author>
<updated>2014-08-15T11:01:57+01:00</updated>
<published>2014-08-15T11:01:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91594#p91594</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91594#p91594"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91594#p91594"><![CDATA[
OK. Dzięki. Wiem że w 99% można korzystać z książek mirka bo je mam - może być kłopot dla tych którzy ich nie mają a zasugerują się tytułem &quot;.. dla (bardzo) początkujących&quot;. Mnie to zaskoczyło bo zaliczam się do tych bardzo początkujących pomimo przestudiowania książek mirka. Dlatego prawie wszystko zrozumiałem (przynajmniej jak na razie) za wyjątkiem tego nieszczęsnego symbolu.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=765">stachn</a> — 15 sie 2014, o 11:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2014-08-15T09:19:18+01:00</updated>
<published>2014-08-15T09:19:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91586#p91586</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91586#p91586"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91586#p91586"><![CDATA[
Widzisz nie opisywałem języka C i składni , gdyż w dużej mierze spokojnie można korzystać z książek mirka w tej kwestii , a skupiłem się <br />na konkretnych przykładach i ich realizacji nie wciągając się w znane z wielu książek -- tłumaczenia not czy powielanie opisów składni.<br />oczywiście może zbyt po macoszemu potraktowałem niektóre zagadnienia , ale zdałem się na inteligencję czytelnika, poniekąd wymuszając <br />samodzielne myślenie i dociekanie..  Takie było założenie.  Niemniej przepraszam za pewne niedogodności,  ale zawsze możesz zadać pytanie <br /><img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /> <br /><br />co do strzałki -&gt;  to po prostu można powiedzieć &quot;przypisanie&quot;   choć to możliwe że zbyt duże uproszczenie z grubsza można powiedzieć że podobne jest do &gt;&gt;  w gcc dla AVR  niemniej postaram się niektóre rzeczy wyjaśnić w arcie na stronie. gdyż dużo pisania będzie<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 15 sie 2014, o 09:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[stachn]]></name></author>
<updated>2014-08-14T21:51:01+01:00</updated>
<published>2014-08-14T21:51:01+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91566#p91566</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91566#p91566"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91566#p91566"><![CDATA[
Tak - zgadzam się że odwołanie do pinów jest inne, inne rzeczy też chociaż nie jestem w tej chili zdolny napisać co jeszcze. Dosyć daleko &quot;zaszedłem&quot; w książce &quot;Mikrokontrolery Kinetis dla bardzo początkujących&quot; ale brakuje mi tam opisów w stylu książek Mirka. Ale jakoś sobie radzę. Jedynie czego jak na razie nie potrafię &quot;rozgryźć&quot; to właśnie taką strzałkę -&gt; ( a nie treść polecenia). Nie spotkałem się z tym dotychczas a przynajmniej nie pamiętam abym się z tym spotkał. I to mnie trochę denerwuje - nawet w necie szukałem opisu i jakoś nie znalazłem.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=765">stachn</a> — 14 sie 2014, o 21:51</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2014-08-14T19:52:26+01:00</updated>
<published>2014-08-14T19:52:26+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91546#p91546</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91546#p91546"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91546#p91546"><![CDATA[
Widzisz po prostu odwołanie do pinów w ARM jest troszkę odmienne ... mianowicie <br /><br />GPIO  =  General Port Input/Output , C no wiadomo że chodzi o port C <br />ODR   =  Output Data Register  --- czyli już wiadomo że chcę mieć wyjście <br />GPIO_Pin_9  -- ustawienie wyjścia dotyczy konkretnie pinu 9 portu C ..<br /><br /><br />jak widzisz jest inaczej niz w AVR , no ale tak musi być bo i 4 razy lepszy mikrokontroler <br />do wielu rzeczy się będziesz musiał przyzwyczaić innych nauczyć<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 14 sie 2014, o 19:52</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[stachn]]></name></author>
<updated>2014-08-14T11:30:32+01:00</updated>
<published>2014-08-14T11:30:32+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91502#p91502</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91502#p91502"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91502#p91502"><![CDATA[
To by miało i sens. Pierwszy raz spotkałem sie tym w programie &quot;KL25Z_UART a konkretnie w takim poleceniu:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">static void SendChar(unsigned char ch, UART_Desc *desc) {<br />  desc-&gt;isSent = FALSE;  // uruchomi sie tylko raz podczas wysyłania bloku<br />  /*    </div><br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: kilkunastu sekundach ]</span></strong><br /><br />To by miało i sens. Pierwszy raz spotkałem sie tym w programie &quot;KL25Z_UART a konkretnie w takim poleceniu:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">static void SendChar(unsigned char ch, UART_Desc *desc) {<br />  desc-&gt;isSent = FALSE;  // uruchomi sie tylko raz podczas wysyłania bloku<br />  /*    </div><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=765">stachn</a> — 14 sie 2014, o 11:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[MichalXY]]></name></author>
<updated>2014-08-13T23:13:21+01:00</updated>
<published>2014-08-13T23:13:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91457#p91457</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91457#p91457"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91457#p91457"><![CDATA[
Wytłumaczę w skórcie(mogę się mylic) to GPIOx gdzie x to literka danego portu to nic innego jak struktura(jak działa struktura jest opisane w BB) z tym że jest to wskaźnik do struktury więc zamiast kropeczki po GPIOx stosuje się &quot;-&gt;&quot; ponieważ odwołujemy się do wskaźnika struktury(wiem masło maślane).<br /><br />Mogę się oczywiście mylić wiec w razie czego proszę o sprostowanie powyższego  <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /> <br /><br />Pozdrawiam!<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=226">MichalXY</a> — 13 sie 2014, o 23:13</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[stachn]]></name></author>
<updated>2014-08-13T22:37:25+01:00</updated>
<published>2014-08-13T22:37:25+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91451#p91451</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91451#p91451"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=91451#p91451"><![CDATA[
Mam trochę nie na temat pytanie ale wiąże się właśnie z STM a mianowicie:<br />nie wiem co znaczy taki symbol -&gt; np. tutaj  GPIOC-&gt;ODR |= GPIO_Pin_9;.<br />spotkałem się już z nim w książce &quot;Mikrokontrolery Kinetis ...&quot; i nie mogę nigdzie znaleźć opisu a sam niezbyt potrafię to skojarzyć. Dotychczas w żadnej książce Mirka tego nie spotkałem. Co znaczy GPIO to wiem ale ta kreska z strzałką to już niestety nie.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=765">stachn</a> — 13 sie 2014, o 22:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2014-08-06T19:45:46+01:00</updated>
<published>2014-08-06T19:45:46+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90482#p90482</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90482#p90482"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90482#p90482"><![CDATA[
trochę kurcze stare to już jest i obawiam się że nie do odzyskania , ale jeszcze grzebię  ... kopia powinna gdzieś być<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 6 sie 2014, o 19:45</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Anonymous]]></name></author>
<updated>2014-08-06T08:59:01+01:00</updated>
<published>2014-08-06T08:59:01+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90417#p90417</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90417#p90417"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90417#p90417"><![CDATA[
<div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />poszukam tego softu i wrzucę ci cały projekt<br /></div><br /><br />Też bym był wdzięczny<p>Statystyki: Napisane przez Gość — 6 sie 2014, o 08:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[MichalXY]]></name></author>
<updated>2014-08-05T19:17:14+01:00</updated>
<published>2014-08-05T19:17:14+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90354#p90354</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90354#p90354"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90354#p90354"><![CDATA[
Dzięki wielkie Sun.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=226">MichalXY</a> — 5 sie 2014, o 19:17</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2014-08-05T19:09:51+01:00</updated>
<published>2014-08-05T19:09:51+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90352#p90352</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90352#p90352"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90352#p90352"><![CDATA[
poszukam tego softu i wrzucę ci cały projekt<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 5 sie 2014, o 19:09</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[MichalXY]]></name></author>
<updated>2014-08-05T12:19:16+01:00</updated>
<published>2014-08-05T12:19:16+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90297#p90297</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90297#p90297"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90297#p90297"><![CDATA[
Niestety nie pomogła. Wygląda na to że co bym nie wpisał, czy będzie to dobre czy złe hasło to i tak jest kiszka  <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" /> .<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=226">MichalXY</a> — 5 sie 2014, o 12:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[tomwisnia]]></name></author>
<updated>2014-08-05T11:59:33+01:00</updated>
<published>2014-08-05T11:59:33+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90295#p90295</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90295#p90295"/>
<title type="html"><![CDATA[Re: STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90295#p90295"><![CDATA[
a zmiana hasła tez nie pomaga?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=183">tomwisnia</a> — 5 sie 2014, o 11:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[MichalXY]]></name></author>
<updated>2014-08-05T11:29:20+01:00</updated>
<published>2014-08-05T11:29:20+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90292#p90292</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90292#p90292"/>
<title type="html"><![CDATA[STM32 VL Discovery Serwer WWW]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8027&amp;p=90292#p90292"><![CDATA[
Witajcie!<br /><br />Ostatnio walczę z ethernetem na powyżej płytce VL DISCOVERY. Korzystam z tutoriala autorstwa SunRiver'a i na poczatek zabrałem się za ogarnięcie serwera webowego(link do tego odcinka: <!-- m --><a class="postlink" href="http://sunduino.elektroda.eu/wordpress/arm/stm32/discovery/start-z-stm32-vl-discovery-16-tcpip-2/" >http://sunduino.elektroda.eu/wordpress/ ... 6-tcpip-2/</a><!-- m -->) <br /><br />Sam kod źródłowy jeśli chodzi o ethernet przerobiłem w pliku simple_server.c w linicje 47 gdzie definiujemy numer ip urządzenia (pierwotnie było ustawione na  192,168,1,3 a ja zmieniłem na 192,168,1,25) oraz w linijce 52 gdzie definiuje zmienną baseurl gdzie pierwotnie miała taką postać: <!-- m --><a class="postlink" href="http://192.168.1.3/" >http://192.168.1.3/</a><!-- m --> a ja zmieniłem ją na <!-- m --><a class="postlink" href="http://192.168.1.25/" >http://192.168.1.25/</a><!-- m --> . Po wgraniu wsadu do uC układ daję się pingować. <br />Po wpisaniu w przeglądarkę numery ip układu czyli 192.168.1.25 wyświetla mi się strona z komunikatem: <br />User: <!-- m --><a class="postlink" href="http://192.168.1.25/password" >http://192.168.1.25/password</a><!-- m --><br />do tego momentu jest wszystko ok. <br />Problem polega na tym gdy wpisuje w przeglądarkę User: <!-- m --><a class="postlink" href="http://192.168.1.25/LED4" >http://192.168.1.25/LED4</a><!-- m --> to wyświetla się strona z komunikatem: <br />401 Unauthorized a patrząc na kod źródłowy komunikat ten pokazuje się wówczas gdy jest złe hasło i/lub jest zła komenda.<br /><br />Docelowo chce odpalić UDP na STM32 ale żeby się jakoś bliżej poznać z etherenetm to zacząłem od serwera webowego a tutaj taki klopsik  <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" /> <br /><br />Poniżej podaję kody źródłowe main.c oraz simple_server.c oraz zdjęcia z konfiguracji karty sieciowej w PC.<br /><br />kod main.c<br /><br />[syntax=c]/*<br /> * ENC28J60<br /> * SerwerWWW ? STM32VLDiScovery<br /> * SunRiver<br /> * www.sunduino.pl<br /> */<br /><br />/* Includes */<br />#include &lt;stddef.h&gt;<br />#include &quot;stm32f10x.h&quot;<br />//#include &quot;STM32vldiscovery.h&quot;<br />#include &quot;ENC28J60.h&quot;<br />#include &quot;stm_lib/inc/stm32f10x_gpio.h&quot;<br />#include &quot;stm_lib/inc/stm32f10x_rcc.h&quot;<br />#include &quot;stm_lib/inc/stm32f10x_spi.h&quot;<br /><br />#include &quot;ip_arp_udp_tcp.h&quot;<br />#include &quot;simple_server.h&quot;<br /><br /><br />//NOTE: MAC address in ENC28J60 is byte-backward !!<br />const uint8_t ENC_MAC&#91;6&#93; = {0x54,0x55,0x58,0x10,0x00,0x24};<br />const uint8_t ENC_IP&#91;4&#93;={192,168,1,25};<br />uint8_t PC_MAC&#91;6&#93;;<br />const uint8_t PC_IP&#91;4&#93;={192,168,1,1};<br />uint8_t i;<br />uint16_t dummyread;<br /><br />/* Private function prototypes */<br />void SPI1_Init(void);<br />void Delay(__IO uint32_t nTick);<br />uint8_t SPI1_ReadWrite(uint8_t writedat);<br /><br />extern int simple_server(void);<br /><br />/* Private functions ---------------------------------------------------------*/<br /><br /><br />/**<br /> * Pętla główna MAIN<br /> *<br /> */<br />int main(void)<br />{<br />i = 0;<br /><br />GPIO_InitTypeDef GPIO;<br />GPIO_InitTypeDef button;<br /><br />//INICJALIZACJA PINÓW Z PODŁĄCZONYMI DIODAMI LED<br /><br />GPIO.GPIO_Mode = GPIO_Mode_Out_OD;<br />GPIO.GPIO_Speed = GPIO_Speed_50MHz;<br />GPIO.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9;<br />GPIO_Init(GPIOC,&amp;GPIO);<br /><br />//INICJALIZACJA PINA Z PODŁĄCZONYM PRZYCISKIEM<br /><br />button.GPIO_Mode = GPIO_Mode_IN_FLOATING;<br />button.GPIO_Speed = GPIO_Speed_50MHz;<br />button.GPIO_Pin = GPIO_Pin_0;<br />GPIO_Init(GPIOA,&amp;button);<br /><br /><br /><br />SPI1_Init();<br />enc28j60_init((uint8_t *)ENC_MAC);<br />Delay(0xFFFFF);<br />init_ip_arp_udp_tcp((uint8_t *)ENC_MAC, (uint8_t *)ENC_IP, 80);<br />Delay(0xFFFFF);<br />i = enc28j60getrev();<br /><br />i = simple_server();<br /><br /><br /><br /><br /><br />while(1)<br />{<br /><br />GPIOC-&gt;ODR |= GPIO_Pin_9;<br />GPIOC-&gt;ODR &amp;= ~(1&lt;&lt;8);<br /><br /><br /><br />}<br />}<br /><br /><br />/**<br /> * Delayek<br /> *<br /> */<br />void Delay(__IO uint32_t nTick)<br />{<br />for(; nTick != 0; nTick--);<br />}<br /><br /><br />/**<br /> * Inicializacja SPI1<br /> *<br /> */<br />void SPI1_Init(void)<br />{<br /><br />SPI_InitTypeDef  SPI_InitStructure;<br />GPIO_InitTypeDef GPIO_InitStructure;<br /><br />/* Enable SPI1 and GPIOA clocks */<br />RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1 | RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOA, ENABLE);<br /><br />/* Configure SPI1 pins: SCK, MISO and MOSI */<br />GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_7 | GPIO_Pin_6;<br />GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;<br />GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;<br />GPIO_Init(GPIOA, &amp;GPIO_InitStructure);<br /><br />/* Configure MISO as Input with internal pull-up */<br />//GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_6;<br />//GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_IPU;<br />//GPIO_Init(GPIOA, &amp;GPIO_InitStructure);<br /><br />/* Configure PA4 as ENC_SELECT */<br />GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_4;<br />GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_Out_PP;<br />GPIO_Init(GPIOA, &amp;GPIO_InitStructure);<br /><br /><br />/* SPI1 configuration */<br />SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;<br />SPI_InitStructure.SPI_Mode = SPI_Mode_Master;<br />SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;<br />SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;<br />SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;<br />SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;<br />//SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4;<br />SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_128;  // 24000kHz/256=93kHz &lt; 400kHz<br />SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;<br />SPI_InitStructure.SPI_CRCPolynomial = 7;<br />SPI_Init(SPI1, &amp;SPI_InitStructure);<br /><br />SPI_CalculateCRC(SPI1, DISABLE);<br /><br />/* Enable SPI1  */<br />SPI_Cmd(SPI1, ENABLE);<br /><br />/* Drain SPI1 */<br />while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET) { ; }<br />dummyread = SPI_I2S_ReceiveData(SPI1);<br />}<br /><br />uint8_t SPI1_ReadWrite(uint8_t writedat)<br />{<br />uint8_t i = 0;<br />/* Loop while DR register in not empty */<br />while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);<br />/* Send byte through the SPI1 peripheral */<br />SPI_I2S_SendData(SPI1, writedat);<br /><br />//     printf (&quot;writedat...%x\r\n&quot;,writedat);<br /><br />/* Wait to receive a byte */<br />while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);<br />i= SPI_I2S_ReceiveData(SPI1) ;<br /><br />//      printf (&quot;readdat...%x\r\n&quot;,i);<br />/* Return the byte read from the SPI bus */<br />return i;<br />}<br /><br /><br /><br />#ifdef  USE_FULL_ASSERT<br /><br />/**<br /> * @brief  Reports the name of the source file and the source line number<br /> *   where the assert_param error has occurred.<br /> * @param  file: pointer to the source file name<br /> * @param  line: assert_param error line source number<br /> * @retval None<br /> */<br />void assert_failed(uint8_t* file, uint32_t line)<br />{<br />/* User can add his own implementation to report the file name and line number,<br />     ex: printf(&quot;Wrong parameters value: file %s on line %d\r\n&quot;, file, line) */<br /><br />/* Infinite loop */<br />while (1)<br />{<br />}<br />}<br />#endif<br /><br />/*<br /> * Minimal __assert_func used by the assert() macro<br /> * */<br />void __assert_func(const char *file, int line, const char *func, const char *failedexpr)<br />{<br />while(1)<br />{}<br />}<br /><br />/*<br /> * Minimal __assert() uses __assert__func()<br /> * */<br />void __assert(const char *file, int line, const char *failedexpr)<br />{<br />__assert_func (file, line, NULL, failedexpr);<br />}[/syntax]<br /><br />kod simple_server.c<br /><br />[syntax=c]/*********************************************<br /> * vim:sw=8:ts=8:si:et<br /> * To use the above modeline in vim you must have &quot;set modeline&quot; in your .vimrc<br /> * Author: Guido Socher<br /> * Copyright: GPL V2<br /> * See http://www.gnu.org/licenses/gpl.html<br /> *<br /> * Ethernet remote device and sensor<br /> * UDP and HTTP interface <br />        url looks like this http://baseurl/password/command<br />        or http://baseurl/password/<br /> *<br /> * Title: Microchip ENC28J60 Ethernet Interface Driver<br /> * Chip type           : ATMEGA88 with ENC28J60<br /> * Note: there is a version number in the text. Search for tuxgraphics<br /> *********************************************/<br /><br /><br />/*********************************************<br /> * modified: 2007-08-08<br /> * Author  : awake<br /> * Copyright: GPL V2<br /> * http://www.icdev.com.cn/?2213/<br /> * Host chip: ADUC7026<br /> **********************************************/<br /><br /><br />#include &quot;stdio.h&quot;<br />#include &lt;string.h&gt;<br />#include &quot;stm32f10x_conf.h&quot;<br />#include &quot;ENC28J60.h&quot;<br />#include &quot;net.h&quot;<br />#include &quot;ip_arp_udp_tcp.h&quot;<br /><br /><br /><br />#define PSTR(s) s<br /><br /><br />//extern void delay_ms(unsigned char ms);<br /><br />// please modify the following two lines. mac and ip have to be unique<br />// in your local area network. You can not have the same numbers in<br />// two devices:<br /><br />static uint8_t mymac&#91;6&#93; = {0x54,0x55,0x58,0x10,0x00,0x24};<br />static uint8_t myip&#91;4&#93; = {192,168,1,25};<br /><br />// base url (you can put a DNS name instead of an IP addr. if you have<br />// a DNS server (baseurl must end in &quot;/&quot;):<br />//static char baseurl&#91;&#93;=&quot;http://192.168.1.3/&quot;;<br />static char baseurl&#91;&#93; = &quot;http://192.168.1.25/&quot;;<br />static uint16_t my_www_port =80; // listen port for tcp/www (max range 1-254)<br /><br />// or on a different port:<br />//static char baseurl&#91;&#93;=&quot;http://10.0.0.24:88/&quot;;<br />//static uint16_t mywwwport =88; // listen port for tcp/www (max range 1-254)<br />//<br />static uint16_t my_udp_port =1200; // listen port for udp<br />// how did I get the mac addr? Translate the first 3 numbers into ascii is: TUX<br /><br />#define BUFFER_SIZE 1500           //400<br />static uint8_t buf&#91;BUFFER_SIZE+1&#93;;<br /><br />// the password string (only the first 5 char checked), (only a-z,0-9,_ characters):<br /><br />static char password&#91;&#93;=&quot;LED4&quot;; // must not be longer than 9 char<br />const unsigned char WebSide&#91;&#93; = {<br />&quot;&lt;p&gt;&lt;b&gt;&lt;span lang=EN-US&gt;A/D &lt;/span&gt;STM32VL-Discovery&lt;span lang=EN-US&gt;:(&lt;/span&gt;LED4&lt;span\r\n&quot;<br />&quot;lang=EN-US&gt;0~&lt;st1:chmetcnv UnitName=\&quot;AC\&quot; SourceValue=\&quot;50\&quot; HasSpace=\&quot;False\&quot;\r\n&quot;<br />&quot;Negative=\&quot;False\&quot; NumberType=\&quot;1\&quot; TCSC=\&quot;0\&quot; w:st=\&quot;on\&quot;&gt;50 AC&lt;/st1:chmetcnv&gt;)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;\r\n&quot;<br />&quot;\r\n&quot;<br />&quot;&lt;table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 width=540\r\n&quot;<br />&quot; style='width:405.0pt;mso-cellspacing:0cm;background:red;border:outset 4.5pt;\r\n&quot;<br />&quot; mso-padding-alt:0cm 0cm 0cm 0cm'&gt;\r\n&quot;<br />&quot; &lt;tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'&gt;\r\n&quot;<br />&quot;  &lt;td style='padding:0cm 0cm 0cm 0cm'&gt;\r\n&quot;<br />&quot;  &lt;table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0\r\n&quot;<br />&quot;   style='mso-cellspacing:0cm;mso-padding-alt:0cm 0cm 0cm 0cm'&gt;\r\n&quot;<br />&quot;   &lt;tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'&gt;\r\n&quot;<br />&quot;    &lt;td style='background:lime;padding:0cm 0cm 0cm 0cm'&gt;\r\n&quot;<br />&quot;    &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;\r\n&quot;<br />&quot;    &lt;/td&gt;\r\n&quot;<br />};<br />// <br />uint8_t verify_password(char *str)<br />{<br />// the first characters of the received string are<br />// a simple password/cookie:<br />if (strncmp(password,str,5)==0)<br />{<br />return(1);<br />}<br />return(0);<br />}<br /><br />// takes a string of the form password/commandNumber and analyse it<br />// return values: -1 invalid password, otherwise command number<br />//                -2 no command given but password valid<br />int8_t analyse_get_url(char *str)<br />{<br />uint8_t i=0;<br />if (verify_password(str)==0)<br />{<br />return(-1);<br />}<br />// find first &quot;/&quot;<br />// passw not longer than 9 char:<br />while(*str &amp;&amp; i&lt;10 &amp;&amp; *str &gt;',' &amp;&amp; *str&lt;'{')<br />{<br />if (*str=='/')<br />{<br />str++;<br />break;<br />}<br />i++;<br />str++;<br />}<br />if (*str &lt; 0x3a &amp;&amp; *str &gt; 0x2f)<br />{<br />// is a ASCII number, return it<br />return(*str-0x30);<br />}<br />return(-2);<br />}<br /><br />// prepare the webpage by writing the data to the tcp send buffer<br />uint16_t print_webpage(uint8_t *buf,uint8_t on_off)<br />{<br />uint16_t plen;<br />plen=fill_tcp_data_p(buf,0,PSTR(&quot;HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n&quot;));<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;html&gt;&lt;body&gt;&lt;center&gt;&lt;h1&gt;STM32VL-Discovery TCP/IP&lt;/h1&gt;\n&lt;h1&gt;http://www.sunduino.pl &lt;/h1&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;\n&quot;));<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;p&gt;LED status: &quot;));<br />if (on_off)<br />{<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;font color=\&quot;#0000FF\&quot;&gt; LIGHTING &lt;/font&gt;&quot;));<br />}<br />else<br />{<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot; zgaszona &quot;));<br />}<br />//plen=fill_tcp_data_p(buf,plen,PSTR(&quot; &lt;small&gt;&lt;a href=\&quot;&quot;));<br />//plen=fill_tcp_data(buf,plen,baseurl);<br />//plen=fill_tcp_data(buf,plen,password);<br />//plen=fill_tcp_data_p(buf,plen,PSTR(&quot;\&quot;&gt;&#91;DA&#93;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;\n&lt;p&gt;&lt;a href=\&quot;&quot;));<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&quot;));<br />if(0 == GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0))<br />{<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;br&gt;&lt;p&gt;Przycisku nie nacinięto.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;\n&quot;));<br />}<br />else<br />{<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;br&gt;&lt;p&gt;Przycisk &lt;b&gt; nacinięty &lt;/b&gt;.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;\n&quot;));<br />}<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;p&gt;&lt;a href=\&quot;&quot;));<br />// the url looks like this http://baseurl/password/command<br />plen=fill_tcp_data(buf,plen,baseurl);<br />plen=fill_tcp_data(buf,plen,password);<br />if (on_off)<br />{<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;/0\&quot;&gt;Wyłącz LED&lt;/a&gt;&lt;p&gt;&quot;));<br />}<br />else<br />{<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;/1\&quot;&gt;Włącz LED&lt;/a&gt;&lt;p&gt;&quot;));<br />}<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;/center&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;hr&gt;&lt;br&gt;STM32F100 Value Line UCOS-II V2.85 WEB\n&lt;/body&gt;&lt;/html&gt;&quot;));<br />//plen=fill_tcp_data_p(buf,plen,PSTR(WebSide));<br /><br />return(plen);<br />}<br /><br />int simple_server(void)<br />{<br />uint16_t plen;<br />uint16_t dat_p;<br />uint8_t i=0;<br />uint8_t cmd_pos=0;<br />int8_t cmd;<br />uint8_t payloadlen=0;<br />char str&#91;30&#93;;<br />char cmdval;<br /><br /><br />//Del_1ms(100);<br /><br />/*inicjacja enc28j60*/<br />//enc28j60Init(mymac);<br />//init_ip_arp_udp_tcp(mymac,myip,mywwwport);<br /><br />enc28j60_write_phy(PHLCON, 0x7a4);<br /><br />//enc28j60PhyWrite(PHLCON,0x7a4);<br />//enc28j60clkout(2); // change clkout from 6.25MHz to 12.5MHz<br />//Del_1ms(20);<br /><br />//init the ethernet/ip layer:<br /><br />while(1)<br />{<br />//OSTimeDlyHMSM(0, 0, 0, 50);<br />// get the next new packet:<br />//plen = enc28j60PacketReceive(BUFFER_SIZE, buf);<br />plen = enc28j60_recv_packet(buf, BUFFER_SIZE);<br />//USART_DMASendData(USART1,buf,plen);<br /><br />/*plen will ne unequal to zero if there is a valid packet (without crc error) */<br />if(plen==0)<br />{<br />continue;<br />}<br />// arp is broadcast if unknown but a host may also<br />// verify the mac address by sending it to<br />// a unicast address.<br />if(eth_type_is_arp_and_my_ip(buf,plen))<br />{<br />make_arp_answer_from_request(buf);<br />//USART_DMASendText(USART1,&quot;make_arp_answer_from_request\n&quot;);<br />continue;<br />}<br /><br />// check if ip packets are for us:<br />if(eth_type_is_ip_and_my_ip(buf,plen)==0)<br />{<br />continue;<br />}<br /><br /><br />if(buf&#91;IP_PROTO_P&#93;==IP_PROTO_ICMP_V &amp;&amp; buf&#91;ICMP_TYPE_P&#93;==ICMP_TYPE_ECHOREQUEST_V)<br />{<br />// a ping packet, let's send pong<br />make_echo_reply_from_request(buf, plen);<br />//USART_DMASendText(USART1,&quot;make_echo_reply_from_request\n&quot;);<br />continue;<br />}<br />// tcp port www start, compare only the lower byte<br />if (buf&#91;IP_PROTO_P&#93;==IP_PROTO_TCP_V&amp;&amp;buf&#91;TCP_DST_PORT_H_P&#93;==0&amp;&amp;buf&#91;TCP_DST_PORT_L_P&#93;==my_www_port)<br />{<br />if (buf&#91;TCP_FLAGS_P&#93; &amp; TCP_FLAGS_SYN_V)<br />{<br />make_tcp_synack_from_syn(buf);<br />// make_tcp_synack_from_syn does already send the syn,ack<br />continue;<br />}<br />if (buf&#91;TCP_FLAGS_P&#93; &amp; TCP_FLAGS_ACK_V)<br />{<br />init_len_info(buf); // init some data structures<br />// we can possibly have no data, just ack:<br />dat_p=get_tcp_data_pointer();<br />if (dat_p==0)<br />{<br />if (buf&#91;TCP_FLAGS_P&#93; &amp; TCP_FLAGS_FIN_V)<br />{<br />// finack, answer with ack<br />make_tcp_ack_from_any(buf);<br />}<br />// just an ack with no data, wait for next packet<br />continue;<br />}<br /><br /><br />if (strncmp(&quot;GET &quot;,(char *)&amp;(buf&#91;dat_p&#93;),4)!=0)<br />{<br />// head, post and other methods:<br />//<br />// for possible status codes see:<br />// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html<br />plen=fill_tcp_data_p(buf,0,PSTR(&quot;HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n&lt;h1&gt;200 OK&lt;/h1&gt;&quot;));<br />goto SENDTCP;<br />}<br />if (strncmp(&quot;/ &quot;,(char *)&amp;(buf&#91;dat_p+4&#93;),2)==0)<br />{<br />plen=fill_tcp_data_p(buf,0,PSTR(&quot;HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n&quot;));<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;&lt;p&gt;User: &quot;));<br />plen=fill_tcp_data(buf,plen,baseurl);<br />plen=fill_tcp_data_p(buf,plen,PSTR(&quot;password&lt;/p&gt;&quot;));<br />goto SENDTCP;<br />}<br />cmd=analyse_get_url((char *)&amp;(buf&#91;dat_p+5&#93;));<br /><br />// for possible status codes see:<br />// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html<br />if (cmd==-1)<br />{<br />plen=fill_tcp_data_p(buf,0,PSTR(&quot;HTTP/1.0 401 Unauthorized\r\nContent-Type: text/html\r\n\r\n&lt;h1&gt;401 Unauthorized&lt;/h1&gt;&quot;));<br />// plen=print_webpage(buf,(i));<br />goto SENDTCP;<br />}<br />if (cmd==1)<br />{<br />GPIO_SetBits(GPIOC, GPIO_Pin_8);<br />//plen=fill_tcp_data_p(buf,0,PSTR(&quot;Content-Type: text/html\r\n\r\n&lt;h1&gt;OK&lt;/h1&gt;&quot;));<br />i=1;<br />}<br />if (cmd==0)<br />{<br />//PORTD &amp;= ~(1&lt;&lt;PD7);// transistor off<br />//IOSET |= (1&lt;&lt;26);<br />//LED1OFF();<br /><br />GPIO_ResetBits(GPIOC, GPIO_Pin_8);<br />i=0;<br />}<br />// if (cmd==-2) or any other value<br />// just display the status:<br /><br /><br />SENDTCP:<br />make_tcp_ack_from_any(buf); // send ack for http get<br />make_tcp_ack_with_data(buf, (uint16_t)plen); // send data<br />continue;<br />}<br />}<br />// tcp port www end<br />//<br />// udp start, we listen on udp port 1200=0x4B0<br />if (buf&#91;IP_PROTO_P&#93;==IP_PROTO_UDP_V&amp;&amp;buf&#91;UDP_DST_PORT_H_P&#93;==4&amp;&amp;buf&#91;UDP_DST_PORT_L_P&#93;==0xb0)<br />{<br />payloadlen=buf&#91;UDP_LEN_L_P&#93;-UDP_HEADER_LEN;<br />// you must sent a string starting with v<br />// e.g udpcom version 10.0.0.24<br />if (verify_password((char *)&amp;(buf&#91;UDP_DATA_P&#93;)))<br />{<br />// find the first comma which indicates <br />// the start of a command:<br />cmd_pos=0;<br />while(cmd_pos&lt;payloadlen)<br />{<br />cmd_pos++;<br />if (buf&#91;UDP_DATA_P+cmd_pos&#93;==',')<br />{<br />cmd_pos++; // put on start of cmd<br />break;<br />}<br />}<br />// a command is one char and a value. At<br />// least 3 characters long. It has an '=' on<br />// position 2:<br />if (cmd_pos&lt;2 || cmd_pos&gt;payloadlen-3 || buf&#91;UDP_DATA_P+cmd_pos+1&#93;!='=')<br />{<br />strcpy(str,&quot;e=no_cmd&quot;);<br />goto ANSWER;<br />}<br />// supported commands are<br />// t=1 t=0 t=?<br />if (buf&#91;UDP_DATA_P+cmd_pos&#93;=='t')<br />{<br />cmdval=buf&#91;UDP_DATA_P+cmd_pos+2&#93;;<br />if(cmdval=='1')<br />{<br />//PORTD|= (1&lt;&lt;PD7);// transistor on<br />//IOCLR |= (1&lt;&lt;26);<br />//LED1ON();<br />strcpy(str,&quot;t=1&quot;);<br />goto ANSWER;<br />}<br />else if(cmdval=='0')<br />{<br />//PORTD &amp;= ~(1&lt;&lt;PD7);// transistor off<br />//IOSET |= (1&lt;&lt;26);<br />//LED1OFF();<br />strcpy(str,&quot;t=0&quot;);<br />goto ANSWER;<br />}<br />else if(cmdval=='?')<br />{<br />/*<br />    if (IOPIN &amp; (1&lt;&lt;26))<br />{<br />            strcpy(str,&quot;t=1&quot;);<br />            goto ANSWER;<br />    }<br /> */<br />strcpy(str,&quot;t=0&quot;);<br />goto ANSWER;<br />}<br />}<br />strcpy(str,&quot;e=no_such_cmd&quot;);<br />goto ANSWER;<br />}<br />strcpy(str,&quot;e=invalid_pw&quot;);<br />ANSWER:<br />make_udp_reply_from_request(buf,str,strlen(str),my_udp_port);<br /><br />}<br />}<br />//        return (0);<br />}[/syntax]<br />Konfiguracja karty sieciowej: <br /><br /><a href="http://forum.atnel.pl/_obrazki/o/226/c5364fab31a5f1bfaec901a0badce78f.png"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/226/c5364fab31a5f1bfaec901a0badce78f.png" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=226">MichalXY</a> — 5 sie 2014, o 11:29</p><hr />
]]></content>
</entry>
</feed>