Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-rabault committed Aug 29, 2023
1 parent f76ce13 commit 044c543
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions network/serial_network/HAL/NATIVE/serial_network_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,26 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size)
}
#else
// Set the baudrate
struct termios2
{
tcflag_t c_iflag;
tcflag_t c_oflag;
tcflag_t c_cflag;
tcflag_t c_lflag;
cc_t c_line;
cc_t c_cc[19];
speed_t c_ispeed;
speed_t c_ospeed;
};

#define TCSETS2 0x802C542A
// Get current serial port settings
struct termios2 serial_settings;
if (ioctl(serial_port, TCGETS2, &serial_settings) != 0)
{
perror("Error getting current settings");
close(serial_port);
return 1;
LUOS_ASSERT(0);
}

// Set new baud rate
Expand All @@ -300,7 +313,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size)
{
perror("Error setting baud rate");
close(serial_port);
return 1;
LUOS_ASSERT(0);
}
#endif
#endif
Expand Down

0 comments on commit 044c543

Please sign in to comment.