libmsr
dc2dc9c
|
#include <sys/types.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
#include <err.h>
#include "libmsr.h"
Functions | |
int | msr_serial_readchar (int fd, uint8_t *c) |
Read a single character from the MSR device. More... | |
int | msr_serial_read (int fd, void *buf, size_t len) |
Read a series of bytes from the MSR device. More... | |
int | msr_serial_write (int fd, void *buf, size_t len) |
Write a series of bytes to the MSR device. More... | |
int | msr_serial_open (char *path, int *fd, int blocking, speed_t baud) |
Open a serial connection to the MSR device. More... | |
int | msr_serial_close (int fd) |
Close a serial connection to the MSR device. More... | |
int msr_serial_close | ( | int | fd | ) |
Close a serial connection to the MSR device.
fd | The file descriptor to close. |
int msr_serial_open | ( | char * | path, |
int * | fd, | ||
int | blocking, | ||
speed_t | baud | ||
) |
Open a serial connection to the MSR device.
path | The path to the serial device. |
fd | The int pointer to store the file descriptor in. |
blocking | The blocking flag (e.g., MSR_BLOCKING) |
baud | The baud rate of the serial device (e.g., MSR_BAUD) |
int msr_serial_read | ( | int | fd, |
void * | buf, | ||
size_t | len | ||
) |
Read a series of bytes from the MSR device.
fd | The file descriptor to read from. |
buf | The buffer to read into. |
len | The length of the buffer. |
int msr_serial_readchar | ( | int | fd, |
uint8_t * | c | ||
) |
Read a single character from the MSR device.
fd | The file descriptor to read from. |
c | A pointer to write the character into. |
int msr_serial_write | ( | int | fd, |
void * | buf, | ||
size_t | len | ||
) |
Write a series of bytes to the MSR device.
fd | The file descriptor to write to. |
buf | The buffer to write. |
len | The length of the buffer. |