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

Implements OP_SERIAL_OPEN to open and configure a serial port. More...

Go to the source code of this file.

Functions

 free_value (baudv)
 free_value (pathv)
 push_value (vm, make_int(fd > 0 ? fd :0))

Variables

case OP_SERIAL_OPEN
Value pathv = pop_value(vm)
int fd = 0
 break

Detailed Description

Implements OP_SERIAL_OPEN to open and configure a serial port.

Behavior:

  • Pops baud_rate (int) and device path (string); opens and configures the port; pushes fd (>0) or 0 on failure.
  • Only available on UNIX-like systems; Windows is unsupported and returns 0.

Errors:

  • On wrong types or OS errors, prints an error message and returns 0.

Definition in file serial_open.c.

Function Documentation

◆ free_value() [1/2]

free_value(baudv)

◆ free_value() [2/2]

free_value(pathv)

◆ push_value()

push_value(vm,
make_int(fd > 0 ? fd :0) )

Variable Documentation

◆ break

break

Definition at line 189 of file serial_open.c.

◆ fd

void fd = 0

Definition at line 92 of file serial_open.c.

◆ OP_SERIAL_OPEN

case OP_SERIAL_OPEN

Definition at line 88 of file serial_open.c.

◆ pathv

Value pathv = pop_value(vm)

Definition at line 91 of file serial_open.c.