Writing a library - returning a char array

Here are two options:

  1. Make it public
  2. Rewrite your getter function like this:
inline size_t getManufacturer(uint8_t *dst_buffer, size_t buffer_length) {
  return strlcpy(dst_buffer, manufacturer, buffer_length);
}

For option#2 you have to have dst_buffer ready:

uint8_t buff[32];
Lens->getManufacturer(buff, sizeof(buff));

Other options are:

return a strdup() of the manufacturer. In this case you have to free() the returned value after use:

inline uint8_t *getManufacturer() {
  return strdup(manufacturer);
}


...
...


uint8_t *buf;
buf = Lens->getManufacturer();
...
...
free(buf);