Move dump_msg() to isi.h as static inline

This commit is contained in:
Aki Niemi 2009-08-22 15:37:34 +03:00
parent 64ade1c7c8
commit 54a6cc6253
2 changed files with 11 additions and 14 deletions

View File

@ -53,7 +53,17 @@ static inline struct isi_cb_data *isi_cb_data_new(struct ofono_modem *modem,
return ret;
}
void dump_msg(const unsigned char *msg, size_t len);
static inline void dump_msg(const unsigned char *msg, size_t len)
{
char dumpstr[len * 5 + len / 10 + 1];
size_t i;
for (i = 0; i < len; i++)
sprintf(dumpstr + i * 5, "0x%02x%s",
msg[i], (i + 1) % 10 == 0 ? "\n" : " ");
DBG("\n%s\n", dumpstr);
}
extern void isi_phonebook_init();
extern void isi_phonebook_exit();

View File

@ -49,19 +49,6 @@ struct isi_data {
static GPhonetNetlink *link = NULL;
static GSList *g_modems = NULL;
void dump_msg(const unsigned char *msg, size_t len)
{
char dumpstr[len * 5 + len / 10 + 1];
size_t i;
for (i = 0; i < len; i++)
sprintf(dumpstr + i * 5, "0x%02x%s",
msg[i], (i + 1) % 10 == 0 ? "\n" : " ");
DBG("%zd bytes:\n%s", len, dumpstr);
}
static struct isi_data *find_modem_by_idx(GSList *modems, GIsiModem *idx)
{
GSList *m = NULL;