DigitiserConfig digitiserConfig = DigitiserConfig_init_zero;
pb_istream_t stream = pb_istream_from_buffer((uint8_t *)buffer, actual_size);
if (!pb_decode(&stream, DigitiserConfig_fields, &digitiserConfig)) {
printf("Decoding failed: %s\n", PB_GET_ERROR(&stream));
return FX_FILE_CORRUPT; // Return error if decoding fails
}
Brilliant, that's just what I was after. Thank you!
--
You received this message because you are subscribed to the Google Groups "nanopb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nanopb+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nanopb/27f5c1e1-b9bb-4b41-8457-c0fbd10c2a6fn%40googlegroups.com.