Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Modem Ubx. More...
Data Structures | |
struct | ubx_frame |
struct | modem_ubx_script |
struct | modem_ubx |
struct | modem_ubx_config |
Macros | |
#define | UBX_FRM_HEADER_SZ 6 |
#define | UBX_FRM_FOOTER_SZ 2 |
#define | UBX_FRM_SZ_WITHOUT_PAYLOAD (UBX_FRM_HEADER_SZ + UBX_FRM_FOOTER_SZ) |
#define | UBX_FRM_SZ(payload_size) (payload_size + UBX_FRM_SZ_WITHOUT_PAYLOAD) |
#define | UBX_PREAMBLE_SYNC_CHAR_1 0xB5 |
#define | UBX_PREAMBLE_SYNC_CHAR_2 0x62 |
#define | UBX_FRM_PREAMBLE_SYNC_CHAR_1_IDX 0 |
#define | UBX_FRM_PREAMBLE_SYNC_CHAR_2_IDX 1 |
#define | UBX_FRM_MSG_CLASS_IDX 2 |
#define | UBX_FRM_MSG_ID_IDX 3 |
#define | UBX_FRM_PAYLOAD_SZ_L_IDX 4 |
#define | UBX_FRM_PAYLOAD_SZ_H_IDX 5 |
#define | UBX_FRM_PAYLOAD_IDX 6 |
#define | UBX_FRM_CHECKSUM_START_IDX 2 |
#define | UBX_FRM_CHECKSUM_STOP_IDX(frame_len) (frame_len - 2) |
#define | UBX_PAYLOAD_SZ_MAX 256 |
#define | UBX_FRM_SZ_MAX UBX_FRM_SZ(UBX_PAYLOAD_SZ_MAX) |
Functions | |
int | modem_ubx_attach (struct modem_ubx *ubx, struct modem_pipe *pipe) |
Attach pipe to Modem Ubx. | |
void | modem_ubx_release (struct modem_ubx *ubx) |
Release pipe from Modem Ubx instance. | |
int | modem_ubx_init (struct modem_ubx *ubx, const struct modem_ubx_config *config) |
Initialize Modem Ubx instance. | |
int | modem_ubx_run_script (struct modem_ubx *ubx, const struct modem_ubx_script *script) |
Writes the ubx frame in script.request and reads back its response (if available) | |
int | modem_ubx_create_frame (uint8_t *ubx_frame, uint16_t ubx_frame_size, uint8_t msg_cls, uint8_t msg_id, const void *payload, uint16_t payload_size) |
Initialize ubx frame. | |
Modem Ubx.
#define UBX_FRM_CHECKSUM_START_IDX 2 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_CHECKSUM_STOP_IDX | ( | frame_len | ) | (frame_len - 2) |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_FOOTER_SZ 2 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_HEADER_SZ 6 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_MSG_CLASS_IDX 2 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_MSG_ID_IDX 3 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_PAYLOAD_IDX 6 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_PAYLOAD_SZ_H_IDX 5 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_PAYLOAD_SZ_L_IDX 4 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_PREAMBLE_SYNC_CHAR_1_IDX 0 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_PREAMBLE_SYNC_CHAR_2_IDX 1 |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_SZ | ( | payload_size | ) | (payload_size + UBX_FRM_SZ_WITHOUT_PAYLOAD) |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_SZ_MAX UBX_FRM_SZ(UBX_PAYLOAD_SZ_MAX) |
#include <zephyr/modem/ubx.h>
#define UBX_FRM_SZ_WITHOUT_PAYLOAD (UBX_FRM_HEADER_SZ + UBX_FRM_FOOTER_SZ) |
#include <zephyr/modem/ubx.h>
#define UBX_PAYLOAD_SZ_MAX 256 |
#include <zephyr/modem/ubx.h>
#define UBX_PREAMBLE_SYNC_CHAR_1 0xB5 |
#include <zephyr/modem/ubx.h>
#define UBX_PREAMBLE_SYNC_CHAR_2 0x62 |
#include <zephyr/modem/ubx.h>
int modem_ubx_attach | ( | struct modem_ubx * | ubx, |
struct modem_pipe * | pipe | ||
) |
#include <zephyr/modem/ubx.h>
Attach pipe to Modem Ubx.
ubx | Modem Ubx instance |
pipe | Pipe instance to attach Modem Ubx instance to |
int modem_ubx_create_frame | ( | uint8_t * | ubx_frame, |
uint16_t | ubx_frame_size, | ||
uint8_t | msg_cls, | ||
uint8_t | msg_id, | ||
const void * | payload, | ||
uint16_t | payload_size | ||
) |
#include <zephyr/modem/ubx.h>
Initialize ubx frame.
ubx_frame | Ubx frame buffer |
ubx_frame_size | Ubx frame buffer size |
msg_cls | Message class |
msg_id | Message id |
payload | Payload buffer |
payload_size | Payload buffer size |
int modem_ubx_init | ( | struct modem_ubx * | ubx, |
const struct modem_ubx_config * | config | ||
) |
#include <zephyr/modem/ubx.h>
Initialize Modem Ubx instance.
ubx | Modem Ubx instance |
config | Configuration which shall be applied to the Modem Ubx instance |
void modem_ubx_release | ( | struct modem_ubx * | ubx | ) |
#include <zephyr/modem/ubx.h>
Release pipe from Modem Ubx instance.
ubx | Modem Ubx instance |
int modem_ubx_run_script | ( | struct modem_ubx * | ubx, |
const struct modem_ubx_script * | script | ||
) |
#include <zephyr/modem/ubx.h>
Writes the ubx frame in script.request and reads back its response (if available)
For each ubx frame sent, the device responds in 0, 1 or both of the following ways:
This function writes the ubx frame in script.request then reads back it's response. If script.match is not NULL, then every ubx frame received from the device is compared with script.match to check if a match occurred. This could be used to match UBX-ACK frame sent from the device by populating script.match with UBX-ACK that the script expects to receive.
The script terminates when either of the following happens:
ubx | Modem Ubx instance |
script | Script to be executed |