Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
serial_recv.c File Reference

Implements OP_SERIAL_RECV to read bytes from a serial port. More...

Go to the source code of this file.

Functions

 free_value (maxv)
 free_value (fdv)

Variables

case OP_SERIAL_RECV
Value fdv = pop_value(vm)
char * out = NULL
Value s = make_string(out ? out : "")

Detailed Description

Implements OP_SERIAL_RECV to read bytes from a serial port.

Behavior:

  • Pops max_len (int) and fd (int); reads up to max_len bytes; pushes a string with received data (possibly empty).
  • Only supported on UNIX-like systems; other platforms push empty string.

Errors:

  • On wrong types, prints an error and pushes empty string.

Definition in file serial_recv.c.

Function Documentation

◆ free_value() [1/2]

free_value(fdv)

◆ free_value() [2/2]

free_value(maxv)

Variable Documentation

◆ fdv

Value fdv = pop_value(vm)

Definition at line 29 of file serial_recv.c.

◆ OP_SERIAL_RECV

case OP_SERIAL_RECV

Definition at line 26 of file serial_recv.c.

◆ out

char* out = NULL

Definition at line 30 of file serial_recv.c.

◆ s

Value s = make_string(out ? out : "")

Definition at line 53 of file serial_recv.c.