From 23ad55d9df0a1ad4f49f7024044161de7d7e704f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20J=C3=B8lsgard?= Date: Thu, 7 Mar 2024 14:35:32 +0100 Subject: [PATCH] lib: at_cmd_custom: add length to filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add length to custom command filter. Signed-off-by: Eivind Jølsgard --- include/modem/at_cmd_custom.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/modem/at_cmd_custom.h b/include/modem/at_cmd_custom.h index b49686390bab..fffee7c3be07 100644 --- a/include/modem/at_cmd_custom.h +++ b/include/modem/at_cmd_custom.h @@ -55,11 +55,12 @@ int at_cmd_custom_respond(char *buf, size_t buf_size, * @param _filter The (partial) AT command on which the callback should trigger. * @param _callback The AT command callback function. */ -#define AT_CMD_CUSTOM(entry, _filter, _callback) \ +#define AT_CMD_CUSTOM(entry, _filter, _callback) \ static int _callback(char *buf, size_t len, char *at_cmd); \ static STRUCT_SECTION_ITERABLE(nrf_modem_at_cmd_custom, entry) = { \ .cmd = _filter, \ .callback = _callback, \ + .cmd_strlen = sizeof(_filter) - sizeof('\0') \ } /** @} */