From 9694ef9d70e6e7d90562174e8c4d52555d8730da Mon Sep 17 00:00:00 2001 From: RobMeades Date: Wed, 21 Feb 2024 13:06:04 +0000 Subject: [PATCH] Documentation change only: improve description of uGnssMsgReceiveStart(). --- gnss/api/u_gnss_msg.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gnss/api/u_gnss_msg.h b/gnss/api/u_gnss_msg.h index e5292018..aed25875 100644 --- a/gnss/api/u_gnss_msg.h +++ b/gnss/api/u_gnss_msg.h @@ -334,6 +334,23 @@ int32_t uGnssMsgReceive(uDeviceHandle_t gnssHandle, * transport, please instead open a Virtual Serial connection for * that case (see uCellMuxAddChannel()). * + * Note: if you wish to capture multiple message IDs, e.g. "G?GGA" + * and "G?RMC", then you should make a call to uGnssMsgReceiveStart() + * for both message IDs, which could be with the same pCallback, (don't + * worry about resources, internally the same monitoring task will be + * used for both) and either call uGnssMsgReceiveStop() for both when + * done or call uGnssMsgReceiveStopAll() to stop both of them. + * Alternatively, you could set a wider filter (in this case + * messageId.type = #U_GNSS_PROTOCOL_NMEA; messageId.id.pNmea = ""; + * (i.e. all NMEA messages)) and do the filtering yourself in your + * #uGnssMsgReceiveCallback_t callback by checking the contents of + * the pMessageId pointer it is passed, e.g. with uGnssMsgIdIsWanted() + * in a loop for a list of wanted message IDs, or by hand in your + * own way if you prefer: this might be a very slightly higher + * processor load but, in the end, the filtering is always going to + * be in C code on this MCU and so whether you do it in your + * application or this API does it internally is a moot point. + * * @param gnssHandle the handle of the GNSS instance. * @param[in] pMessageId a pointer to the message ID to capture; * a copy will be taken so this may be