39 lines
706 B
C
39 lines
706 B
C
//
|
|
// Created by nano on 4/26/25.
|
|
//
|
|
|
|
#ifndef COMMS_H
|
|
#define COMMS_H
|
|
#include <libserialport.h>
|
|
#include <stdlib.h>
|
|
|
|
typedef u_int8_t byte;
|
|
|
|
/**
|
|
* Initializes the serial communication for the usb -> uart board
|
|
*/
|
|
void comm_init_communication();
|
|
|
|
/**
|
|
* Ends the serial communication for the usb -> uart board
|
|
*/
|
|
void comm_end_communication(struct sp_port *port);
|
|
|
|
struct sp_port **comm_get_port_list();
|
|
|
|
void comm_list_serial_ports(struct sp_port **port_list);
|
|
|
|
/**
|
|
* Opens communication to the selected serial port and sets the correct parameters for the zigbee carrier board.
|
|
*/
|
|
void comm_open_port(struct sp_port *port);
|
|
|
|
|
|
int comm_await();
|
|
|
|
|
|
int check(enum sp_return result);
|
|
|
|
|
|
#endif //COMMS_H
|