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

how to handle arduino core libraries from other platforms? #38

Open
peterus opened this issue Feb 1, 2023 · 1 comment
Open

how to handle arduino core libraries from other platforms? #38

peterus opened this issue Feb 1, 2023 · 1 comment

Comments

@peterus
Copy link

peterus commented Feb 1, 2023

I am working a lot on ESP32 mcu's. This arduino core's have some libraries which are used a lot (WiFi, UDP, Ethernet, etc.).

  1. Do somebody know of a ESP32 Arduino Fake core/library?
  2. Is it possible to integrate this kind of libraries here? but I think this will make this project not really better for other core's (like AVR etc.)

how do you handle situations like this?

@hansmbakker
Copy link

I tried copying the public part of the relevant header files to a separate folder, including their dependencies.

I gave them a different name, like HTTPCLient_Mock.h, WiFiClient.h. I removed the #include for the Client class in WiFiClient.h and replaced it by class Client;

In my code I conditionally include the real or mocking headers:

#ifdef UNIT_TEST
#include "HTTPClient_Mock.h"
#else
#include <HTTPClient.h>
#endif

It feels like a lot of tinkering to get it right though. More guidance from the maintainer would be great here.

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

2 participants