Moxa Technologies C360 Uživatelský manuál Strana 37

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 55
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 36
For UNIX Users Chapter 4
31
int sio_read(int port, char *buf, int len)
return = >0 length of data received
0 no data received
-1 bad port
-2 time out
-5 port is not open
port = port number
buf = receive buffer pointer with required space
len = buffer length
4. Write a string of data to Tx buffer.
int sio_write(int port, char *buf, int len)
return = >0 length of data transmitted to Tx buffer
=0 buffer full
-1 bad port
-2 time out
-5 port is not open
port = port number
buf = transmit string pointer
len = transmit string length
5. Put a block of data to Tx buffer. If the Tx buffer free space is
smaller than block length, it will return zero.
int sio_putb(int port, char *buf, int len)
return = >0 length of data transmitted to Tx buffer
0 free buffer not enough
-1 bad port
-2 time out
-5 port is not open
-6 len > Tx buffer size
port = port number
buf = transmit string pointer
len = transmit string length
6. Non-TTY port parameter setting.
Zobrazit stránku 36
1 2 ... 32 33 34 35 36 37 38 39 40 41 42 ... 54 55

Komentáře k této Příručce

Žádné komentáře