kopia lustrzana https://github.com/Hamlib/Hamlib
export ser_set_dtr(), added ser_set_brk()
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1718 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.1
rodzic
e7a33ec5b6
commit
211ee6dc68
19
src/serial.c
19
src/serial.c
|
@ -4,7 +4,7 @@
|
|||
* Parts of the PTT handling are derived from soundmodem, an excellent
|
||||
* ham packet softmodem written by Thomas Sailer, HB9JNX.
|
||||
*
|
||||
* $Id: serial.c,v 1.38 2003-10-01 19:44:00 fillods Exp $
|
||||
* $Id: serial.c,v 1.39 2004-04-16 20:04:11 fillods Exp $
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -464,7 +464,7 @@ int ser_set_rts(port_t *p, int state)
|
|||
y |= TIOCM_RTS;
|
||||
else
|
||||
y &= ~TIOCM_RTS;
|
||||
return ioctl(p->fd, state ? TIOCMSET, &y);
|
||||
return ioctl(p->fd, TIOCMSET, &y);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ int ser_set_dtr(port_t *p, int state)
|
|||
y |= TIOCM_DTR;
|
||||
else
|
||||
y &= ~TIOCM_DTR;
|
||||
return ioctl(p->fd, state ? TIOCMSET, &y);
|
||||
return ioctl(p->fd, TIOCMSET, &y);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -522,6 +522,19 @@ int ser_get_dtr(port_t *p, int *state)
|
|||
#endif
|
||||
}
|
||||
|
||||
int ser_set_brk(port_t *p, int state)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
return !EscapeCommFunction(p->handle, state ? SETBREAK : CLRBREAK);
|
||||
#else
|
||||
#if defined(TIOCSBRK) && defined(TIOCCBRK)
|
||||
return ioctl(p->fd, state ? TIOCSBRK : TIOCCBRK, 0 );
|
||||
#else
|
||||
return -RIG_ENIMPL;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* assumes state not NULL
|
||||
* p is supposed to be &rig->state.rigport
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib Interface - serial communication header
|
||||
* Copyright (c) 2000-2002 by Stephane Fillod and Frank Singleton
|
||||
*
|
||||
* $Id: serial.h,v 1.22 2003-09-28 15:34:44 fillods Exp $
|
||||
* $Id: serial.h,v 1.23 2004-04-16 20:04:11 fillods Exp $
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -40,7 +40,8 @@ int ser_ptt_get(port_t *p, ptt_t *pttx);
|
|||
int ser_dcd_get(port_t *p, dcd_t *dcdx);
|
||||
extern HAMLIB_EXPORT(int) ser_set_rts(port_t *p, int state);
|
||||
extern HAMLIB_EXPORT(int) ser_get_rts(port_t *p, int *state);
|
||||
int ser_set_dtr(port_t *p, int state);
|
||||
extern HAMLIB_EXPORT(int) ser_set_brk(port_t *p, int state);
|
||||
extern HAMLIB_EXPORT(int) ser_set_dtr(port_t *p, int state);
|
||||
int ser_get_dtr(port_t *p, int *state);
|
||||
extern HAMLIB_EXPORT(int) ser_get_dcd(port_t *p, int *state);
|
||||
int par_open(port_t *p);
|
||||
|
|
Ładowanie…
Reference in New Issue