aqhome-nodes: allow for TTY interface without ATTN line.
This commit is contained in:
@@ -61,24 +61,28 @@ AQH_OBJECT *AQH_TtyObject_new(AQH_EVENT_LOOP *eventLoop, int fd, int fdMode)
|
||||
int _startMsg(AQH_OBJECT *o)
|
||||
{
|
||||
if (o) {
|
||||
int fd;
|
||||
int rv;
|
||||
|
||||
fd=AQH_FdObject_GetFd(o);
|
||||
if (fd==-1)
|
||||
return GWEN_ERROR_IO;
|
||||
rv=_getAttn(fd);
|
||||
if (rv<0) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "here (%d)", rv);
|
||||
return rv;
|
||||
}
|
||||
else if (rv==0) {
|
||||
DBG_ERROR(NULL, "Line busy");
|
||||
return GWEN_ERROR_TRY_AGAIN; /* line busy */
|
||||
}
|
||||
else {
|
||||
_setAttn(fd, 0); /* set ATTN low */
|
||||
if (AQH_Object_GetFlags(o) & AQH_TTYOBJECT_FLAGS_NOATTN)
|
||||
return 0;
|
||||
else {
|
||||
int fd;
|
||||
int rv;
|
||||
|
||||
fd=AQH_FdObject_GetFd(o);
|
||||
if (fd==-1)
|
||||
return GWEN_ERROR_IO;
|
||||
rv=_getAttn(fd);
|
||||
if (rv<0) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "here (%d)", rv);
|
||||
return rv;
|
||||
}
|
||||
else if (rv==0) {
|
||||
DBG_ERROR(NULL, "Line busy");
|
||||
return GWEN_ERROR_TRY_AGAIN; /* line busy */
|
||||
}
|
||||
else {
|
||||
_setAttn(fd, 0); /* set ATTN low */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -90,11 +94,13 @@ int _startMsg(AQH_OBJECT *o)
|
||||
void _endMsg(AQH_OBJECT *o)
|
||||
{
|
||||
if (o) {
|
||||
int fd;
|
||||
if (!(AQH_Object_GetFlags(o) & AQH_TTYOBJECT_FLAGS_NOATTN)) {
|
||||
int fd;
|
||||
|
||||
fd=AQH_FdObject_GetFd(o);
|
||||
if (fd>=0) {
|
||||
_setAttn(fd, 1); /* set ATTN high */
|
||||
fd=AQH_FdObject_GetFd(o);
|
||||
if (fd>=0) {
|
||||
_setAttn(fd, 1); /* set ATTN high */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user