mirror of git://git.sysmocom.de/ofono
common: Implement ofono_uuid_to_str
This commit is contained in:
parent
dbd7639d25
commit
04634af6fe
|
@ -104,10 +104,14 @@ struct ofono_network_time {
|
|||
int utcoff; /* Offset from UTC in seconds */
|
||||
};
|
||||
|
||||
#define OFONO_SHA1_UUID_LEN 20
|
||||
|
||||
struct ofono_uuid {
|
||||
unsigned char uuid[20];
|
||||
unsigned char uuid[OFONO_SHA1_UUID_LEN];
|
||||
};
|
||||
|
||||
const char *ofono_uuid_to_str(const struct ofono_uuid *uuid);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <ofono/types.h>
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
|
||||
struct error_entry {
|
||||
int error;
|
||||
|
@ -686,3 +687,10 @@ gboolean is_valid_apn(const char *apn)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const char *ofono_uuid_to_str(const struct ofono_uuid *uuid)
|
||||
{
|
||||
static char buf[OFONO_SHA1_UUID_LEN * 2 + 1];
|
||||
|
||||
return encode_hex_own_buf(uuid->uuid, OFONO_SHA1_UUID_LEN, 0, buf);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue