Skip to content

Commit

Permalink
ROS2 TCP: Improve fix comments
Browse files Browse the repository at this point in the history
review feedback
  • Loading branch information
nhjschulz committed Nov 3, 2024
1 parent 839938f commit eaf8b6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/APPTurtle/src/Transports/CustomRosTransportTcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ size_t CustomRosTransportTcp::read(uint8_t* buffer, size_t size, int timeout, ui
{
bool loop = true;

/**
/*
* Run receive state machine.
* The read function relationships are:
*
Expand All @@ -159,9 +159,10 @@ size_t CustomRosTransportTcp::read(uint8_t* buffer, size_t size, int timeout, ui

if (InputState::INPUT_STATE_MAX > m_inputState)
{
ReadFunc stateReadFunc = m_readFunction[m_inputState]; /**< Get state dependend input reader. */
/* Get state dependend input reader function. */
ReadFunc stateReadFunc = m_readFunction[m_inputState];

/* Read state dependend message portion. */
/* Read message portion based on reveiver state. */
loop = (this->*stateReadFunc)(timeout, errorCode);
}
else
Expand Down
2 changes: 1 addition & 1 deletion lib/APPTurtle/src/Transports/CustomRosTransportTcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class CustomRosTransportTcp : public CustomRosTransportBase
* @param[in] timeout Read timout in milliseconds.
* @param[out] errorCode Read error code if != 0
*
* return true if state machine shall reloop.
* @return true if state machine shall reloop.
*/
typedef bool (CustomRosTransportTcp::*ReadFunc)(int timeout, uint8_t* errorCode);

Expand Down
3 changes: 3 additions & 0 deletions lib/WiFiNative/src/WifiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ uint8_t WiFiClient::connect(const IPAddress& addr, uint16_t port)

if (0U != connected())
{
/* Connect is called on an already connected client.
* Handle it as re-connect by closing the former socket connection.
*/
stop();
}

Expand Down

0 comments on commit eaf8b6f

Please sign in to comment.