Skip to content

Commit

Permalink
v3.3 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovic-Lesur committed Aug 10, 2023
1 parent f04424f commit 91fd4ea
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 65 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v3.3](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.3) - 10 Aug 2023

### Added

* Add `MCU_API_get_latency()` function to manage MCU drivers latencies as well as radio latencies.
* Add **LR11XX RF API** support in cmake.

### Fixed

* Fix **T_CONF** and **T_RX** latency compensation formula. Reset all latency values to 0 by default.
* Fix compilation issue in `_start_timer()` function.
* Improve **error callback** management. Add missing **volatile** keyword on low level status. Stack corresponding error in **process function** in order to avoid putting the whole stack in volatile domain.
* Update manufacturer functions template.

### Changed

* Initialize **error stack** only once in order to keep history when closing and re-opening the library.
* Internal improvements: optimize **control message type check**, use `EXIT_ERROR` when checking **library state**, improve **flags naming**.

### Removed

* Remove unused `SIGFOX_EP_API_STATE_DL_CONFIRMATION` item in library state enumeration.

### Known limitations

* **Payload encryption** not supported.
* **Secure element** not supported.

## [v3.2](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.2) - 16 Jun 2023

### Added

* New `LATENCY_COMPENSATION` flag which enables **radio latency compensation** to improve MCU timers accuracy. Delay computation is now performed by the core library.
* Add `SIGFOX_ERROR_SOURCE_HW_API` item to handle **board drivers errors** in RF API or MCU API implementation.
* Add **S2LP RF API** support in cmake.

### Changed

Expand Down
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@ if(NOT sigfox_ep_addon_rfp_IS_TOP_LEVEL)
endif()
#Option RF API contents
if(NOT s2lp_rf_api_IS_TOP_LEVEL)
opt(TYPE_BOOL S2LP_RF_API OFF "Add RF API contents to build it with library")
opt(TYPE_BOOL S2LP_RF_API OFF "Add S2LP RF API contents to build it with library")
if(S2LP_RF_API)
list(REMOVE_ITEM MANUF_SOURCES "src/manuf/rf_api.c")
endif()
else()
list(REMOVE_ITEM MANUF_SOURCES "src/manuf/rf_api.c")
endif()
if(NOT lr11xx_rf_api_IS_TOP_LEVEL)
opt(TYPE_BOOL LR11XX_RF_API OFF "Add LR11XX RF API contents to build it with library")
if(LR11XX_RF_API)
list(REMOVE_ITEM MANUF_SOURCES "src/manuf/rf_api.c")
endif()
else()
list(REMOVE_ITEM MANUF_SOURCES "src/manuf/rf_api.c")
endif()

#When sigfox_ep_flag.h is don't used
if(${USE_SIGFOX_EP_FLAGS_H} STREQUAL "ON")
Expand Down Expand Up @@ -183,11 +191,13 @@ include(precompile)
if(ADDON_RFP)
include(addon_rfp)
endif()
#Addon RFP module
#RF_API modules
if(S2LP_RF_API)
include(s2lp_rf_api)
endif()

if(LR11XX_RF_API)
include(lr11xx_rf_api)
endif()
mark_as_advanced(CMAKE_BUILD_TYPE CMAKE_INSTALL_PREFIX LIB_LOCATION API_LOCATION)

add_library(${PROJECT_NAME}_obj OBJECT EXCLUDE_FROM_ALL ${LIB_SOURCES})
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ The addon can be directly generated from the Sigfox End-Point library **cmake**

```bash
$ cmake <all previous flags> -DADDON_RFP=ON ..
$ make precompil_sigfox_ep_addon_rfp
$ make sigfox_ep_addon_rfp
```

Expand All @@ -167,5 +168,16 @@ The [S2LP RF API example code](https://github.com/sigfox-tech-radio/sigfox-ep-rf

```bash
$ cmake <all previous flags> -DS2LP_RF_API=ON ..
$ make precompil_s2lp_rf_api
$ make s2lp_rf_api
```

### Semtech LR11XX

The [LR11XX RF API example code](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-semtech-lr11xx) can be directly generated from the Sigfox End-Point library **cmake** by using the `LR11XX_RF_API` option:

```bash
$ cmake <all previous flags> -DLR11XX_RF_API=ON ..
$ make precompil_lr11xx_rf_api
$ make lr11xx_rf_api
```
2 changes: 1 addition & 1 deletion cmake/addon_rfp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
addon_rfp
GIT_REPOSITORY "https://github.com/sigfox-tech-radio/sigfox-ep-addon-rfp"
GIT_TAG "v1.2"
GIT_TAG "v1.3"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
Expand Down
21 changes: 21 additions & 0 deletions cmake/lr11xx_rf_api.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include(ExternalProject)
include(FetchContent)
Set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
lr11xx_rf_api
GIT_REPOSITORY "https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-semtech-lr11xx"
GIT_TAG "v1.1"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
UPDATE_DISCONNECTED TRUE
STEP_TARGETS update
)
FetchContent_GetProperties(lr11xx_rf_api)
if (NOT platform_POPULATED)
FetchContent_Populate(lr11xx_rf_api)
add_subdirectory(${lr11xx_rf_api_SOURCE_DIR} ${lr11xx_rf_api_BINARY_DIR})
endif()
mark_as_advanced(FETCHCONTENT_QUIET FETCHCONTENT_BASE_DIR FETCHCONTENT_FULLY_DISCONNECTED FETCHCONTENT_UPDATES_DISCONNECTED)
mark_as_advanced(FETCHCONTENT_SOURCE_DIR_LR11XX_RF_API FETCHCONTENT_UPDATES_DISCONNECTED_LR11XX_RF_API)
#FetchContent_MakeAvailable(addon_rfp)
2 changes: 1 addition & 1 deletion cmake/s2lp_rf_api.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
s2lp_rf_api
GIT_REPOSITORY "https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp"
GIT_TAG "v1.0"
GIT_TAG "v1.2"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
Expand Down
23 changes: 23 additions & 0 deletions inc/manuf/mcu_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ typedef struct {
} MCU_API_timer_t;
#endif

