Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
roncapat committed Nov 14, 2021
1 parent fa8cc12 commit 540bc28
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ extern "C"
#endif // ifdef __cplusplus

#include <poll.h>
#include <sys/select.h>

typedef struct uxrSerialPlatform
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ bool uxr_close_tcp_platform(
* FreeRTOS_closesocket() always returns 0. */
(void) FreeRTOS_closesocket(platform->fd);

if (NULL != platform->poll_fd)
{
(void) FreeRTOS_DeleteSocketSet(platform->poll_fd);
}

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ bool uxr_close_udp_platform(
/* FreeRTOS_closesocket() always returns 0. */
(void) FreeRTOS_closesocket(platform->fd);

if (NULL != platform->poll_fd)
{
(void) FreeRTOS_DeleteSocketSet(platform->poll_fd);
}

return true;
}

Expand Down
8 changes: 1 addition & 7 deletions src/c/profile/transport/serial/serial_transport_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ size_t uxr_read_serial_data_platform(
size_t rv = 0;
struct uxrSerialPlatform* platform = (struct uxrSerialPlatform*) args;

fd_set fds;
FD_ZERO(&fds);
FD_SET(platform->poll_fd.fd, &fds);
struct timeval t_out = { 0, timeout*1000};
int poll_rv = select(platform->poll_fd.fd+1, &fds, NULL, NULL, &t_out);

//int poll_rv = poll(&platform->poll_fd, 1, timeout);
int poll_rv = poll(&platform->poll_fd, 1, timeout);
if (0 < poll_rv)
{
ssize_t bytes_read = read(platform->poll_fd.fd, buf, len);
Expand Down

0 comments on commit 540bc28

Please sign in to comment.