libmm-common: added common utils from core

Moved the utils to play with binary to hex strings into libmm-common.
This commit is contained in:
Aleksander Morgado
2012-09-14 07:05:26 +02:00
parent fbe01c8d6a
commit a66f971a7c
24 changed files with 124 additions and 177 deletions
+2 -3
View File
@@ -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))
@@ -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);
-1
View File
@@ -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 */
-1
View File
@@ -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);
@@ -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
-1
View File
@@ -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);
@@ -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);