DiagnosticsHelper::getValue() - need help finding values and their meanings

I am having trouble finding the following statement values or their meanings. Can somebody point me in the right direction? Thanks for your help.

errorCode = DiagnosticsHelper::getValue(DIAG_ID_CLOUD_CONNECTION_ERROR_CODE);
// error code = 0 (no error)
// = 10 (???)
// = 17 (???)

For the above, I get a value of “10” or “17” sometimes from a Xenon device in my network. I gather that “10” might mean “Keys Error in UDP” but not sure. When “17” shows up I need to reset the Xenon device. Curious about the above code meanings and if there may be other codes I have not seen.

Next, (what is “x”?)

status = DiagnosticsHelper::getValue(DIAG_ID_CLOUD_CONNECTION_STATUS);
// status = 2 (connected)
// = x (connecting)
// = y (???)
// = z (???)

Last, there may be no additional codes but wanted to verify that:

disconnectionReason = DiagnosticsHelper::getValue(DIAG_ID_CLOUD_DISCONNECTION_REASON);
// disconnectionReason = 0 (none)
// = 1 (error)
// = x (???)
// = y (???)
// = z (???)

You may want to have a look here

In that repo you can always search for the info the docs may be lacking of :wink:

e.g. connection status can then be found here

disconnect reason can be found here

For DIAG_ID_CLOUD_CONNECTION_ERROR_CODE it’s not that straight forward as these seem to be only integers and not a strongly typed enum.

Thanks for your response. I was able to search and find some answers using your advice. In regards to:

I am assuming the above DIAG_ID_CLOUD_CONNECTION_ERROR_CODE above is returned by the code snippet below. So, my information diagnostic info might be:

error code =
0 (NO_ERROR)
10 (MESSAGE_TIMEOUT)
17 ( IO_ERROR_GENERIC_ESTABLISH)

Am I close? What do you think? Here is what I found:

device-os/communication/inc/protocol/defs.h

enum ProtocolError
{
    /* 00 */ NO_ERROR,
    /* 01 */ PING_TIMEOUT,
    /* 02 */ IO_ERROR,  // too generic, discontinue using this.  Perfer/add a specific one below
    /* 03 */ INVALID_STATE,
    /* 04 */ INSUFFICIENT_STORAGE,
    /* 05 */ MALFORMED_MESSAGE,
    /* 06 */ DECRYPTION_ERROR,
    /* 07 */ ENCRYPTION_ERROR,
    /* 08 */ AUTHENTICATION_ERROR,
    /* 09 */ BANDWIDTH_EXCEEDED,
    /* 10 */ MESSAGE_TIMEOUT,
    /* 11 */ MISSING_MESSAGE_ID,
    /* 12 */ MESSAGE_RESET,
    /* 13 */ SESSION_RESUMED,
    /* 14 */ IO_ERROR_FORWARD_MESSAGE_CHANNEL,
    /* 15 */ IO_ERROR_SET_DATA_MAX_EXCEEDED,
    /* 16 */ IO_ERROR_PARSING_SERVER_PUBLIC_KEY,
    /* 17 */ IO_ERROR_GENERIC_ESTABLISH,
    /* 18 */ IO_ERROR_GENERIC_RECEIVE,
    /* 19 */ IO_ERROR_GENERIC_SEND,
    /* 20 */ IO_ERROR_GENERIC_MBEDTLS_SSL_WRITE,
    /* 21 */ IO_ERROR_DISCARD_SESSION,
    /* 21 */ IO_ERROR_LIGHTSSL_BLOCKING_SEND,
    /* 22 */ IO_ERROR_LIGHTSSL_BLOCKING_RECEIVE,
    /* 23 */ IO_ERROR_LIGHTSSL_RECEIVE,
    /* 24 */ IO_ERROR_LIGHTSSL_HANDSHAKE_NONCE,
    /* 25 */ IO_ERROR_LIGHTSSL_HANDSHAKE_RECV_KEY,
    /* 26 */ NOT_IMPLEMENTED,
    /* 27 */ MISSING_REQUEST_TOKEN,
    /* 28 */ NOT_FOUND,
    /* 29 */ NO_MEMORY,

    /*
     * NOTE: when adding more ProtocolError codes, be sure to update toSystemError() in protocol_defs.cpp
     */
    UNKNOWN = 0x7FFFF
};


// Converts protocol error to system error code
system_error_t toSystemError(ProtocolError error);