The ArduinoBLE library dramatically increases program size and for OTA purposes I am trying to keep my program as compact as possible.
Compiling an empty sketch with #include <ArduinoBLE.h> results in using 19% of program storage space. Looking at library files one can see it is fairly large, at least compared with other common libraries, and that it offers tons of functionality and methods.
I wonder if there's a way to minimize the space the library uses. maybe by reducing available functionality and keeping only what's needed, but without modifying the library itself which for me is the least prefered path, I want it to keep getting updates and stay standard.
I assume this wasn't clear so let me elaborate. I am not asking for a general solution, a smaller library by whoever wrote or maintain it, I am asking how I can reduce the space by for my needs, a subset of functionality based on what is needed for my program.
Download the library, cut out the stuff you don't need, test the rest and if it all works, you are done.
The library can go in the folder with your code (no need to #include .cpp files, they are automatically included). That way it can't easily be confused with other versions.
Due to its advanced structure, this particular library requires recursive compilation, meaning it must be placed in the src subfolder of the sketch, rather than being placed in the sketch root folder as is possible for libraries with a flat layout.
I was more thinking of a solution involving Defined Constants or some other mechanism that tells the compiler to use only what is needed for a particular program but maybe nothing like this exists and the simple answer is that it is not possible.