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

Selected network interface should provide builder for network client #51

Closed
klew opened this issue May 24, 2023 · 1 comment
Closed

Comments

@klew
Copy link
Member

klew commented May 24, 2023

Currently network client is generated based on selected HW type (for Arduino Mega, ESP8266/ESP32), however some network interfaces (like W5500) connected to ESP32 is using standard Ethernet lib in Arduino, which requires EthernetClient classes and not WiFiClient.

Network interface should provide interface to obtain proper Network::Client implementation.

@klew
Copy link
Member Author

klew commented Mar 5, 2024

Supla SRPC layer will now build "network client" instance based on used Supla::Network type (class for handling Wi-Fi, or Ethernet, etc.)
Client build is done by "main" network interface. Currently multiple network interfaces can be added. So "main" will be first enabled network interface. Network interfaces are checked based on order of class instance creation.
So in order to build client based on custom network interface, you'll have to override following method:

  virtual Supla::Client *createClient();

It should return pointer to Supla::Client instance implemented on top of required transport client.

Completed in 4f0adf4

@klew klew closed this as completed Mar 5, 2024
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

No branches or pull requests

1 participant