OS  v7.3.3
Documentation
Loading...
Searching...
No Matches
qresponse.h
1
9#ifndef QRESPONSE_H
10 #define QRESPONSE_H
11
12 #include "qtypes.h"
13 #include "qstimers.h"
14 #include "qioutils.h"
15
16 #include <string.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 #ifndef Q_RESPONSE_HANDLER
23 #define Q_RESPONSE_HANDLER ( 1 )
24 #endif
25
36 typedef struct _qResponse_s { // skipcq: CXX-E2000
38 struct _qResponse_Private_s { // skipcq: CXX-E2000
39 char *pattern2Match; /*< Points to the storage area provided by the user to hold the match requested response. */
40 qSTimer_t timeout; /*< The timeout used to wait the requested response. */
41 size_t maxStrLength; /*< The size of the storage area. */
42 size_t patternLength; /*< The length of the current response request.*/
43 volatile size_t matchedCount; /*< To hold the current number of response matches. */
44 volatile qBool_t responseReceived; /*< A flag that indicates when the response matches the request. */
45 }
46 qPrivate;
48 }
50
60 char *xLocBuff,
61 const size_t nMax );
62
69
80 const char *pattern,
81 const size_t n );
82
94 const char *pattern,
95 const size_t n,
96 const qTime_t t );
97
106 const char rxChar );
107
110 #ifdef __cplusplus
111 }
112 #endif
113
114#endif
qFloat32_t qTime_t
The typedef that specified an time quantity, usually expressed in seconds.
Definition qclock.h:33
qBool_t qResponse_Setup(qResponse_t *const r, char *xLocBuff, const size_t nMax)
Initialize the instance of the response handler object.
qBool_t qResponse_Received(qResponse_t *const r, const char *pattern, const size_t n)
Non-Blocking Response check.
qBool_t qResponse_ReceivedWithTimeout(qResponse_t *const r, const char *pattern, const size_t n, const qTime_t t)
Non-Blocking Response check with timeout.
qBool_t qResponse_ISRHandler(qResponse_t *const r, const char rxChar)
ISR receiver for the response handler.
qBool_t qResponse_Reset(qResponse_t *const r)
Reset the Response Handler.
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition qtypes.h:139
A Response Handler object.
Definition qresponse.h:36
A STimer(Software Timer) object.
Definition qstimers.h:32