Skip to content

Conversation

@felixdoerre
Copy link

This is part of #5. For rationale see that issue.

@usedbytes
Copy link
Owner

Code looks good - would you mind adding a slightly more descriptive commit message though? More-or-less what you wrote on #5 would be useful context for people reading the git log

Before this change, picowota would ignore data on the tcp connection if it is
sent immediately after the connection was opened.

The reason why that happens happens:
- Client connects
- tcp_comm_client_init is called
- the gpio led turns on (tcp_comm.c#L461)
- While communicating with the cyw43 to enable the led, network packages are
  discovered that need to be processed, incl. the initial opcode.
- the recv-callback is not set yet, so the callback invocation is skipped
- tcp_comm_client_init continues to set up callbacks, the initial data is lost.

To resolve this, the code that turns the LED on and off is dispatched into the
mainloop, so it is never called from within a networking callback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants