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

Implements OP_SERIAL_SEND to write bytes to a serial port. More...

Go to the source code of this file.

Functions

 free_value (datav)
 free_value (fdv)
 push_value (vm, make_int(sent))

Variables

case OP_SERIAL_SEND
Value fdv = pop_value(vm)
int sent = -1
 break

Detailed Description

Implements OP_SERIAL_SEND to write bytes to a serial port.

Behavior:

  • Pops data (string) and fd (int); writes data to the serial port; pushes number of bytes written (>=0) or -1 on error.
  • Only supported on UNIX-like systems; other platforms push -1.

Errors:

  • On wrong types, prints an error and pushes -1.

Definition in file serial_send.c.

Function Documentation

◆ free_value() [1/2]

free_value(datav)

◆ free_value() [2/2]

free_value(fdv)

◆ push_value()

push_value(vm,
make_int(sent) )

Variable Documentation

◆ break

break

Definition at line 45 of file serial_send.c.

◆ fdv

Value fdv = pop_value(vm)

Definition at line 29 of file serial_send.c.

◆ OP_SERIAL_SEND

case OP_SERIAL_SEND

Definition at line 26 of file serial_send.c.

◆ sent

int sent = -1

Definition at line 30 of file serial_send.c.