Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

WHAT IS "ret_code_t" ??????

HI... I'm in the middle of understanding code line by line...I've taken classes of C/C++ for an year, but BLE programming by myself is so difficult ㅠㅠ 
I have a very simple question that I can't find out!!!!

WHAT IS " ret_code_t"????
I can find it in many of the codes.. but can't find out what that actaully is. 
I'm worried if it's a really easy question like "what is int" but I had no choice...
Thanks!(Sobs)

  • What IDE are you using?

    Any decent IDE will have some way that allows you to select a name - such as ret_code_t - and 'Go To Definition'

    eg, in Segger Embedded Studio (SES):

    As the name suggests, this will take you to where that symbol is defined.

    In this case, it is in sdk_errors.h:

    /**
     * @brief API Result.
     *
     * @details Indicates success or failure of an API procedure. In case of failure, a comprehensive
     *          error code indicating cause or reason for failure is provided.
     *
     *          Though called an API result, it could used in Asynchronous notifications callback along
     *          with asynchronous callback as event result. This mechanism is employed when an event
     *          marks the end of procedure initiated using API. API result, in this case, will only be
     *          an indicative of whether the procedure has been requested successfully.
     */
    typedef uint32_t ret_code_t;

    Note that a descriptive comment is provided.

    In fact, if you just hover your mouse over the symbol, SES - like many other IDEs - will pop up the definition:

    but then you don't get to see the documentation.

    (some other IDEs do include documentation here)

    #CodeBrowsing #GoToDefinition

  • I'm using SEGGER and also using visual studio to see the main.c files.
    Thanks! Great help!! Hope you have a great day:) 

Related