I am working on a set of libraries for GPS work. I plan on splitting my code into two libraries. One, GPS_Driver
, handles watching serial wires for incoming text streams, storing the results, and providing the stored sentences to clients (such as the parser). The other, NMEA_Parser
, is given a text buffer from somewhere (such as, but not necessarily, the driver) and parses out the relevant information and permits clients (such as the user, or other routines) to copy the information out.
I am developing the driver and parser library separately, since they are independent of each other, and combining them into a third master library as submodules of it. As such, in the third library (a single GPS library, capable of autonomously harvesting serial input and providing parsed information), the driver and parser are in its lib/ directory.
As far as I know, for other people to consume my primary GPS library, they will simply clone it into their lib/ directory, and be able to access its header via #include <GPS.hpp>
. However, the GPS code and header files will themselves reference #include <GPS_Driver.hpp>
and #include <NMEA_Parser.hpp>
but these libraries won’t be in $PROJECT/lib/GPS_Driver/src/GPS_Driver.hpp, they’ll be in $PROJECT/lib/GPS/lib/GPS_Driver/src/GPS_Driver.hpp, and the same for the NMEA parser.
Will PlatformIO be able to handle libraries inside libraries like this, or will I need to package the master GPS library so that it has the structure GPS/src/{GPS,GPS_Driver,NMEA_Parser}.{c,h}pp so that, when cloned into another project, the end result is $PROJECT/lib/GPS/src/{GPS,GPS_Driver,NMEA_Parser}.{c,h}pp
all next to each other and ready for PlatformIO to process?