diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-09-27 16:24:55 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-09-27 20:53:38 +0200 |
commit | 804f07cb959246e3ba44a9202ee34d1f7a5d065b (patch) | |
tree | dbc0b0f9e47d389286c296ebf88344442aa0ed8c | |
parent | 005f1e94d35ec19be6b4cf4a4821d65ecf731494 (diff) | |
download | libmbim-804f07cb959246e3ba44a9202ee34d1f7a5d065b.tar.gz |
mbimcli,basic-connect: support 'compression' in --connect
-rw-r--r-- | src/mbimcli/mbimcli-basic-connect.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mbimcli/mbimcli-basic-connect.c b/src/mbimcli/mbimcli-basic-connect.c index b0d1cc8..8aeadd8 100644 --- a/src/mbimcli/mbimcli-basic-connect.c +++ b/src/mbimcli/mbimcli-basic-connect.c @@ -172,7 +172,7 @@ static GOptionEntry entries[] = { "[SessionID]" }, { "connect", 0, 0, G_OPTION_ARG_STRING, &set_connect_activate_str, - "Connect (allowed keys: session-id, access-string, ip-type, auth, username, password)", + "Connect (allowed keys: session-id, access-string, ip-type, auth, username, password, compression)", "[\"key=value,...\"]" }, { "query-ip-configuration", 0, G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, G_CALLBACK (query_ip_configuration_arg_parse), @@ -1008,6 +1008,7 @@ typedef struct { gchar *username; gchar *password; MbimContextIpType ip_type; + MbimCompression compression; } ConnectActivateProperties; static void @@ -1065,6 +1066,12 @@ connect_activate_properties_handle (const gchar *key, "unknown ip-type: '%s'", value); return FALSE; } + } else if (g_ascii_strcasecmp (key, "compression") == 0) { + if (!mbimcli_read_compression_from_string (value, &props->compression)) { + g_set_error (error, MBIM_CORE_ERROR, MBIM_CORE_ERROR_INVALID_ARGS, + "unknown compression: '%s'", value); + return FALSE; + } } else { g_set_error (error, MBIM_CORE_ERROR, MBIM_CORE_ERROR_FAILED, "unrecognized option '%s'", key); @@ -2080,7 +2087,8 @@ mbimcli_basic_connect_run (MbimDevice *device, .auth_protocol = MBIM_AUTH_PROTOCOL_NONE, .username = NULL, .password = NULL, - .ip_type = MBIM_CONTEXT_IP_TYPE_DEFAULT + .ip_type = MBIM_CONTEXT_IP_TYPE_DEFAULT, + .compression = MBIM_COMPRESSION_NONE, }; if (!set_connect_activate_parse (set_connect_activate_str, &props)) { @@ -2093,7 +2101,7 @@ mbimcli_basic_connect_run (MbimDevice *device, props.access_string, props.username, props.password, - MBIM_COMPRESSION_NONE, + props.compression, props.auth_protocol, props.ip_type, mbim_uuid_from_context_type (MBIM_CONTEXT_TYPE_INTERNET), |