comp.lang.ada
 help / color / mirror / Atom feed
* How to use GNAT.Serial_Communications ?
@ 2013-09-14  1:39 elbric0
  2013-09-14  5:42 ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: elbric0 @ 2013-09-14  1:39 UTC (permalink / raw)


Hi,

I am learning Ada and try to figure how to communicate with an electronic device on a serial port.

I think the code to print 'A' to COM1 on Windows should be about that.

----------------------------------------------------------------
with GNAT.Serial_Communications; use GNAT.Serial_Communications;

procedure Test_Serial is

   Serial : Serial_Port;
   C : Character;

begin

   Open (Port => Serial, Name => Name (1));

   C := 'A';

   Character'Write (Serial, C);

   Close (Serial);

end Test_Serial;
----------------------------------------------------------------

However the type of the first parameter of Character'Write is not correct. I get this error message: "expected access to Ada.Streams.Root_Stream_Type'Class".

Can someone tell me what I should put there instead of Serial?

Do you know any tutorial or code example that can help me?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-14 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-14  1:39 How to use GNAT.Serial_Communications ? elbric0
2013-09-14  5:42 ` Simon Wright
2013-09-14 12:10   ` jasmin.stlaurent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox