wrong character in the GSM 03.38 table (ç for Ç)
[gammu.git] / gammu-detect / win32-serial.c
blobe38a825b88d4ff6ccb174436cff77a034e7c5814
1 /* This program is free software; you can redistribute it and/or modify
2 * it under the terms of the GNU General Public License as published by
3 * the Free Software Foundation; either version 2 of the License, or
4 * (at your option) any later version.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
11 * You should have received a copy of the GNU General Public License along
12 * with this program; if not, write to the Free Software Foundation, Inc.,
13 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15 * Copyright (c) 2011 Michal Cihar <michal@cihar.com>
18 #include <stdio.h>
19 #include <string.h>
20 #include <stdlib.h>
21 #include <windows.h>
22 #include <glib.h>
24 #include <gammu.h> /* For PRINTF_STYLE and locales */
25 #include "config.h"
27 #include "win32-serial.h"
28 #include "main.h"
29 #include "../helper/string.c"
30 #include "../helper/locales.h" /* For gettext */
32 void win32_serial_detect(void)
34 DWORD chars;
35 char buffer[65535];
36 gchar *name;
37 DWORD i;
39 chars = QueryDosDevice(NULL, buffer, sizeof(buffer));
41 if (chars) {
42 for (i = 0; buffer[i] != 0 && i < chars; i += strlen(buffer + i) + 1) {
43 if (strncasecmp(buffer + i, "com", 3) == 0) {
44 name = g_strdup_printf(_("Phone on serial port %s"), buffer + i);
45 print_config(buffer + i, name, "at");
46 g_free(name);