aqhome: added AQH_MqttClientEndpoint2_GetNextPacketId(). added test for subscriptions.

This commit is contained in:
Martin Preuss
2023-07-09 21:19:36 +02:00
parent 5105c0c7f7
commit 2d393630d8
3 changed files with 149 additions and 1 deletions

View File

@@ -140,6 +140,23 @@ void AQH_MqttClientEndpoint2_SetKeepAliveTime(GWEN_MSG_ENDPOINT2 *ep, uint16_t i
uint16_t AQH_MqttClientEndpoint2_GetNextPacketId(const GWEN_MSG_ENDPOINT2 *ep)
{
if (ep) {
GWEN_MSG_ENDPOINT2 *epChild;
epChild=GWEN_MsgEndpoint2_Tree2_GetFirstChild(ep);
if (epChild) {
return AQH_MqttEndpoint2_GetNextPacketId(epChild);
}
}
return 0;
}
void _addSockets(GWEN_MSG_ENDPOINT2 *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
{
if (ep) {
@@ -170,6 +187,7 @@ void _addSockets(GWEN_MSG_ENDPOINT2 *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET
void _checkSockets(GWEN_MSG_ENDPOINT2 *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
{
DBG_ERROR(AQH_LOGDOMAIN, "Checking sockets in state %d", GWEN_MsgEndpoint2_GetState(ep));
if (ep) {
GWEN_MSG_ENDPOINT2 *epChild;

View File

@@ -29,6 +29,8 @@ AQHOME_API GWEN_MSG_ENDPOINT2 *AQH_MqttClientEndpoint2_new(const char *clientId,
AQHOME_API uint16_t AQH_MqttClientEndpoint2_GetKeepAliveTime(const GWEN_MSG_ENDPOINT2 *ep);
AQHOME_API void AQH_MqttClientEndpoint2_SetKeepAliveTime(GWEN_MSG_ENDPOINT2 *ep, uint16_t i);
AQHOME_API uint16_t AQH_MqttClientEndpoint2_GetNextPacketId(const GWEN_MSG_ENDPOINT2 *ep);
AQHOME_API int AQH_MqttClientEndpoint2_StartConnect(GWEN_MSG_ENDPOINT2 *ep);