1 /*
2  * Copyright (c) 2025 Croxel Inc.
3  * Copyright (c) 2025 CogniPilot Foundation
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef ZEPHYR_INCLUDE_GNSS_RTK_DECODER_H_
9 #define ZEPHYR_INCLUDE_GNSS_RTK_DECODER_H_
10 
11 #include <stdint.h>
12 #include <stddef.h>
13 
14 /**
15  * @brief Get an RTK frame from buffer
16  *
17  * Used by RTK clients to extract frames from a data-buffer.
18  *
19  * @param[in] buf Buffer holding encoded data.
20  * @param[in] buf_len Buffer length.
21  * @param[out] data Pointer to the decoded frame.
22  * @param[out] data_len Length of the decoded frame
23  *
24  * @return Zero if successful.
25  * @return -ENOENT if no frames have been decoded successfully.
26  * @return Other negative error code if decoding failed.
27  */
28 int gnss_rtk_decoder_frame_get(uint8_t *buf, size_t buf_len,
29 			       uint8_t **data, size_t *data_len);
30 
31 #endif /* ZEPHYR_INCLUDE_GNSS_RTK_DECODER_H_ */
32