summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/device/serial/ser_w32.c
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/device/serial/ser_w32.c') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/device/serial/ser_w32.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gammu/emb/common/device/serial/ser_w32.c b/gammu/emb/common/device/serial/ser_w32.c
index 7d88fc7..a7919fe 100644
--- a/gammu/emb/common/device/serial/ser_w32.c
+++ b/gammu/emb/common/device/serial/ser_w32.c
@@ -1,54 +1,63 @@
/* (c) 2002-2004 by Marcin Wiacek */
/* based on some work from MSDN and others */
/* based on some work from Gnokii (www.gnokii.org)
* (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
* GNU GPL version 2 or later
*/
+/* Due to a problem in the source code management, the names of some of
+ * the authors have unfortunately been lost. We do not mean to belittle
+ * their efforts and hope they will contact us to see their names
+ * properly added to the Copyright notice above.
+ * Having published their contributions under the terms of the GNU
+ * General Public License (GPL) [version 2], the Copyright of these
+ * authors will remain respected by adhering to the license they chose
+ * to publish their code under.
+ */
#include "../../gsmstate.h"
#ifdef GSM_ENABLE_SERIALDEVICE
#ifdef WIN32
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include <io.h>
#include <memory.h>
#include "../../gsmcomon.h"
#include "ser_w32.h"
static GSM_Error serial_close(GSM_StateMachine *s)
{
GSM_Device_SerialData *d = &s->Device.Data.Serial;
/* Disables all monitored events for device */
SetCommMask(d->hPhone, 0);
/* Discards all characters from input/output buffer and terminates
* pending read/write operations
*/
PurgeComm(d->hPhone, PURGE_TXABORT | PURGE_RXABORT |
PURGE_TXCLEAR | PURGE_RXCLEAR);
/* Clears the DTR (data-terminal-ready) signal */
EscapeCommFunction(d->hPhone, CLRDTR);
/* Restores old settings */
if (SetCommState(d->hPhone, &d->old_settings)==0) {
GSM_OSErrorInfo(s, "SetCommState in serial_close");
}
/* Closes device */
if (CloseHandle(d->hPhone)==0) {
GSM_OSErrorInfo(s, "CloseHandle in serial_close");
}
return ERR_NONE;
}
static GSM_Error serial_open (GSM_StateMachine *s)
{
GSM_Device_SerialData *d = &s->Device.Data.Serial;
DCB dcb;