aqhome-nodes: allow for TTY interface without ATTN line.

This commit is contained in:
Martin Preuss
2025-03-21 20:54:19 +01:00
parent 1fa0d976d2
commit c808f8640e
6 changed files with 39 additions and 24 deletions

View File

@@ -445,6 +445,7 @@ void _readConfig(AQH_OBJECT *o, AQH_NODE_SERVER *xo, GWEN_DB_NODE *dbArgs)
xo->dbArgs=dbArgs;
xo->timeout=GWEN_DB_GetIntValue(dbArgs, "timeout", 0, 0);
xo->noAttn=GWEN_DB_GetIntValue(dbArgs, "noAttn", 0, 0);
xo->nodeAddress=GWEN_DB_GetIntValue(dbArgs, "nodeAddress", 0, AQHOMED_DEFAULT_NODEADDR);
AQH_NodeServer_SetDbFile(o, GWEN_DB_GetCharValue(dbArgs, "dbfile", 0, NULL));
@@ -534,7 +535,7 @@ int _startTty(AQH_OBJECT *o, AQH_NODE_SERVER *xo)
DBG_INFO(NULL, "here");
return GWEN_ERROR_IO;
}
xo->ttyEndpoint=AQH_TtyEndpoint2_new(AQH_Object_GetEventLoop(o), fd);
xo->ttyEndpoint=AQH_TtyEndpoint2_new(AQH_Object_GetEventLoop(o), fd, xo->noAttn);
AQH_Object_AddLink(xo->ttyEndpoint, AQH_ENDPOINT_SIGNAL_CLOSED, AQH_NODE_SERVER_SLOT_TTYCLOSED, o);
AQH_Object_Enable(xo->ttyEndpoint);
}
@@ -1410,6 +1411,7 @@ int _readArgs(int argc, char **argv, GWEN_DB_NODE *dbArgs)
{ A_ARG, A_CHAR, "dbfile", 0, 1, "db", "dbfile", I18S("DB file to read/write node database"), NULL},
{ A_ARG, A_CHAR, "pidfile", 0, 1, "p", "pidfile", I18S("PID file"), NULL},
{ A_ARG, A_INT, "timeout", 0, 1, "T", NULL, I18S("timeout in seconds [0]"), NULL},
{ 0, A_INT, "noAttn", 0, 1, "N", "noattn", I18S("Don't use ATTN line (for T03 or newer)"), NULL},
{ A_END, A_INT, "help", 0, 0, "h", "help", I18S("Show this help screen"), NULL}
};

View File

@@ -70,6 +70,7 @@ struct AQH_NODE_SERVER {
uint8_t protoId;
uint8_t protoVer;
int noAttn;
};