I am using UIPEthernet to get an Arduino Nano to drive an ENC28J60 Ethernet Shield for a UDP-based application. I'm customizing a number of its #define
parameters to change default settings to save space, but I'm not sure I'm doing it correctly. It's clearly designed to facilitate per-sketch customization, but things aren't quite working for me, and I can't tell if it's me doing it wrong, or if the customization doesn't quite do what I'm expecting.
Specifically, the comments at the top of utilities/uip-conf.h
say:
uIP has a number of configuration options that can be overridden for each project. These are kept in a project-specific uip-conf.h file and all configuration names have the prefix UIP_CONF.
So that sounds great - I've copied uip-conf.h
into my sketch (into the top directory next to my other sources), adjusted it appropriately, and ... nothing changes.
Now, I'm #including <UIPEthernet.h>
into my source files, and everything compiles using the Arduino IDE (v1.8.10). Looking in the library, I can see <UIPEthernet.h>
includes <utilities/uipopt.h>
, which in turn includes "uip-conf.h"
(note the quotes). So I think it's intended to be picking up my local one. But it doesn't - it uses the original one from the library.
My understanding of #include "example.h"
is that it looks for example.h
relative to the current file location, (ie <utilities/uipopt.h>
, so utilities/), so I'm actually seeing correct inclusion behaviour and now I don't see how this customization approach could ever work!
I tried adding the #include "uip-conf.h"
to my own sources, and that sort of works for my sources, but of course doesn't affect the library .cpp
files themselves which still see the original version.
I could probably drag the entire lib into my sketch and fix up the includes, but that seems like the wrong answer. It's extensively designed to be customizable. Do you know what steps need to be taken to do it please? (Or a pointer to some docs would be fine!) Thanks!