summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/device/serial/ser_unx.c
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/device/serial/ser_unx.c') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/device/serial/ser_unx.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/gammu/emb/common/device/serial/ser_unx.c b/gammu/emb/common/device/serial/ser_unx.c
index 69c7515..18b5f6f 100644
--- a/gammu/emb/common/device/serial/ser_unx.c
+++ b/gammu/emb/common/device/serial/ser_unx.c
@@ -3,8 +3,17 @@
/* 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
@@ -59,10 +68,10 @@ static GSM_Error serial_close(GSM_StateMachine *s)
static GSM_Error serial_open (GSM_StateMachine *s)
{
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- struct termios t;
- int i;
+ struct termios t;
+ int i;
/* O_NONBLOCK MUST is required to avoid waiting for DCD */
d->hPhone = open(s->CurrentConfig->Device, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (d->hPhone < 0) {
@@ -123,9 +132,9 @@ static GSM_Error serial_open (GSM_StateMachine *s)
static GSM_Error serial_setparity(GSM_StateMachine *s, bool parity)
{
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- struct termios t;
+ struct termios t;
if (tcgetattr(d->hPhone, &t)) {
GSM_OSErrorInfo(s,"tcgetattr in serial_setparity");
return ERR_DEVICEREADERROR;
@@ -149,10 +158,10 @@ static GSM_Error serial_setparity(GSM_StateMachine *s, bool parity)
static GSM_Error serial_setdtrrts(GSM_StateMachine *s, bool dtr, bool rts)
{
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- struct termios t;
- unsigned int flags;
+ struct termios t;
+ unsigned int flags;
if (tcgetattr(d->hPhone, &t)) {
GSM_OSErrorInfo(s,"tcgetattr in serial_setdtrrts");
return ERR_DEVICEREADERROR;
@@ -263,10 +272,10 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed)
static int serial_read(GSM_StateMachine *s, void *buf, size_t nbytes)
{
GSM_Device_SerialData *d = &s->Device.Data.Serial;
struct timeval timeout2;
- fd_set readfds;
- int actual = 0;
+ fd_set readfds;
+ int actual = 0;
FD_ZERO(&readfds);
FD_SET(d->hPhone, &readfds);
@@ -282,10 +291,10 @@ static int serial_read(GSM_StateMachine *s, void *buf, size_t nbytes)
static int serial_write(GSM_StateMachine *s, void *buf, size_t nbytes)
{
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- int ret;
- size_t actual = 0;
+ int ret;
+ size_t actual = 0;
do {
ret = write(d->hPhone, (unsigned char *)buf, nbytes - actual);
if (ret < 0 && errno == EAGAIN) continue;