diff options
-rw-r--r-- | libmm-common/mm-common-helpers.c | 94 | ||||
-rw-r--r-- | libmm-common/mm-common-helpers.h | 7 | ||||
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.c | 5 | ||||
-rw-r--r-- | plugins/icera/mm-broadband-bearer-icera.c | 1 | ||||
-rw-r--r-- | plugins/iridium/mm-bearer-iridium.c | 1 | ||||
-rw-r--r-- | plugins/mbm/mm-broadband-bearer-mbm.c | 1 | ||||
-rw-r--r-- | plugins/novatel/mm-broadband-bearer-novatel-lte.c | 1 | ||||
-rw-r--r-- | plugins/option/mm-broadband-bearer-hso.c | 1 | ||||
-rw-r--r-- | plugins/sierra/mm-broadband-bearer-sierra.c | 1 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/mm-bearer-list.c | 1 | ||||
-rw-r--r-- | src/mm-bearer-qmi.c | 1 | ||||
-rw-r--r-- | src/mm-bearer.c | 1 | ||||
-rw-r--r-- | src/mm-broadband-bearer.c | 1 | ||||
-rw-r--r-- | src/mm-broadband-modem.c | 3 | ||||
-rw-r--r-- | src/mm-charsets.c | 13 | ||||
-rw-r--r-- | src/mm-device.c | 11 | ||||
-rw-r--r-- | src/mm-sim.c | 5 | ||||
-rw-r--r-- | src/mm-sms-list.c | 1 | ||||
-rw-r--r-- | src/mm-sms-part.c | 3 | ||||
-rw-r--r-- | src/mm-sms.c | 3 | ||||
-rw-r--r-- | src/mm-utils.c | 109 | ||||
-rw-r--r-- | src/mm-utils.h | 28 | ||||
-rw-r--r-- | src/tests/test-sms-part.c | 7 |
24 files changed, 124 insertions, 177 deletions
diff --git a/libmm-common/mm-common-helpers.c b/libmm-common/mm-common-helpers.c index b954afee..552881e5 100644 --- a/libmm-common/mm-common-helpers.c +++ b/libmm-common/mm-common-helpers.c @@ -10,6 +10,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * + * Copyright (C) 2010 - 2012 Red Hat, Inc. * Copyright (C) 2011 - 2012 Google, Inc. */ @@ -805,3 +806,96 @@ mm_sms_delivery_state_get_string_extended (guint delivery_state) * value */ return mm_sms_delivery_state_get_string ((MMSmsDeliveryState)delivery_state); } + +/*****************************************************************************/ + +/* From hostap, Copyright (c) 2002-2005, Jouni Malinen <jkmaline@cc.hut.fi> */ + +static gint +hex2num (gchar c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + return -1; +} + +gint +mm_utils_hex2byte (const gchar *hex) +{ + gint a, b; + + a = hex2num (*hex++); + if (a < 0) + return -1; + b = hex2num (*hex++); + if (b < 0) + return -1; + return (a << 4) | b; +} + +gchar * +mm_utils_hexstr2bin (const gchar *hex, gsize *out_len) +{ + const gchar *ipos = hex; + gchar *buf = NULL; + gsize i; + gint a; + gchar *opos; + gsize len; + + len = strlen (hex); + + /* Length must be a multiple of 2 */ + g_return_val_if_fail ((len % 2) == 0, NULL); + + opos = buf = g_malloc0 ((len / 2) + 1); + for (i = 0; i < len; i += 2) { + a = mm_utils_hex2byte (ipos); + if (a < 0) { + g_free (buf); + return NULL; + } + *opos++ = a; + ipos += 2; + } + *out_len = len / 2; + return buf; +} + +/* End from hostap */ + +gchar * +mm_utils_bin2hexstr (const guint8 *bin, gsize len) +{ + GString *ret; + gsize i; + + g_return_val_if_fail (bin != NULL, NULL); + + ret = g_string_sized_new (len * 2 + 1); + for (i = 0; i < len; i++) + g_string_append_printf (ret, "%.2X", bin[i]); + return g_string_free (ret, FALSE); +} + +gboolean +mm_utils_check_for_single_value (guint32 value) +{ + gboolean found = FALSE; + guint32 i; + + for (i = 1; i <= 32; i++) { + if (value & 0x1) { + if (found) + return FALSE; /* More than one bit set */ + found = TRUE; + } + value >>= 1; + } + + return TRUE; +} diff --git a/libmm-common/mm-common-helpers.h b/libmm-common/mm-common-helpers.h index 0bbaf145..3d5657d8 100644 --- a/libmm-common/mm-common-helpers.h +++ b/libmm-common/mm-common-helpers.h @@ -10,6 +10,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * + * Copyright (C) 2010 - 2012 Red Hat, Inc. * Copyright (C) 2011 - 2012 Google, Inc. * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> */ @@ -89,4 +90,10 @@ gchar *mm_get_string_unquoted_from_match_info (GMatchInfo *match_info, const gchar *mm_sms_delivery_state_get_string_extended (guint delivery_state); +gint mm_utils_hex2byte (const gchar *hex); +gchar *mm_utils_hexstr2bin (const gchar *hex, gsize *out_len); +gchar *mm_utils_bin2hexstr (const guint8 *bin, gsize len); + +gboolean mm_utils_check_for_single_value (guint32 value); + #endif /* MM_COMMON_HELPERS_H */ diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index 0f6cc424..685b5f8c 100644 --- a/plugins/huawei/mm-broadband-modem-huawei.c +++ b/plugins/huawei/mm-broadband-modem-huawei.c @@ -26,7 +26,6 @@ #include "ModemManager.h" #include "mm-log.h" #include "mm-errors-types.h" -#include "mm-utils.h" #include "mm-common-helpers.h" #include "mm-modem-helpers.h" #include "mm-base-modem-at.h" @@ -1096,7 +1095,7 @@ encode (MMIfaceModem3gppUssd *self, } packed = gsm_pack (gsm, len, 0, &packed_len); - hex = utils_bin2hexstr (packed, packed_len); + hex = mm_utils_bin2hexstr (packed, packed_len); g_free (packed); g_free (gsm); @@ -1113,7 +1112,7 @@ decode (MMIfaceModem3gppUssd *self, gsize bin_len; guint32 unpacked_len; - bin = utils_hexstr2bin (reply, &bin_len); + bin = mm_utils_hexstr2bin (reply, &bin_len); unpacked = gsm_unpack ((guint8*) bin, (bin_len * 8) / 7, 0, &unpacked_len); /* if the last character in a 7-byte block is padding, then drop it */ if ((bin_len % 7 == 0) && (unpacked[unpacked_len - 1] == 0x0d)) diff --git a/plugins/icera/mm-broadband-bearer-icera.c b/plugins/icera/mm-broadband-bearer-icera.c index 2fd8ee42..2b9ebb35 100644 --- a/plugins/icera/mm-broadband-bearer-icera.c +++ b/plugins/icera/mm-broadband-bearer-icera.c @@ -31,7 +31,6 @@ #include "mm-log.h" #include "mm-modem-helpers.h" #include "mm-error-helpers.h" -#include "mm-utils.h" G_DEFINE_TYPE (MMBroadbandBearerIcera, mm_broadband_bearer_icera, MM_TYPE_BROADBAND_BEARER); diff --git a/plugins/iridium/mm-bearer-iridium.c b/plugins/iridium/mm-bearer-iridium.c index a3c81d6a..5f3c03cb 100644 --- a/plugins/iridium/mm-bearer-iridium.c +++ b/plugins/iridium/mm-bearer-iridium.c @@ -25,7 +25,6 @@ #include "mm-bearer-iridium.h" #include "mm-base-modem-at.h" -#include "mm-utils.h" #include "mm-log.h" /* Allow up to 200s to get a proper IP connection */ diff --git a/plugins/mbm/mm-broadband-bearer-mbm.c b/plugins/mbm/mm-broadband-bearer-mbm.c index 09853202..08c72846 100644 --- a/plugins/mbm/mm-broadband-bearer-mbm.c +++ b/plugins/mbm/mm-broadband-bearer-mbm.c @@ -38,7 +38,6 @@ #include "mm-broadband-bearer-mbm.h" #include "mm-log.h" #include "mm-modem-helpers.h" -#include "mm-utils.h" G_DEFINE_TYPE (MMBroadbandBearerMbm, mm_broadband_bearer_mbm, MM_TYPE_BROADBAND_BEARER); diff --git a/plugins/novatel/mm-broadband-bearer-novatel-lte.c b/plugins/novatel/mm-broadband-bearer-novatel-lte.c index bea017fa..f0208ba8 100644 --- a/plugins/novatel/mm-broadband-bearer-novatel-lte.c +++ b/plugins/novatel/mm-broadband-bearer-novatel-lte.c @@ -30,7 +30,6 @@ #include "mm-broadband-bearer-novatel-lte.h" #include "mm-log.h" #include "mm-modem-helpers.h" -#include "mm-utils.h" #define CONNECTION_CHECK_TIMEOUT_SEC 5 diff --git a/plugins/option/mm-broadband-bearer-hso.c b/plugins/option/mm-broadband-bearer-hso.c index 885082ff..4f1c2509 100644 --- a/plugins/option/mm-broadband-bearer-hso.c +++ b/plugins/option/mm-broadband-bearer-hso.c @@ -31,7 +31,6 @@ #include "mm-broadband-bearer-hso.h" #include "mm-log.h" #include "mm-modem-helpers.h" -#include "mm-utils.h" G_DEFINE_TYPE (MMBroadbandBearerHso, mm_broadband_bearer_hso, MM_TYPE_BROADBAND_BEARER); diff --git a/plugins/sierra/mm-broadband-bearer-sierra.c b/plugins/sierra/mm-broadband-bearer-sierra.c index c8ce9c1c..a28feca7 100644 --- a/plugins/sierra/mm-broadband-bearer-sierra.c +++ b/plugins/sierra/mm-broadband-bearer-sierra.c @@ -30,7 +30,6 @@ #include "mm-broadband-bearer-sierra.h" #include "mm-log.h" #include "mm-modem-helpers.h" -#include "mm-utils.h" G_DEFINE_TYPE (MMBroadbandBearerSierra, mm_broadband_bearer_sierra, MM_TYPE_BROADBAND_BEARER); diff --git a/src/Makefile.am b/src/Makefile.am index c27b8534..768af7dd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,8 +27,6 @@ libmodem_helpers_la_SOURCES = \ mm-modem-helpers.h \ mm-charsets.c \ mm-charsets.h \ - mm-utils.c \ - mm-utils.h \ mm-sms-part.h \ mm-sms-part.c diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c index 3c672f89..d5cb1e9a 100644 --- a/src/mm-bearer-list.c +++ b/src/mm-bearer-list.c @@ -26,7 +26,6 @@ #include <libmm-common.h> #include "mm-bearer-list.h" -#include "mm-utils.h" #include "mm-log.h" G_DEFINE_TYPE (MMBearerList, mm_bearer_list, G_TYPE_OBJECT); diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index b4d7d0c5..3d91ad74 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -25,7 +25,6 @@ #include <libqmi-glib.h> #include "mm-bearer-qmi.h" -#include "mm-utils.h" #include "mm-serial-enums-types.h" #include "mm-log.h" diff --git a/src/mm-bearer.c b/src/mm-bearer.c index 94be3588..9720fc87 100644 --- a/src/mm-bearer.c +++ b/src/mm-bearer.c @@ -32,7 +32,6 @@ #include "mm-bearer.h" #include "mm-base-modem-at.h" #include "mm-base-modem.h" -#include "mm-utils.h" #include "mm-log.h" #include "mm-modem-helpers.h" diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index d884cd0e..fa3ba664 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -30,7 +30,6 @@ #include "mm-iface-modem-3gpp.h" #include "mm-iface-modem-cdma.h" #include "mm-base-modem-at.h" -#include "mm-utils.h" #include "mm-log.h" #include "mm-modem-helpers.h" #include "mm-serial-enums-types.h" diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 8e594d5c..77650490 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -40,7 +40,6 @@ #include "mm-sms-list.h" #include "mm-sim.h" #include "mm-log.h" -#include "mm-utils.h" #include "mm-modem-helpers.h" #include "mm-error-helpers.h" #include "mm-qcdm-serial-port.h" @@ -3581,7 +3580,7 @@ modem_3gpp_ussd_encode (MMIfaceModem3gppUssd *self, broadband->priv->modem_current_charset)) { *scheme = MM_MODEM_GSM_USSD_SCHEME_7BIT; /* convert to hex representation */ - hex = utils_bin2hexstr (ussd_command->data, ussd_command->len); + hex = mm_utils_bin2hexstr (ussd_command->data, ussd_command->len); } g_byte_array_free (ussd_command, TRUE); diff --git a/src/mm-charsets.c b/src/mm-charsets.c index 633acc19..b6937cbd 100644 --- a/src/mm-charsets.c +++ b/src/mm-charsets.c @@ -20,8 +20,9 @@ #include <string.h> #include <ctype.h> +#include <libmm-common.h> + #include "mm-charsets.h" -#include "mm-utils.h" typedef struct { const char *gsm_name; @@ -160,7 +161,7 @@ mm_modem_charset_hex_to_utf8 (const char *src, MMModemCharset charset) iconv_from = charset_iconv_from (charset); g_return_val_if_fail (iconv_from != NULL, FALSE); - unconverted = utils_hexstr2bin (src, &unconverted_len); + unconverted = mm_utils_hexstr2bin (src, &unconverted_len); if (!unconverted) return NULL; @@ -208,7 +209,7 @@ mm_modem_charset_utf8_to_hex (const char *src, MMModemCharset charset) } /* Get hex representation of the string */ - hex = utils_bin2hexstr ((guint8 *)converted, converted_len); + hex = mm_utils_bin2hexstr ((guint8 *)converted, converted_len); g_free (converted); return hex; } @@ -607,7 +608,7 @@ mm_charset_get_encoded_len (const char *utf8, for (e = &subset_table[0]; e->cs != charset && e->cs != MM_MODEM_CHARSET_UNKNOWN; e++); - g_return_val_if_fail (e->cs != MM_MODEM_CHARSET_UNKNOWN, 0); + g_return_val_if_fail (e->cs != MM_MODEM_CHARSET_UNKNOWN, 0); while (*p) { gunichar c; @@ -622,7 +623,7 @@ mm_charset_get_encoded_len (const char *utf8, end = p; while (*end++); } - + if (!e->func (c, p, (end - p), &clen)) unsupported++; len += clen; @@ -888,7 +889,7 @@ mm_utf8_take_and_convert_to_charset (gchar *str, } /* Get hex representation of the string */ - hex = utils_bin2hexstr ((guint8 *)encoded, encoded_len); + hex = mm_utils_bin2hexstr ((guint8 *)encoded, encoded_len); g_free (encoded); encoded = hex; g_free (str); diff --git a/src/mm-device.c b/src/mm-device.c index 06755722..83b23867 100644 --- a/src/mm-device.c +++ b/src/mm-device.c @@ -20,11 +20,10 @@ #include <string.h> #include <ModemManager.h> -#include <mm-errors-types.h> +#include <libmm-common.h> #include "mm-device.h" #include "mm-plugin.h" -#include "mm-utils.h" #include "mm-log.h" G_DEFINE_TYPE (MMDevice, mm_device, G_TYPE_OBJECT); @@ -166,8 +165,8 @@ get_device_ids (GUdevDevice *device, goto out; if (vendor) { - *vendor = (guint16) (utils_hex2byte (vid + 2) & 0xFF); - *vendor |= (guint16) ((utils_hex2byte (vid) & 0xFF) << 8); + *vendor = (guint16) (mm_utils_hex2byte (vid + 2) & 0xFF); + *vendor |= (guint16) ((mm_utils_hex2byte (vid) & 0xFF) << 8); } if (!pid) @@ -185,8 +184,8 @@ get_device_ids (GUdevDevice *device, } if (product) { - *product = (guint16) (utils_hex2byte (pid + 2) & 0xFF); - *product |= (guint16) ((utils_hex2byte (pid) & 0xFF) << 8); + *product = (guint16) (mm_utils_hex2byte (pid + 2) & 0xFF); + *product |= (guint16) ((mm_utils_hex2byte (pid) & 0xFF) << 8); } success = TRUE; diff --git a/src/mm-sim.c b/src/mm-sim.c index 7cdb356b..6503d342 100644 --- a/src/mm-sim.c +++ b/src/mm-sim.c @@ -29,7 +29,6 @@ #include "mm-sim.h" #include "mm-base-modem-at.h" #include "mm-base-modem.h" -#include "mm-utils.h" #include "mm-log.h" #include "mm-modem-helpers.h" #include "mm-marshal.h" @@ -1178,7 +1177,7 @@ parse_mnc_length (const gchar *response, } /* Convert hex string to binary */ - bin = utils_hexstr2bin (hex, &buflen); + bin = mm_utils_hexstr2bin (hex, &buflen); if (!bin || buflen < 4) { g_set_error (error, MM_CORE_ERROR, @@ -1315,7 +1314,7 @@ parse_spn (const gchar *response, } /* Convert hex string to binary */ - bin = utils_hexstr2bin (hex, &buflen); + bin = mm_utils_hexstr2bin (hex, &buflen); if (!bin) { g_set_error (error, MM_CORE_ERROR, diff --git a/src/mm-sms-list.c b/src/mm-sms-list.c index 9afe96f6..393101ba 100644 --- a/src/mm-sms-list.c +++ b/src/mm-sms-list.c @@ -27,7 +27,6 @@ #include "mm-marshal.h" #include "mm-sms-list.h" #include "mm-sms.h" -#include "mm-utils.h" #include "mm-log.h" G_DEFINE_TYPE (MMSmsList, mm_sms_list, G_TYPE_OBJECT); diff --git a/src/mm-sms-part.c b/src/mm-sms-part.c index cb1ee5fa..4d4f3a38 100644 --- a/src/mm-sms-part.c +++ b/src/mm-sms-part.c @@ -25,7 +25,6 @@ #include "mm-sms-part.h" #include "mm-charsets.h" -#include "mm-utils.h" #include "mm-log.h" #define PDU_SIZE 200 @@ -476,7 +475,7 @@ mm_sms_part_new_from_pdu (guint index, MMSmsPart *part; /* Convert PDU from hex to binary */ - pdu = (guint8 *) utils_hexstr2bin (hexpdu, &pdu_len); + pdu = (guint8 *) mm_utils_hexstr2bin (hexpdu, &pdu_len); if (!pdu) { g_set_error_literal (error, MM_CORE_ERROR, diff --git a/src/mm-sms.c b/src/mm-sms.c index 27d8ca26..90bfc68b 100644 --- a/src/mm-sms.c +++ b/src/mm-sms.c @@ -31,7 +31,6 @@ #include "mm-sms.h" #include "mm-base-modem-at.h" #include "mm-base-modem.h" -#include "mm-utils.h" #include "mm-log.h" #include "mm-modem-helpers.h" @@ -475,7 +474,7 @@ sms_get_store_or_send_command (MMSmsPart *part, return FALSE; /* Convert PDU to hex */ - hex = utils_bin2hexstr (pdu, pdulen); + hex = mm_utils_bin2hexstr (pdu, pdulen); g_free (pdu); if (!hex) { diff --git a/src/mm-utils.c b/src/mm-utils.c deleted file mode 100644 index 236c2d9f..00000000 --- a/src/mm-utils.c +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Copyright (C) 2010 Red Hat, Inc. - */ - -#include <config.h> -#include <glib.h> -#include <string.h> -#include <ctype.h> -#include <stdlib.h> -#include <errno.h> - -#include "mm-utils.h" - -/* From hostap, Copyright (c) 2002-2005, Jouni Malinen <jkmaline@cc.hut.fi> */ - -static int hex2num (char c) -{ - if (c >= '0' && c <= '9') - return c - '0'; - if (c >= 'a' && c <= 'f') - return c - 'a' + 10; - if (c >= 'A' && c <= 'F') - return c - 'A' + 10; - return -1; -} - -int utils_hex2byte (const char *hex) -{ - int a, b; - a = hex2num(*hex++); - if (a < 0) - return -1; - b = hex2num(*hex++); - if (b < 0) - return -1; - return (a << 4) | b; -} - -char * -utils_hexstr2bin (const char *hex, gsize *out_len) -{ - size_t len = strlen (hex); - size_t i; - int a; - const char * ipos = hex; - char * buf = NULL; - char * opos; - - /* Length must be a multiple of 2 */ - g_return_val_if_fail ((len % 2) == 0, NULL); - - opos = buf = g_malloc0 ((len / 2) + 1); - for (i = 0; i < len; i += 2) { - a = utils_hex2byte (ipos); - if (a < 0) { - g_free (buf); - return NULL; - } - *opos++ = a; - ipos += 2; - } - *out_len = len / 2; - return buf; -} - -/* End from hostap */ - -char * -utils_bin2hexstr (const guint8 *bin, gsize len) -{ - GString *ret; - gsize i; - - g_return_val_if_fail (bin != NULL, NULL); - - ret = g_string_sized_new (len * 2 + 1); - for (i = 0; i < len; i++) - g_string_append_printf (ret, "%.2X", bin[i]); - return g_string_free (ret, FALSE); -} - -gboolean -utils_check_for_single_value (guint32 value) -{ - gboolean found = FALSE; - guint32 i; - - for (i = 1; i <= 32; i++) { - if (value & 0x1) { - if (found) - return FALSE; /* More than one bit set */ - found = TRUE; - } - value >>= 1; - } - - return TRUE; -} diff --git a/src/mm-utils.h b/src/mm-utils.h deleted file mode 100644 index be77f8a8..00000000 --- a/src/mm-utils.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Copyright (C) 2010 Red Hat, Inc. - */ - -#ifndef MM_UTILS_H -#define MM_UTILS_H - -int utils_hex2byte (const char *hex); - -char *utils_hexstr2bin (const char *hex, gsize *out_len); - -char *utils_bin2hexstr (const guint8 *bin, gsize len); - -gboolean utils_check_for_single_value (guint32 value); - -#endif /* MM_UTILS_H */ - diff --git a/src/tests/test-sms-part.c b/src/tests/test-sms-part.c index 3f6f16da..f052913c 100644 --- a/src/tests/test-sms-part.c +++ b/src/tests/test-sms-part.c @@ -20,8 +20,9 @@ #include <stdio.h> #include <locale.h> +#include <libmm-common.h> + #include "mm-sms-part.h" -#include "mm-utils.h" #include "mm-log.h" /* If defined will print debugging traces */ @@ -96,7 +97,7 @@ common_test_part_from_pdu (const guint8 *pdu, { gchar *hexpdu; - hexpdu = utils_bin2hexstr (pdu, pdu_size); + hexpdu = mm_utils_bin2hexstr (pdu, pdu_size); common_test_part_from_hexpdu (hexpdu, expected_smsc, expected_number, @@ -353,7 +354,7 @@ test_pdu_insufficient_data (void) 0x97, 0xd9, 0xec, 0x37 }; - hexpdu = utils_bin2hexstr (pdu, sizeof (pdu)); + hexpdu = mm_utils_bin2hexstr (pdu, sizeof (pdu)); part = mm_sms_part_new_from_pdu (0, hexpdu, &error); g_assert (part == NULL); /* We don't care for the specific error type */ |