#if (defined TIMER_REQUIRED) && (defined LATENCY_COMPENSATION) && (defined BIDIRECTIONAL)
/*!******************************************************************
* \enum MCU_API_latency_t
* \brief MCU latency sources.
*******************************************************************/
typedef enum {
MCU_API_LATENCY_GET_VOLTAGE_TEMPERATURE = 0,
MCU_API_LATENCY_LAST
} MCU_API_latency_t;
#endif

/*!******************************************************************
* \struct MCU_API_encryption_data_t
* \brief MCU API encryption data structure.
Expand Down Expand Up @@ -361,6 +372,18 @@ MCU_API_status_t MCU_API_print_dl_payload(sfx_u8 *dl_payload, sfx_u8 dl_payload_
MCU_API_status_t MCU_API_get_initial_pac(sfx_u8 *initial_pac, sfx_u8 initial_pac_size_bytes);
#endif

#if (defined TIMER_REQUIRED) && (defined LATENCY_COMPENSATION) && (defined BIDIRECTIONAL)
/*!******************************************************************
* \fn MCU_API_status_t MCU_API_get_latency(MCU_API_latency_t latency_type, sfx_u32 *latency_ms)
* \brief Read MCU latency in milliseconds.
* \brief This functions is called by the core library to compensate the durations in the MCU_API_timer_start() function.
* \param[in] latency_type: Type of latency to get.
* \param[out] latency_ms: Pointer to integer that will contain the MCU latency in milliseconds.
* \retval Function execution status.
*******************************************************************/
MCU_API_status_t MCU_API_get_latency(MCU_API_latency_t latency_type, sfx_u32 *latency_ms);
#endif

#ifdef VERBOSE
/*!******************************************************************
* \fn MCU_API_status_t MCU_API_get_version(sfx_u8 **version, sfx_u8 *version_size_char)
Expand Down
2 changes: 1 addition & 1 deletion inc/manuf/rf_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ typedef enum {
#if (defined TIMER_REQUIRED) && (defined LATENCY_COMPENSATION)
/*!******************************************************************
* \enum RF_API_latency_t
* \brief RF latency delay type.
* \brief RF latency sources.
*******************************************************************/
typedef enum {
RF_API_LATENCY_WAKE_UP = 0,
Expand Down
2 changes: 1 addition & 1 deletion inc/sigfox_ep_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ typedef enum {
SIGFOX_EP_API_ERROR_TIMER_INSTANCE,
SIGFOX_EP_API_ERROR_TIMER_REASON,
SIGFOX_EP_API_ERROR_VERSION,
SIGFOX_EP_API_ERROR_STACK_NOT_INITIALIZED,
// Network errors.
SIGFOX_EP_API_ERROR_TX_FORBIDDEN,
SIGFOX_EP_API_ERROR_DOWNLINK_TIMEOUT,
Expand Down Expand Up @@ -109,7 +110,6 @@ typedef enum {
SIGFOX_EP_API_STATE_DL_TIMER,
SIGFOX_EP_API_STATE_DL_LISTENING,
SIGFOX_EP_API_STATE_DL_CONFIRMATION_TIMER,
SIGFOX_EP_API_STATE_DL_CONFIRMATION,
#endif
SIGFOX_EP_API_STATE_LAST
} SIGFOX_EP_API_state_t;
Expand Down
2 changes: 1 addition & 1 deletion inc/sigfox_ep_lib_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

/*** Main version ***/

#define SIGFOX_EP_LIB_VERSION "v3.2"
#define SIGFOX_EP_LIB_VERSION "v3.3"

/*** Compilation flags ***/

Expand Down
13 changes: 12 additions & 1 deletion src/manuf/mcu_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ MCU_API_status_t MCU_API_get_voltage_temperature(sfx_u16 *voltage_idle_mv, sfx_u

#ifdef CERTIFICATION
/*******************************************************************/
MCU_API_status_t MCU_API_print(sfx_char *log_message) {
MCU_API_status_t MCU_API_print_dl_payload(sfx_u8 *dl_payload, sfx_u8 dl_payload_size, sfx_s16 rssi_dbm) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
Expand All @@ -212,6 +212,17 @@ MCU_API_status_t MCU_API_get_initial_pac(sfx_u8 *initial_pac, sfx_u8 initial_pac
}
#endif

#if (defined TIMER_REQUIRED) && (defined LATENCY_COMPENSATION) && (defined BIDIRECTIONAL)
/*******************************************************************/
MCU_API_status_t MCU_API_get_latency(MCU_API_latency_t latency_type, sfx_u32 *latency_ms) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
RETURN();
}
#endif

#ifdef VERBOSE
/*******************************************************************/
MCU_API_status_t MCU_API_get_version(sfx_u8 **version, sfx_u8 *version_size_char) {
Expand Down
2 changes: 1 addition & 1 deletion src/manuf/rf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ RF_API_status_t RF_API_carrier_sense(RF_API_carrier_sense_parameters_t *carrier_
}
#endif

#ifdef TIMER_REQUIRED
#if (defined TIMER_REQUIRED) && (defined LATENCY_COMPENSATION)
/*******************************************************************/
RF_API_status_t RF_API_get_latency(RF_API_latency_t latency_type, sfx_u32 *latency_ms) {
/* To be implemented by the device manufacturer */
Expand Down
Loading

0 comments on commit 91fd4ea

Please sign in to comment.