Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
modem.h File Reference
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/net_buf.h>
#include <zephyr/modem/pipe.h>
#include <zephyr/sys/ring_buffer.h>
#include <infuse/gnss/ubx/protocol.h>

Go to the source code of this file.

Data Structures

struct  ubx_message_handler_ctx
 Context around a ubx_message_handler_t. More...
 
struct  ubx_modem_data
 UBX modem state. More...
 

Macros

#define UBX_MSG_CLASS_WILDCARD   0x00
 
#define UBX_MSG_ID_WILDCARD   0x00
 

Typedefs

typedef int(* ubx_message_handler_t) (uint8_t message_class, uint8_t message_id, const void *payload, size_t payload_len, void *user_data)
 UBX Message handler callback.
 

Enumerations

enum  ubx_message_handler_flags { UBX_HANDLING_ACK = BIT(0) , UBX_HANDLING_RSP = BIT(1) , UBX_HANDLING_RSP_ACK = BIT(2) }
 

Functions

struct ubx_modem_dataubx_modem_data_get (const struct device *dev)
 Get modem data structure from device.
 
void ubx_modem_init (struct ubx_modem_data *modem, struct modem_pipe *pipe)
 Initialise UBX modem handler.
 
int ubx_modem_comms_reset (const struct device *dev)
 Reset communications with the UBX modem.
 
void ubx_modem_software_standby (struct ubx_modem_data *modem)
 Notify UBX modem that hardware is in standby.
 
void ubx_modem_msg_subscribe (struct ubx_modem_data *modem, struct ubx_message_handler_ctx *handler_ctx)
 Subscribe to messages from the UBX modem.
 
void ubx_modem_msg_unsubscribe (struct ubx_modem_data *modem, struct ubx_message_handler_ctx *handler_ctx)
 Unsubscribe from messages from the UBX modem.
 
int ubx_modem_ack_handler (uint8_t message_class, uint8_t message_id, const void *payload, size_t payload_len, void *user_data)
 Common ACK handler for messages.
 
int ubx_modem_send_async (struct ubx_modem_data *modem, struct net_buf_simple *buf, struct ubx_message_handler_ctx *handler_ctx, bool wait_tx)
 Send a message to the modem without waiting for a response.
 
int ubx_modem_send_sync (struct ubx_modem_data *modem, struct net_buf_simple *buf, uint8_t flags, ubx_message_handler_t handler, void *user_data, k_timeout_t timeout)
 Send a message to the modem and wait for the response.
 
int ubx_modem_send_sync_acked (struct ubx_modem_data *modem, struct net_buf_simple *buf, k_timeout_t timeout)
 Send a message to the modem and wait for the UBX_MSG_CLASS_ACK response.
 
int ubx_modem_send_sync_poll (struct ubx_modem_data *modem, uint8_t message_class, uint8_t message_id, ubx_message_handler_t handler, void *user_data, k_timeout_t timeout)
 Request a poll response from the modem and wait for the response.
 
int ubx_modem_send_async_poll (struct ubx_modem_data *modem, uint8_t message_class, uint8_t message_id, uint8_t buf[8], struct ubx_message_handler_ctx *handler_ctx)
 Request a poll response from the modem.
 

Detailed Description

Author
Jordan Yates jorda.nosp@m.n@em.nosp@m.beint.nosp@m..com

SPDX-License-Identifier: FSL-1.1-ALv2