-
Notifications
You must be signed in to change notification settings - Fork 16
Description
This library has significant overlap with our existing ping-cpp repo. It would be best if we can avoid the redundant code writing and double-tracking of problems by making this library inherit from/depend on ping-cpp. This has been the plan for a while, but making an issue to formally track it.
The Arduino library-registry doesn't support submodules, so the best approach (to me) seems to be making ping-cpp's deployment branch into its own Arduino library (e.g. bluerobotics-ping-cpp), and then using the depends tag in library.properties of ping-arduino so it auto-installs bluerobotics-ping-cpp. Would require making tags of ping-cpp's deployment, but that shouldn't be too much overhead.
From what I can tell of the ping-cpp source, an implementation would require creating
hal/time/arduino/ping-time.cppwith a classPingTimeper the spechal/link/arduino/ping-port.cppwith a classPingPortper the speclibrary.propertiesinping-cpp'sdeploymentbranch, per the Arduino spec- revised/corrected examples in this repo to make use of the slightly different
#includes and naming
I'm unsure whether it's possible to ignore certain files in Arduino library compilation, but if not we may need to make a duplicate deployment branch specifically for Arduino, without the desktop components (and possibly without the CMakeLists.txt files).
An alternative approach would be to use git subtree, in which case the same files still need to be created, but the Arduino component could be managed directly in ping-arduino instead of in ping-cpp, and only one library would be required. That simplifies the initial setup at the cost of getting updates from and pushing updates to ping-cpp becoming messier and more complicated. I expect the wrapper and base library approach described above would be cleaner and easier to maintain long term.