This is the same as gpiod_strerror() except that it automatically
uses the last error number by calling gpiod_errno().
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
return error_descr[errnum - __GPIOD_ERRNO_OFFSET];
}
+const char * gpiod_last_strerror(void)
+{
+ return gpiod_strerror(gpiod_errno());
+}
+
int gpiod_simple_get_value(const char *device,
unsigned int offset, bool active_low)
{
*/
const char * gpiod_strerror(int errnum) GPIOD_API;
+/**
+ * @brief Convert the last libgpiod error number to a human-readable string.
+ * @return Pointer to a null-terminated error description.
+ */
+const char * gpiod_last_strerror(void) GPIOD_API;
+
/**
* @}
*