Skip to content

Commit

Permalink
v3.5 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovic-Lesur committed Mar 22, 2024
1 parent 8c0c655 commit 990abce
Show file tree
Hide file tree
Showing 20 changed files with 775 additions and 454 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v3.5](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.5) - 22 Mar 2024

### Added

* Add `sigfox_rc.c` and `sigfox_types.c` files to define constants and optimize memory footprint when including these files multiple times (**extern** instead of **static**).
* Add **SX126X RF API** support in cmake.

### Fixed

* Add **missing NVM writing operation** in case of error during message transmission.
* Add **missing cast** on temperature field computation for control frames.
* Fix **compilation issue** in `SIGFOX_EP_API_open()` function.
* Fix **compilation issue** in bitstream driver.

### Changed

* Rename `RCx` compilation flags into `RCx_ZONE` for **Microchip MCUs compatibility**.

### Removed

* Remove EP-ID check when using test API.

## [v3.4](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.4) - 09 Nov 2023

### Added
Expand Down
45 changes: 29 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ endmacro()
set(LIB_SOURCES
src/sigfox_ep_api.c
src/sigfox_error.c
src/sigfox_rc.c
src/sigfox_types.c
src/core/sigfox_crc.c
src/core/sigfox_ep_bitstream.c
src/core/sigfox_ep_frequency.c
Expand Down Expand Up @@ -90,19 +92,27 @@ if(NOT lr11xx_rf_api_IS_TOP_LEVEL)
else()
list(REMOVE_ITEM MANUF_SOURCES "src/manuf/rf_api.c")
endif()
if(NOT sx126x_rf_api_IS_TOP_LEVEL)
opt(TYPE_BOOL SX126X_RF_API OFF "Add SX126X RF API contents to build it with library")
if(SX126X_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")
list(APPEND DEF_FLAG_LIST "-DUSE_SIGFOX_EP_FLAGS_H")
list(APPEND LIB_HEADERS "inc/sigfox_ep_flags.h")
unset(RC1 CACHE)
unset(RC2 CACHE)
unset(RC3C CACHE)
unset(RC3D CACHE)
unset(RC4 CACHE)
unset(RC5 CACHE)
unset(RC6 CACHE)
unset(RC7 CACHE)
unset(RC1_ZONE CACHE)
unset(RC2_ZONE CACHE)
unset(RC3C_ZONE CACHE)
unset(RC3D_ZONE CACHE)
unset(RC4_ZONE CACHE)
unset(RC5_ZONE CACHE)
unset(RC6_ZONE CACHE)
unset(RC7_ZONE CACHE)
unset(APPLICATION_MESSAGES CACHE)
unset(CONTROL_KEEP_ALIVE_MESSAGE CACHE)
unset(BIDIRECTIONAL CACHE)
Expand All @@ -126,14 +136,14 @@ if(${USE_SIGFOX_EP_FLAGS_H} STREQUAL "ON")
unset(MESSAGE_COUNTER_ROLLOVER CACHE)
unset(ERROR_STACK CACHE)
else()
opt(TYPE_BOOL RC1 ON "Support RC1 (Europe, Middle-East and Africa)")
opt(TYPE_BOOL RC2 ON "Support RC2 (Brazil, Canada, Mexico, Puerto Rico and USA)")
opt(TYPE_BOOL RC3C ON "Support RC3C with LBT (Japan)")
opt(TYPE_BOOL RC3D ON "Support RC3D with DC (Japan)")
opt(TYPE_BOOL RC4 ON "Support RC4 (Latin America and Asia Pacific)")
opt(TYPE_BOOL RC5 ON "Support RC5 (South-Corea)")
opt(TYPE_BOOL RC6 ON "Support RC6 (India)")
opt(TYPE_BOOL RC7 ON "Support RC7 (Russia)")
opt(TYPE_BOOL RC1_ZONE ON "Support RC1 (Europe, Middle-East and Africa)")
opt(TYPE_BOOL RC2_ZONE ON "Support RC2 (Brazil, Canada, Mexico, Puerto Rico and USA)")
opt(TYPE_BOOL RC3C_ZONE ON "Support RC3C with LBT (Japan)")
opt(TYPE_BOOL RC3D_ZONE ON "Support RC3D with DC (Japan)")
opt(TYPE_BOOL RC4_ZONE ON "Support RC4 (Latin America and Asia Pacific)")
opt(TYPE_BOOL RC5_ZONE ON "Support RC5 (South-Corea)")
opt(TYPE_BOOL RC6_ZONE ON "Support RC6 (India)")
opt(TYPE_BOOL RC7_ZONE ON "Support RC7 (Russia)")
opt(TYPE_BOOL APPLICATION_MESSAGES ON "Support uplink application messages")
opt(TYPE_BOOL CONTROL_KEEP_ALIVE_MESSAGE ON "Support uplink control keep alive message")
opt(TYPE_BOOL BIDIRECTIONAL ON "Support downlink communication")
Expand Down Expand Up @@ -209,6 +219,9 @@ endif()
if(LR11XX_RF_API)
include(lr11xx_rf_api)
endif()
if(SX126X_RF_API)
include(sx126x_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
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Below is the list of available flags.

| **Flag name** | **Value** | **Description** |
|:---:|:---:|:---:|
| `RCx` | `undefined` / `defined` | Support the RCx radio configuration if defined. |
| `RCx_ZONE` | `undefined` / `defined` | Support the RCx radio configuration if defined. |
| `APPLICATION_MESSAGES` | `undefined` / `defined` | Support uplink application messages if defined. |
| `CONTROL_KEEP_ALIVE_MESSAGE` | `undefined` / `defined` | Support uplink control keep alive message if defined. |
| `BIDIRECTIONAL` | `undefined` / `defined` | Support bidirectional procedure (downlink) if defined. Only applicable to application messages. Otherwise all messages will be uplink only. |
Expand Down Expand Up @@ -138,14 +138,14 @@ make precompil

```bash
cmake -DUSE_SIGFOX_EP_FLAGS_H=OFF \
-DRC1=ON \
-DRC2=ON \
-DRC3C=ON \
-DRC3D=ON \
-DRC4=ON \
-DRC5=ON \
-DRC6=ON \
-DRC7=ON \
-DRC1_ZONE=ON \
-DRC2_ZONE=ON \
-DRC3C_ZONE=ON \
-DRC3D_ZONE=ON \
-DRC4_ZONE=ON \
-DRC5_ZONE=ON \
-DRC6_ZONE=ON \
-DRC7_ZONE=ON \
-DAPPLICATION_MESSAGES=ON \
-DCONTROL_KEEP_ALIVE_MESSAGE=ON \
-DBIDIRECTIONAL=ON \
Expand Down Expand Up @@ -198,14 +198,14 @@ make sigfox_ep_lib

```bash
cmake -DUSE_SIGFOX_EP_FLAGS_H=OFF \
-DRC1=ON \
-DRC2=ON \
-DRC3C=ON \
-DRC3D=ON \
-DRC4=ON \
-DRC5=ON \
-DRC6=ON \
-DRC7=ON \
-DRC1_ZONE=ON \
-DRC2_ZONE=ON \
-DRC3C_ZONE=ON \
-DRC3D_ZONE=ON \
-DRC4_ZONE=ON \
-DRC5_ZONE=ON \
-DRC6_ZONE=ON \
-DRC7_ZONE=ON \
-DAPPLICATION_MESSAGES=ON \
-DCONTROL_KEEP_ALIVE_MESSAGE=ON \
-DBIDIRECTIONAL=ON \
Expand Down Expand Up @@ -280,3 +280,13 @@ cmake <all previous flags> -DLR11XX_RF_API=ON ..
make precompil_lr11xx_rf_api
make lr11xx_rf_api
```

### Semtech SX126X

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

```bash
cmake <all previous flags> -DSX126X_RF_API=ON ..
make precompil_sx126x_rf_api
make sx126x_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.4"
GIT_TAG "v1.5"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
Expand Down
2 changes: 1 addition & 1 deletion cmake/addon_ta.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
addon_ta
GIT_REPOSITORY "https://github.com/sigfox-tech-radio/sigfox-ep-addon-ta"
GIT_TAG "v1.0"
GIT_TAG "v1.1"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/ta
Expand Down
2 changes: 1 addition & 1 deletion cmake/lr11xx_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(
lr11xx_rf_api
GIT_REPOSITORY "https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-semtech-lr11xx"
GIT_TAG "v1.2"
GIT_TAG "v2.0"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
Expand Down
2 changes: 1 addition & 1 deletion cmake/precompile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(${X} STREQUAL "inc/sigfox_types.h" AND ${USE_SIGFOX_EP_FLAGS_H} STREQUAL "OFF
DEPENDS ${LIB_HEADERS}
COMMAND ${CMAKE_COMMAND} -E make_directory ${PRECOMPIL_DIR}/inc/core ${PRECOMPIL_DIR}/inc/manuf
COMMAND unifdef -B -k -x 2 -f ${CMAKE_BINARY_DIR}/undefs_file -f ${CMAKE_BINARY_DIR}/defs_file ${PROJECT_SOURCE_DIR}/${X} > "${PRECOMPIL_DIR}/${X}"
COMMAND sed -i "/SIGFOX library common macros/a ${DEF_FLAG_STRING}" ${PRECOMPIL_DIR}/${X}
COMMAND sed -i "/SIGFOX TYPES second-level/a ${DEF_FLAG_STRING}" ${PRECOMPIL_DIR}/${X}
VERBATIM
)
else()
Expand Down
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.3"
GIT_TAG "v2.0"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
Expand Down
21 changes: 21 additions & 0 deletions cmake/sx126x_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(
sx126x_rf_api
GIT_REPOSITORY "https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-semtech-sx126x"
GIT_TAG "v1.2"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
UPDATE_DISCONNECTED TRUE
STEP_TARGETS update
)
FetchContent_GetProperties(sx126x_rf_api)
if (NOT platform_POPULATED)
FetchContent_Populate(sx126x_rf_api)
add_subdirectory(${sx126x_rf_api_SOURCE_DIR} ${sx126x_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_S_RF_API FETCHCONTENT_UPDATES_DISCONNECTED_SX126X_RF_API)
#FetchContent_MakeAvailable(addon_rfp)
18 changes: 11 additions & 7 deletions inc/core/sigfox_tx_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ typedef enum {
typedef void SIGFOX_TX_CONTROL_status_t;
#endif

typedef enum {
SIGFOX_TX_CONTROL_RESULT_ALLOWED,
SIGFOX_TX_CONTROL_RESULT_FORBIDDEN,
SIGFOX_TX_CONTROL_RESULT_PENDING,
SIGFOX_TX_CONTROL_RESULT_LAST
} SIGFOX_TX_CONTROL_result_t;

#ifdef ASYNCHRONOUS
/*!******************************************************************
* \brief Sigfox TX control driver callback functions.
Expand All @@ -83,6 +76,17 @@ typedef void (*SIGFOX_TX_CONTROL_process_cb_t)(void);
typedef void (*SIGFOX_TX_CONTROL_check_cplt_cb_t)(void);
#endif

/*!******************************************************************
* \enum SIGFOX_TX_CONTROL_result_t
* \brief Sigfox TX control results list.
*******************************************************************/
typedef enum {
SIGFOX_TX_CONTROL_RESULT_ALLOWED,
SIGFOX_TX_CONTROL_RESULT_FORBIDDEN,
SIGFOX_TX_CONTROL_RESULT_PENDING,
SIGFOX_TX_CONTROL_RESULT_LAST
} SIGFOX_TX_CONTROL_result_t;

/*!******************************************************************
* \enum SIGFOX_TX_CONTROL_check_type
* \brief TX control check type.
Expand Down
6 changes: 5 additions & 1 deletion inc/sigfox_ep_api_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@

/*** SIGFOX EP API TEST structures ***/

/*!******************************************************************
* \union SIGFOX_EP_API_TEST_flags_t
* \brief Specific flags for test.
*******************************************************************/
typedef union {
struct {
sfx_u8 ul_enable : 1; // Enable or disable uplink part of a message sequence.
Expand All @@ -70,7 +74,7 @@ typedef union {

/*!******************************************************************
* \struct SIGFOX_EP_API_TEST_parameters_t
* \brief Specific parameters for test (RFP ADDON).
* \brief Specific parameters for test.
*******************************************************************/
typedef struct {
SIGFOX_EP_API_TEST_flags_t flags;
Expand Down
16 changes: 8 additions & 8 deletions inc/sigfox_ep_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@

/*** Library compilation flags ***/

#define RC1 /*!< \brief Support radio configuration zone 1 (Europe, Middle-East and Africa). > */
#define RC2 /*!< \brief Support radio configuration zone 2 (Brazil, Canada, Mexico, Puerto Rico and USA). > */
#define RC3C /*!< \brief Support radio configuration zone 3 (Japan) with LBT. > */
#define RC3D /*!< \brief Support radio configuration zone 3 (Japan) with DC. */
#define RC4 /*!< \brief Support radio configuration zone 4 (Latin America and Asia Pacific). > */
#define RC5 /*!< \brief Support radio configuration zone 5 (South-Corea). > */
#define RC6 /*!< \brief Support radio configuration zone 6 (India). > */
#define RC7 /*!< \brief Support radio configuration zone 7 (Russia). > */
#define RC1_ZONE /*!< \brief Support radio configuration zone 1 (Europe, Middle-East and Africa). > */
#define RC2_ZONE /*!< \brief Support radio configuration zone 2 (Brazil, Canada, Mexico, Puerto Rico and USA). > */
#define RC3C_ZONE /*!< \brief Support radio configuration zone 3 (Japan) with LBT. > */
#define RC3D_ZONE /*!< \brief Support radio configuration zone 3 (Japan) with DC. */
#define RC4_ZONE /*!< \brief Support radio configuration zone 4 (Latin America and Asia Pacific). > */
#define RC5_ZONE /*!< \brief Support radio configuration zone 5 (South-Corea). > */
#define RC6_ZONE /*!< \brief Support radio configuration zone 6 (India). > */
#define RC7_ZONE /*!< \brief Support radio configuration zone 7 (Russia). > */

#define APPLICATION_MESSAGES /*!< \brief Support uplink application messages if defined. > */
#define CONTROL_KEEP_ALIVE_MESSAGE /*!< \brief Support uplink control keep alive message if defined. > */
Expand Down
Loading

0 comments on commit 990abce

Please sign in to comment.