Browse Source

Added some fixes for c++ compatebility

master
Sebastian 5 years ago
parent
commit
dfb4721183
  1. 4
      software/linux/libsss7.c
  2. 11
      software/linux/libsss7.h

4
software/linux/libsss7.c

@ -99,7 +99,7 @@ void *eventloop(void *arg) {
// Send a byte, if there is one
if(uart_tx_state == TX_HAS_BYTE) {
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;
}
@ -107,7 +107,7 @@ void *eventloop(void *arg) {
// Or read a byte send by somebody else.
res = read(serial_fd, &uart_rx_byte, 1);
if(res == 1) {
printf("Read %x\n", uart_rx_byte);
//printf("Read %x\n", uart_rx_byte);
// Lock mutexes and call rx handler
pthread_mutex_lock(&state_mutex);
pthread_mutex_lock(&rx_buffer_mutex);

11
software/linux/libsss7.h

@ -6,6 +6,9 @@
#define LIBSSS7_PAYLOAD_SIZE 16
// See libsss7.c for more detailed descriptions
#ifdef __cplusplus
extern "C" {
#endif
// Setup function
int libsss7_start(char *serialport);
@ -26,6 +29,12 @@ int libsss7_has_received(void);
void libsss7_get_received(uint8_t *msg);
// Teardown function
void libsss7_stop();
void libsss7_stop(void);
#ifdef __cplusplus
}
#endif
#endif

Loading…
Cancel
Save