FetchMessages Method

Receive currently buffered messages and return to sleep.

Syntax

ANSI (Cross Platform)
int FetchMessages();

Unicode (Windows)
INT FetchMessages();
- (void)fetchMessages;
#define MID_MQTTSN_FETCHMESSAGES 7

IPWORKSIOT_EXTERNAL int IPWORKSIOT_CALL IPWorksIoT_MQTTSN_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

Request any messages currently being buffered by the server for the current sleep period and return to sleep after they have been received.

Any available buffered messages will be sent to the client by the MQTTSN Gateway and the sleep interval will be reset.

This method sends a PINGREQ method with the ClientId, requesting buffered messages which will be sent if available (see MessageIn). When the server has sent all messages, it will sent a PINGRESP message, causing the client to re-enter sleep mode. Once the PINGRESP is received, the duration the client may sleep restarts.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 C++ Edition - Version 20.0 [Build 8265]