Many functions have largely identical code and even worse, identical strings.
See for example this: https://github.com/H3wastooshort/GSMSim/blob/76da58a0c74fd5ce6e5e3692303a7a767dd6e5c5/src/GSMSimHTTP.cpp#L42
Using enums instead of strings for return codes would be better because
a) it would be easier to code error checks (no comparing strings) and
b) it would save valuable space in flash
You could one std::map (not supported in plain arduino) or errorToString function (just a switch-case with all codes and corresponding strings) to convert error-codes back into strings if needed. I think there is even a way to make enums printable using Arduino's Printable class.
Many functions have largely identical code and even worse, identical strings.
See for example this: https://github.com/H3wastooshort/GSMSim/blob/76da58a0c74fd5ce6e5e3692303a7a767dd6e5c5/src/GSMSimHTTP.cpp#L42
Using enums instead of strings for return codes would be better because
a) it would be easier to code error checks (no comparing strings) and
b) it would save valuable space in flash
You could one std::map (not supported in plain arduino) or errorToString function (just a switch-case with all codes and corresponding strings) to convert error-codes back into strings if needed. I think there is even a way to make enums printable using Arduino's
Printableclass.