Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net dev #79

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Components/Network/Network.scvd
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@
<objects>
<object name="Network Component">
<!-- Network library variant -->
<var name="debug" type="int32_t" value="__Symbol_exists(&quot;net_dbg_proc&quot;) || __Symbol_exists(&quot;net_evr_init&quot;)"/>
<var name="debug" type="int32_t" value="__Symbol_exists(&quot;net_debug_proc&quot;) || __Symbol_exists(&quot;net_evr_init&quot;)"/>
<var name="dual_stack" type="int32_t" value="__Symbol_exists(&quot;net_ip6_init&quot;)"/>
<var name="net_lib" type="NetLib" value="dual_stack"/>
<read name="net_ver" type="NetVal" symbol="net_lib_version" const="1"/>
Expand Down
2 changes: 1 addition & 1 deletion Components/Network/Source/net_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ typedef struct net_udp_info {

/// TCP Socket info
typedef struct net_tcp_info {
netTCP_State State; ///< Socket state
uint8_t State; ///< Socket state
uint8_t Type; ///< Socket type
uint8_t Flags; ///< State flags
uint16_t LocPort; ///< Local TCP port
Expand Down
14 changes: 7 additions & 7 deletions Components/Network/Source/net_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ netStatus net_tcp_listen (int32_t socket, uint16_t port) {
return (netInvalidParameter);
}
tcp_s = &tcp->Scb[socket-1];
switch ((int32_t)tcp_s->State) {
switch (tcp_s->State) {
case netTCP_StateLISTEN:
case netTCP_StateCLOSED:
case netTCP_StateTIME_WAIT:
Expand Down Expand Up @@ -299,7 +299,7 @@ netStatus net_tcp_connect (int32_t socket, const __ADDR *addr, uint16_t local_po
DEBUGF (TCP," IpAddr [%s], port %d\n",net_addr_ntoa(addr),addr->port);
EvrNetTCP_ShowNetAddress (addr);
tcp_s = &tcp->Scb[socket-1];
switch ((int32_t)tcp_s->State) {
switch (tcp_s->State) {
case netTCP_StateLISTEN:
/* Listening socket, restricted local_port values */
if (local_port == 0 || local_port == tcp_s->LocPort) {
Expand Down Expand Up @@ -525,7 +525,7 @@ netStatus net_tcp_close (int32_t socket) {
}

tcp_s = &tcp->Scb[socket-1];
switch ((int32_t)tcp_s->State) {
switch (tcp_s->State) {
case netTCP_StateCLOSED:
break;

Expand Down Expand Up @@ -608,7 +608,7 @@ netStatus net_tcp_abort (int32_t socket) {
}

tcp_s = &tcp->Scb[socket-1];
switch ((int32_t)tcp_s->State) {
switch (tcp_s->State) {
case netTCP_StateCLOSED:
break;

Expand Down Expand Up @@ -1053,7 +1053,7 @@ void net_tcp_socket_run (void) {
}

tcp_s = &tcp->Scb[socket-1];
switch ((int32_t)tcp_s->State) {
switch (tcp_s->State) {
case netTCP_StateUNUSED:
case netTCP_StateCLOSED:
case netTCP_StateLISTEN:
Expand Down Expand Up @@ -1375,7 +1375,7 @@ void net_tcp_process (NET_IF_CFG *net_if, NET_FRAME *frame, uint8_t ip_ver) {
acknr = get_u32(&tcp_hdr->AckNr);

/* Process the packet on TCP state machine */
switch ((int32_t)tcp_s->State) {
switch (tcp_s->State) {
case netTCP_StateESTABLISHED:
/* Check for RESET frame */
if (tcp_hdr->Flags & TCP_FLAG_RST) {
Expand Down Expand Up @@ -2738,7 +2738,7 @@ static NET_TCP_INFO *tcp_map_socket (NET_IF_CFG *net_if, NET_FRAME *frame,
static void tcp_transit (NET_TCP_INFO *tcp_s, netTCP_State state) {
tcp_s->State = state;
/* In some states we don't want to wait for many retries */
switch ((int32_t)tcp_s->State) {
switch (tcp_s->State) {
case netTCP_StateTIME_WAIT:
tcp_s->RetryTimer = SYS_TICK_T200MS;
tcp_s->Retries = 0;
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Doxygen/Network/src/rl_net.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ void Resolver_Thread (void *arg) {
else if (host->h_addrtype == AF_INET) {
for (j = 0; host->h_addr_list[j]; j++) {
addr = (IN_ADDR *)host->h_addr_list[j];
printf("IP Address: %s\n", inet_ntoa(addr->sin_addr));
printf("IP Address: %s\n", inet_ntoa(addr->s_addr));
}
}
osDelay (300);
Expand Down
Loading