aqhome: more work on transformation to event2/ipc2.

This commit is contained in:
Martin Preuss
2025-02-27 14:08:44 +01:00
parent bebc4c1b0d
commit d887747b3c
45 changed files with 2446 additions and 287 deletions

View File

@@ -129,11 +129,12 @@ int _handleSocketReady(AQH_OBJECT *o, AQH_OBJECT *fdObject)
{
AQH_MSG_WRITER *xo;
DBG_INFO(AQH_LOGDOMAIN, "Socket ready");
xo=GWEN_INHERIT_GETDATA(AQH_OBJECT, AQH_MSG_WRITER, o);
if (xo) {
if (xo->bytesLeft) {
int rv;
int rv;
if (xo->bytesLeft) {
if (!(xo->flags & AQH_MSGWRITER_FLAGS_MSGSTARTED)) {
rv=_startMsg(xo, fdObject);
if (rv<0) {
@@ -161,12 +162,17 @@ int _handleSocketReady(AQH_OBJECT *o, AQH_OBJECT *fdObject)
}
else {
if (xo->bytesLeft==0) {
int msgLen;
const uint8_t *msgPtr;
_endMsg(xo, fdObject);
rv=AQH_Object_EmitSignal(o, AQH_MSG_WRITER_SIGNAL_MSGSENT, xo->msgBufLen, (void*) (xo->msgBufPtr));
if (rv==0) {
DBG_INFO(AQH_LOGDOMAIN, "Sent message ignored");
}
msgPtr=xo->msgBufPtr;
msgLen=xo->msgBufLen;
_resetBuffer(o);
rv=AQH_Object_EmitSignal(o, AQH_MSG_WRITER_SIGNAL_MSGSENT, msgLen, (void*) msgPtr);
if (rv==0) {
DBG_ERROR(AQH_LOGDOMAIN, "Sent message ignored");
}
}
}
}