RS232 ===> web

Zuffa Jan ZuffaJ na cgc.sk
Středa Leden 9 19:19:15 CET 2013


Mna zaujalo len to synaser ...


j.

-----Original Message-----
From: hw-list-bounces na list.hw.cz [mailto:hw-list-bounces na list.hw.cz] On Behalf Of RV
Sent: Wednesday, January 09, 2013 4:05 PM
To: HW-news
Subject: Re: RS232 ===> web

S tou synapsi je to uplna lahudka - v podstate uz ctu se serioveho portu (jen jsem v MCU si prehodil CR/LF - mam to obracene tak mi to neparsuje konec radek) a umim i poslat GET na URL - ted se v podstate jen trapim v te dokumentaci - jak nejlepe to rozdelit na jednotlive casti a slozit z toho korektni dotaz pro web.

Program test;

uses
   synaser, httpsend, asn1util, blcksock, clamsend, dnssend, ftpsend, ftptsend, classes;

var
   HTTP  : THTTPSend;
   ser   : TBlockSerial;
   l     : tstringlist;
   retez : string;
begin
   HTTP := THTTPSend.Create;
   l := TStringList.create;
   ser:=TBlockSerial.Create;
   ser.Connect('COM3');
   ser.Config(19200,8,'N',1,false,false);

   try
     //tady ctu seriak
     while true do
       begin
         retez :=ser.Recvstring(1000);
         writeln(retez);
       end;

     ///tady zkouska getu
     if not HTTP.HTTPMethod('GET', 'URL') then
       begin
	writeln('ERROR');
         writeln(Http.Resultcode);
       end
     else
       begin
         writeln(Http.Resultcode, ' ', Http.Resultstring);
         writeln;
         writeln(Http.headers.text);
         writeln;
         l.loadfromstream(Http.Document);
         writeln(l.text);
      end;

   finally
     ser.free;
     HTTP.Free;
     l.free;
   end;
end.


Radek Vicek

Dne 9.1.2013 15:49, Martin Záruba napsal(a):
> Protoze jsem kdysi delal v pascalu, tak me lazarus nadchnul. Ale zatim 
> moc nezvladam.
> Martin Zaruba
Tento e-mail včetně příloh může obsahovat důvěrné informace. Jestliže nejste zamýšlený adresát tohoto e-mailu, pak jakákoliv forma zveřejnění, tisk, kopírování, distribuce nebo šíření tohoto e-mailu a připojených příloh je přísně zakázáno. Pokud obdržíte tento e-mail omylem, oznamte to neprodleně jeho odesilateli a okamžitě tento e-mail včetně jeho příloh trvale vymažte ze svého systému. Odesilatel e-mailu neodpovídá za jakoukoliv škodu způsobenou modifikacemi či zpožděním přenosu e-mailu.

 

This e-mail and any attached files may contain confidential information. If you are not the intended addressee of this e-mail, you are hereby notified that any disclosure, printing, copying, distribution or dissemination of this e-mail and any attached files is strictly prohibited. If you receive this e-mail in error, please immediately notify the sender and permanently delete this e-mail and its attachments from your system. The sender of this e-mail does not accept liability for any damage that may be caused by any modifications or delay in the transmission of it.

_______________________________________________
HW-list mailing list  -  sponsored by www.HW.cz Hw-list na list.hw.cz http://list.hw.cz/mailman/listinfo/hw-list


Další informace o konferenci Hw-list