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>
24 #include <gammu.h> /* For PRINTF_STYLE and locales */
27 #include "win32-serial.h"
29 #include "../helper/string.c"
30 #include "../helper/locales.h" /* For gettext */
32 void win32_serial_detect(void)
39 chars
= QueryDosDevice(NULL
, buffer
, sizeof(buffer
));
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");