GithubHelp home page GithubHelp logo

espmock's People

Contributors

bxparks avatar hsaturn avatar

Watchers

 avatar  avatar

espmock's Issues

Missing WProgram.h

Moved from bxparks/AUnit#75


Hi Brian

My unit tests are broken due to WProgram.h missing (here)

This files has gone when I have acecpted your PR on EspMock.

I may be wrong as this is the first time I'm using EPOXY_CORE as I wanted my unit tests to pass since this modification.

Best regards


add Usage instructions to README.md

@hsaturn: Please take a look at the updated README.md if you haven't already seen it. And I updated https://github.com/bxparks/EpoxyDuino#LibrariesAndMocks subsection to reference this project.

I wanted to add a Usage section in this README.md with instructions on how to use EspMock, but when I looked at your code, I got confused. There is an Arduino.h file under src/, but that doesn't make sense, since it would cause multiple Arduino.h to appear to the compiler. I think this file can be removed.

I think your intention was to make the EspMock library transparent, once it is included in the ARDUINO_LIBS variable of the EpoxyDuino's Makefile. I think most programs which are designed to work under both ESP32 and ESP8266 have this little bit of header file machinery:

#if defined(ESP8266)
  #include <ESP8266WiFi.h>
#elif defined(ESP32)
  #include <WiFi.h>
#else 
  #error Unsupported platform
#endif
#include <WiFiUdp.h>
...

When compiling such a program under EpoxyDuino, the preprocessing will fail, so I think this needs to be updated to something like this:

#if defined(ESP8266)
  #include <ESP8266WiFi.h>
#elif defined(ESP32)
  #include <WiFi.h>
#elif defined(EPOXY_DUINO)
  #include <ESP8266WiFi.h>
#else 
  #error Unsupported platform
#endif

It is currently not possible to tell EpoxyDuino to "compile the ESP8266 flavor of EpoxyDuino", or "compile the ESP32 flavor of EpoxyDuino". In my mind, EpoxyDuino should be considered to be a separate, independent implementation of the Arduino API. When various networking libraries are added, I think they should be self-contained within the EpoxyDuino environment. Ideally, the names of these mock libraries would not contain "ESP8266" within them, because they are targeting the EpoxyDuino environment.

On the other hand, there are certain ESP8266 libraries that you are mocking out, specifically to make sure that your programs that you wrote for ESP8266 compile properly using a Linux environment. I'm not entirely sure how to organize these libraries so that it makes sense to us, and to potential users of EspMock.

[Edit: fix typos]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.