From 4e16e48b24e5d67522c66af369caab0f09ea6377 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 11 Apr 2010 18:14:12 +0200 Subject: [PATCH] Make CPIN handling of AT server a bit more compliant --- gatchat/test-server.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gatchat/test-server.c b/gatchat/test-server.c index 16f3e23..4163d7b 100644 --- a/gatchat/test-server.c +++ b/gatchat/test-server.c @@ -210,11 +210,17 @@ static void cpin_cb(GAtServerRequestType type, GAtResult *cmd, gpointer user) { GAtServer *server = user; + if (modem_mode == 0) { + g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR); + return; + } + switch (type) { case G_AT_SERVER_REQUEST_TYPE_SET: - g_at_server_send_final(server, G_AT_SERVER_RESULT_OK); + g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR); break; case G_AT_SERVER_REQUEST_TYPE_SUPPORT: + g_at_server_send_info(server, "+CPIN: (READY)", TRUE); g_at_server_send_final(server, G_AT_SERVER_RESULT_OK); break; case G_AT_SERVER_REQUEST_TYPE_QUERY: -- 2.7.4