Search
SailfishOS Open Build Service
>
Projects
>
nemo
:
devel:hw
:
nv:tegra3:nexus7
>
ModemManager
> nexus7-hack.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File nexus7-hack.patch of Package ModemManager
diff --git a/src/mm-at-serial-port.c b/src/mm-at-serial-port.c index 4336b03..40dfec2 100644 --- a/src/mm-at-serial-port.c +++ b/src/mm-at-serial-port.c @@ -243,14 +243,22 @@ at_command_to_byte_array (const char *command) cmdlen = strlen (command); buf = g_byte_array_sized_new (cmdlen + 3); - /* Make sure there's an AT in the front */ - if (!g_str_has_prefix (command, "AT")) - g_byte_array_append (buf, (const guint8 *) "AT", 2); - g_byte_array_append (buf, (const guint8 *) command, cmdlen); - - /* Make sure there's a trailing carriage return */ - if (command[cmdlen - 1] != '\r') - g_byte_array_append (buf, (const guint8 *) "\r", 1); + if (g_str_has_prefix (command, "D*")) { + mm_dbg ("Found dial command D*...: %s", command); + mm_dbg ("Applying Nexus 7 specific workaround."); + g_byte_array_append (buf, (const guint8 *) "AT+CGDATA=\"PPP\"\r", 16); + } else { +// mm_dbg ("Not D*: %s", command); + + /* Make sure there's an AT in the front */ + if (!g_str_has_prefix (command, "AT")) + g_byte_array_append (buf, (const guint8 *) "AT", 2); + g_byte_array_append (buf, (const guint8 *) command, cmdlen); + + /* Make sure there's a trailing carriage return */ + if (command[cmdlen - 1] != '\r') + g_byte_array_append (buf, (const guint8 *) "\r", 1); + } return buf; }