Skip to content

refactor setup function #290

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

Merged
merged 2 commits into from
Apr 24, 2016

Conversation

soundanalogous
Copy link
Member

  • split wifi init and firmata init into separate functions
  • add hostConnectionCallback

- split wifi init and firmata init into separate functions
- add hostConnectionCallback
{
switch (state) {
case HOST_CONNECTION_CONNECTED:
DEBUG_PRINTLN( "TCP connection established" );
Copy link
Member Author

@soundanalogous soundanalogous Apr 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO:

@jnsbyr
Copy link
Contributor

jnsbyr commented Apr 23, 2016

A change to the systemResetCallback() is required for the ESP8266, at least when SERIAL_DEBUG is enabled. A possible solution is described here.

@jnsbyr
Copy link
Contributor

jnsbyr commented Apr 24, 2016

To prepare the usage of the hostConnectionCallback for the other host connection types where the transport layer is not connection oriented (serial, BLE serial) the watchog timer must be placed in a method that is periodically called (e.g. maintain). A possible solution is to insert a class inheritance level between Stream and all currently used connection type specific stream implementations, maybe calling it FirmataSteam. This class could handle

  • connect/reconnect distinction
  • watchdog mode (disabled, send only, send and receive)
  • watchdog sequence, telegram transmission and receive telegram monitoring
  • calling the hostConnectionCallback for non connection oriented streams
  • closing the connection oriented streams on watchdog timeout

- use generic names for init functions
- add clarifications to comments
@soundanalogous
Copy link
Member Author

Going to merge this and defer any additional changes regarding hostConnectionCallback to a future PR after the protocol definitions for watchdog and connect/reconnect have been finalized.

@soundanalogous soundanalogous merged commit 562e060 into firmata:wifi-client Apr 24, 2016
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