How to obtain length of binary COMPONENT_EMBED_FILES
Posted: Tue Feb 26, 2019 8:04 am
What is the simplest way to obtain the length in bytes of an embedded binary file when using https://docs.espressif.com/projects/esp ... inary-data?
Is an attribute available which returns the length or do I have to compute it myself?
This is the way I do it right now:
Is an attribute available which returns the length or do I have to compute it myself?
This is the way I do it right now:
Code: Select all
COMPONENT_EMBED_FILES := kafka_status_ok.message
Code: Select all
extern const uint8_t kafka_status_ok_message_start[] asm("_binary_kafka_status_ok_message_start");
extern const uint8_t kafka_status_ok_message_end[] asm("_binary_kafka_status_ok_message_end");
int len_buffer = sizeof(uint8_t) * (kafka_status_ok_message_end - kafka_status_ok_message_start);