Skip to content

Commit

Permalink
nrf_modem: stf cover sequence control and others
Browse files Browse the repository at this point in the history
Preview of new features.

Signed-off-by: Emanuele Di Santo <[email protected]>
  • Loading branch information
lemrey committed Sep 13, 2024
1 parent 56a4bd3 commit 72adb34
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
12 changes: 12 additions & 0 deletions nrf_modem/include/nrf_modem_at.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
extern "C" {
#endif

#ifdef __GNUC__
#define __nrf_modem_printf_like(f, a) __attribute__((format (printf, f, a)))
#define __nrf_modem_scanf_like(f, a) __attribute__((format (scanf, f, a)))
#else
#define __nrf_modem_printf_like(f, a)
#define __nrf_modem_scanf_like(f, a)
#endif

/** @brief Modem response type for 'ERROR' responses. */
#define NRF_MODEM_AT_ERROR 1
/** @brief Modem response type for '+CME ERROR' responses. */
Expand Down Expand Up @@ -86,6 +94,7 @@ void nrf_modem_at_cfun_handler_set(nrf_modem_at_cfun_handler_t handler);
* @retval -NRF_ENOMEM Not enough shared memory for this request.
* @retval -NRF_ESHUTDOWN If modem was shut down.
*/
__nrf_modem_printf_like(1, 2)
int nrf_modem_at_printf(const char *fmt, ...);

/**
Expand All @@ -108,6 +117,7 @@ int nrf_modem_at_printf(const char *fmt, ...);
* @retval -NRF_ENOMEM Not enough shared memory for this request.
* @retval -NRF_ESHUTDOWN If the modem was shut down.
*/
__nrf_modem_scanf_like(2, 3)
int nrf_modem_at_scanf(const char *cmd, const char *fmt, ...);

/**
Expand All @@ -131,6 +141,7 @@ int nrf_modem_at_scanf(const char *cmd, const char *fmt, ...);
* @retval -NRF_E2BIG The response is larger than the supplied buffer @c buf.
* @retval -NRF_ESHUTDOWN If the modem was shut down.
*/
__nrf_modem_printf_like(3, 4)
int nrf_modem_at_cmd(void *buf, size_t len, const char *fmt, ...);

/**
Expand Down Expand Up @@ -165,6 +176,7 @@ typedef void (*nrf_modem_at_resp_handler_t)(const char *resp);
* @retval -NRF_ENOMEM Not enough shared memory for this request.
* @retval -NRF_ESHUTDOWN If the modem was shut down.
*/
__nrf_modem_printf_like(2, 3)
int nrf_modem_at_cmd_async(nrf_modem_at_resp_handler_t callback, const char *fmt, ...);

/** @brief AT command handler prototype.
Expand Down
44 changes: 40 additions & 4 deletions nrf_modem/include/nrf_modem_dect_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ enum nrf_modem_dect_phy_rx_mode {
*/
NRF_MODEM_DECT_PHY_RX_MODE_CONTINUOUS,
/**
* @brief Semicontinous reception.
* @brief Semi-continuous reception.
*
* Similar to continuous reception, but will stop after receiving a unicast PDC.
*/
Expand Down Expand Up @@ -583,7 +583,7 @@ struct nrf_modem_dect_phy_rssi_meas {
/**
* @brief RSSI measurements, in dBm.
*
* If a symbol is measured, its measurement is in the interval [-1, -140].
* If a symbol is measured, its measurement is in the interval [-140, -1].
* If the measurement is saturated, the measured signal strength is reported
* as a positive integer. If a symbol is not measured, its value is reported
* as @ref NRF_MODEM_DECT_PHY_RSSI_NOT_MEASURED.
Expand Down Expand Up @@ -620,7 +620,7 @@ struct nrf_modem_dect_phy_rx_params {
*/
enum nrf_modem_dect_phy_rx_mode mode;
/**
* @brief RSSI measurement reporting interval.
* @brief RSSI measurement reporting interval, in slots.
*/
enum nrf_modem_dect_phy_rssi_interval rssi_interval;
/**
Expand Down Expand Up @@ -817,7 +817,7 @@ struct nrf_modem_dect_phy_rssi_params {
*/
uint32_t duration;
/**
* @brief RSSI measurements reporting interval, in subslots.
* @brief RSSI measurements reporting interval, in slots.
*/
enum nrf_modem_dect_phy_rssi_interval reporting_interval;
};
Expand Down Expand Up @@ -1029,6 +1029,20 @@ struct nrf_modem_dect_phy_callbacks {
void (*capability_get)(const uint64_t *time, enum nrf_modem_dect_phy_err err,
const struct nrf_modem_dect_phy_capability *capability);

/**
* @brief Callback for @ref nrf_modem_dect_phy_stf_cover_seq_control.
*
* The @p err parameter indicates the result of the operation.
* It can be one of the following values:
*
* - @ref NRF_MODEM_DECT_PHY_SUCCESS
* - @ref NRF_MODEM_DECT_PHY_ERR_NOT_ALLOWED
*
* @param[in] time Modem time, in modem time units.
* @param err Operation result.
*/
void (*stf_cover_seq_control)(const uint64_t *time, enum nrf_modem_dect_phy_err err);

/**
* @brief Callback for @ref nrf_modem_dect_phy_deinit.
*
Expand Down Expand Up @@ -1288,6 +1302,28 @@ int nrf_modem_dect_phy_link_config(const struct nrf_modem_dect_phy_link_config_p
*/
int nrf_modem_dect_phy_time_get(void);

/**
* @brief STF cover sequence control.
*
* Enable or disable STF cover sequence.
*
* @note
* This API is intended for certification purposes only.
* It should not be used for normal operation.
*
* This operation is asynchronous. The result of the operation is sent to the
* @ref nrf_modem_dect_phy_callbacks.stf_cover_seq_control callback.
*
* @param rx_enable Enable STF cover sequence for reception.
* @param tx_enable Enable STF cover sequence for transmission.
*
* @retval 0 Request was sent to modem.
* @retval -NRF_EPERM The Modem library is not initialized.
* @retval -NRF_EFAULT Callback configuration is invalid.
* @retval -NRF_ENOMEM Not enough shared memory for this request.
*/
int nrf_modem_dect_phy_stf_cover_seq_control(bool rx_enable, bool tx_enable);

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 3 additions & 2 deletions nrf_modem/include/nrf_modem_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ struct nrf_modem_trace_data {
* special values NRF_MODEM_OS_FOREVER or NRF_MODEM_OS_NO_WAIT.
*
* @retval 0 on success.
* @retval -NRF_EFAULT If @p frags or @p nfrags is NULL.
* @retval -NRF_EFAULT @p frags or @p nfrags is NULL.
* @retval -NRF_EPERM The Modem library is not initialized, or modem tracing is disabled.
* @retval -NRF_EINPROGRESS Trace is already being processed by the application.
* @retval -NRF_ENODATA No more trace data is available until the modem is restarted.
* @retval -NRF_ESHUTDOWN Modem was shut down.
* @retval -NRF_EAGAIN If the request timed out.
* @retval -NRF_EAGAIN The request timed out.
* @retval -NRF_ENOTSUP Modem is not configured for trace output.
*/
int nrf_modem_trace_get(struct nrf_modem_trace_data **frags, size_t *n_frags, int timeout);
Expand Down
Binary file modified nrf_modem/lib/dect_phy/nrf9120/hard-float/libmodem.a
Binary file not shown.
Binary file modified nrf_modem/lib/dect_phy/nrf9120/hard-float/libmodem_log.a
Binary file not shown.
Binary file modified nrf_modem/lib/dect_phy/nrf9120/soft-float/libmodem.a
Binary file not shown.
Binary file modified nrf_modem/lib/dect_phy/nrf9120/soft-float/libmodem_log.a
Binary file not shown.

0 comments on commit 72adb34

Please sign in to comment.