mirror of git://git.sysmocom.de/ofono
gisi: Add utility for error strings
This commit is contained in:
parent
0f0532eb6f
commit
1f238413cb
|
@ -24,6 +24,7 @@
|
|||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <glib.h>
|
||||
|
@ -45,6 +46,11 @@ int g_isi_msg_error(const GIsiMessage *msg)
|
|||
return msg ? -msg->error : -EINVAL;
|
||||
}
|
||||
|
||||
const char *g_isi_msg_strerror(const GIsiMessage *msg)
|
||||
{
|
||||
return strerror(-g_isi_msg_error(msg));
|
||||
}
|
||||
|
||||
uint8_t g_isi_msg_resource(const GIsiMessage *msg)
|
||||
{
|
||||
return msg && msg->addr ? msg->addr->spn_resource : 0;
|
||||
|
|
|
@ -50,6 +50,7 @@ typedef struct _GIsiMessage GIsiMessage;
|
|||
int g_isi_msg_version_major(const GIsiMessage *msg);
|
||||
int g_isi_msg_version_minor(const GIsiMessage *msg);
|
||||
int g_isi_msg_error(const GIsiMessage *msg);
|
||||
const char *g_isi_msg_strerror(const GIsiMessage *msg);
|
||||
uint8_t g_isi_msg_resource(const GIsiMessage *msg);
|
||||
uint16_t g_isi_msg_object(const GIsiMessage *msg);
|
||||
|
||||
|
|
Loading…
Reference in New Issue