librpipErrorGetSeverity

uint32_t librpipErrorGetSeverity(void);

Description

This function returns the error severity set by a previous function.

Parameters

None.

Returns

One of the following constant values:

  • LIBRPIP_ERROR_MSG_INFO
  • LIBRPIP_ERROR_MSG_WARNING
  • LIBRPIP_ERROR_MSG_ERROR

Example

Attempt to toggle an invalid GPIO pin and get the resultant severity.

char desc[200];
if(!librpipGpioPinToggle(32)) {
        switch(librpipErrorGetSeverity()) {
        case LIBRPIP_ERROR_MSG_ERROR:
                printf("Ouch - an error!");
                break;
        case LIBRPIP_ERROR_MSG_WARNING:
                printf("Hmmm - a warning.");
                break;
        case LIBRPIP_ERROR_MSG_INFO:
                printf("Meh - some info.");
                break;
        }
}

Available Since

API version 1.1