When i log an error on the Pebble like this:
static void message_dropped(AppMessageResult reason, void *context) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "Message dropped. Reason: %d", reason);
}
i just get the int value of the error message. Is there an easy way to log the text of the enum? Like:
static void message_dropped(AppMessageResult reason, void *context) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "Message dropped. Reason: %fancy", reason);
}
// Would return "APP_MSG_BUFFER_OVERFLOW"
There is no API function to do that. You can use this function for the
AppMessageResult
enum:I used the
pebble analyze-size
command to measure the memory impact. This function will cost you an extra 228 bytes of your program memory. It is probably worth it for most developers ;)And this is how you would use the above function, for example in the dropped message handler: