Skip to content

Commit 3198ffa

Browse files
authored
subsys: modem: add micro MODEM_CHAT_MATCH_WILDCARD_DEFINE
subsys: modem: Add a macro MODEM_CHAT_MATCH_WILDCARD_DEFINE, it's complementary to MODEM_CHAT_MATCH_DEFINE Example: MODEM_CHAT_MATCH_DEFINE(ok_match, "OK", "", NULL); MODEM_CHAT_MATCH_WILDCARD_DEFINE(version_match, "\"?.?.?-???", "", ublox_match_sw_version_callback); MODEM_CHAT_SCRIPT_CMDS_DEFINE(script_cmds, MODEM_CHAT_SCRIPT_CMD_RESP("AT", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+VER?", version_match), ); Signed-off-by: James Wu [email protected]
1 parent 009114a commit 3198ffa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/zephyr/modem/chat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ struct modem_chat_match {
8282
#define MODEM_CHAT_MATCH_DEFINE(_sym, _match, _separators, _callback) \
8383
const static struct modem_chat_match _sym = MODEM_CHAT_MATCH(_match, _separators, _callback)
8484

85+
#define MODEM_CHAT_MATCH_WILDCARD_DEFINE(_sym, _match, _separators, _callback) \
86+
const static struct modem_chat_match _sym = \
87+
MODEM_CHAT_MATCH_WILDCARD(_match, _separators, _callback)
88+
8589
/* Helper struct to match any response without callback. */
8690
extern const struct modem_chat_match modem_chat_any_match;
8791

0 commit comments

Comments
 (0)