Added some fixes for c++ compatebility
This commit is contained in:
parent
ff507c6ef7
commit
dfb4721183
|
@ -99,7 +99,7 @@ void *eventloop(void *arg) {
|
||||||
// Send a byte, if there is one
|
// Send a byte, if there is one
|
||||||
if(uart_tx_state == TX_HAS_BYTE) {
|
if(uart_tx_state == TX_HAS_BYTE) {
|
||||||
write(serial_fd, &uart_tx_byte, 1);
|
write(serial_fd, &uart_tx_byte, 1);
|
||||||
printf("Send %x\n", uart_tx_byte);
|
//printf("Send %x\n", uart_tx_byte);
|
||||||
uart_tx_state = TX_COMPLETE;
|
uart_tx_state = TX_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ void *eventloop(void *arg) {
|
||||||
// Or read a byte send by somebody else.
|
// Or read a byte send by somebody else.
|
||||||
res = read(serial_fd, &uart_rx_byte, 1);
|
res = read(serial_fd, &uart_rx_byte, 1);
|
||||||
if(res == 1) {
|
if(res == 1) {
|
||||||
printf("Read %x\n", uart_rx_byte);
|
//printf("Read %x\n", uart_rx_byte);
|
||||||
// Lock mutexes and call rx handler
|
// Lock mutexes and call rx handler
|
||||||
pthread_mutex_lock(&state_mutex);
|
pthread_mutex_lock(&state_mutex);
|
||||||
pthread_mutex_lock(&rx_buffer_mutex);
|
pthread_mutex_lock(&rx_buffer_mutex);
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
#define LIBSSS7_PAYLOAD_SIZE 16
|
#define LIBSSS7_PAYLOAD_SIZE 16
|
||||||
|
|
||||||
// See libsss7.c for more detailed descriptions
|
// See libsss7.c for more detailed descriptions
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
// Setup function
|
// Setup function
|
||||||
int libsss7_start(char *serialport);
|
int libsss7_start(char *serialport);
|
||||||
|
@ -26,6 +29,12 @@ int libsss7_has_received(void);
|
||||||
void libsss7_get_received(uint8_t *msg);
|
void libsss7_get_received(uint8_t *msg);
|
||||||
|
|
||||||
// Teardown function
|
// Teardown function
|
||||||
void libsss7_stop();
|
void libsss7_stop(void);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue