Skip to content

Commit

Permalink
v3.6 release. (Fixed PR #1 #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricB31 committed May 30, 2024
1 parent 990abce commit d528cca
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 40 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v3.6](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.6) - 30 May 2024

### Added

* Add weak attribute to functions templates.
* Add **SFX_UNUSED** macro to remove extra warnings.

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

### Added
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ project(sigfox_ep_lib)
# Define macro to manage the options
macro(opt TYPE FLAG DEFAULT DESC)
if(${TYPE} STREQUAL TYPE_BOOL)
option(${FLAG} ${DESC} ${DEFAULT})
#option(${FLAG} ${DESC} ${DEFAULT})
set(${FLAG} ${DEFAULT} CACHE STRING ${DESC})
set_property(CACHE ${FLAG} PROPERTY STRINGS ON OFF)
elseif(${TYPE} STREQUAL TYPE_VALUE)
set(${FLAG} ${DEFAULT} CACHE STRING ${DESC})
else()
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 "v2.0"
GIT_TAG "v2.1"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
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 "v2.0"
GIT_TAG "v3.1"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
Expand Down
2 changes: 1 addition & 1 deletion cmake/sx126x_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(
sx126x_rf_api
GIT_REPOSITORY "https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-semtech-sx126x"
GIT_TAG "v1.2"
GIT_TAG "v1.3"
GIT_PROGRESS TRUE
GIT_SHALLOW 1
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/addons/rfp
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.5"
#define SIGFOX_EP_LIB_VERSION "v3.6"

/*** Compilation flags ***/

Expand Down
3 changes: 2 additions & 1 deletion inc/sigfox_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ typedef enum {

/*** SIGFOX TYPES macros ***/

#define SFX_NULL (void*) 0
#define SFX_NULL ((void*) 0)
#define SFX_UNUSED(x) ((void) x)

// Sigfox credentials size.
#define SIGFOX_EP_ID_SIZE_BYTES 4
Expand Down
71 changes: 52 additions & 19 deletions src/manuf/mcu_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@

#if (defined ASYNCHRONOUS) || (defined LOW_LEVEL_OPEN_CLOSE)
/*******************************************************************/
MCU_API_status_t MCU_API_open(MCU_API_config_t *mcu_api_config) {
MCU_API_status_t __attribute__((weak)) MCU_API_open(MCU_API_config_t *mcu_api_config) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(mcu_api_config);
RETURN();
}
#endif

#ifdef LOW_LEVEL_OPEN_CLOSE
/*******************************************************************/
MCU_API_status_t MCU_API_close(void) {
MCU_API_status_t __attribute__((weak)) MCU_API_close(void) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
Expand All @@ -68,7 +69,7 @@ MCU_API_status_t MCU_API_close(void) {

#ifdef ASYNCHRONOUS
/*******************************************************************/
MCU_API_status_t MCU_API_process(void) {
MCU_API_status_t __attribute__((weak)) MCU_API_process(void) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
Expand All @@ -79,164 +80,196 @@ MCU_API_status_t MCU_API_process(void) {

#ifdef TIMER_REQUIRED
/*******************************************************************/
MCU_API_status_t MCU_API_timer_start(MCU_API_timer_t *timer) {
MCU_API_status_t __attribute__((weak)) MCU_API_timer_start(MCU_API_timer_t *timer) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(timer);
RETURN();
}
#endif

#ifdef TIMER_REQUIRED
/*******************************************************************/
MCU_API_status_t MCU_API_timer_stop(MCU_API_timer_instance_t timer_instance) {
MCU_API_status_t __attribute__((weak)) MCU_API_timer_stop(MCU_API_timer_instance_t timer_instance) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(timer_instance);
RETURN();
}
#endif

#if (defined TIMER_REQUIRED) && !(defined ASYNCHRONOUS)
/*******************************************************************/
MCU_API_status_t MCU_API_timer_status(MCU_API_timer_instance_t timer_instance, sfx_bool *timer_has_elapsed) {
MCU_API_status_t __attribute__((weak)) MCU_API_timer_status(MCU_API_timer_instance_t timer_instance, sfx_bool *timer_has_elapsed) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(timer_instance);
SFX_UNUSED(timer_has_elapsed);
RETURN();
}
#endif

#if (defined TIMER_REQUIRED) && !(defined ASYNCHRONOUS)
/*******************************************************************/
MCU_API_status_t MCU_API_timer_wait_cplt(MCU_API_timer_instance_t timer_instance) {
MCU_API_status_t __attribute__((weak)) MCU_API_timer_wait_cplt(MCU_API_timer_instance_t timer_instance) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(timer_instance);
RETURN();
}
#endif

/*******************************************************************/
MCU_API_status_t MCU_API_aes_128_cbc_encrypt(MCU_API_encryption_data_t *aes_data) {
MCU_API_status_t __attribute__((weak)) MCU_API_aes_128_cbc_encrypt(MCU_API_encryption_data_t *aes_data) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(aes_data);
RETURN();
}

#ifdef CRC_HW
/*******************************************************************/
MCU_API_status_t MCU_API_compute_crc16(sfx_u8 *data, sfx_u8 data_size, sfx_u16 polynom, sfx_u16 *crc) {
MCU_API_status_t __attribute__((weak)) MCU_API_compute_crc16(sfx_u8 *data, sfx_u8 data_size, sfx_u16 polynom, sfx_u16 *crc) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(data);
SFX_UNUSED(data_size);
SFX_UNUSED(polynom);
SFX_UNUSED(crc);
RETURN();
}
#endif

#if (defined CRC_HW) && (defined BIDIRECTIONAL)
/*******************************************************************/
MCU_API_status_t MCU_API_compute_crc8(sfx_u8 *data, sfx_u8 data_size, sfx_u16 polynom, sfx_u8 *crc) {
MCU_API_status_t __attribute__((weak)) MCU_API_compute_crc8(sfx_u8 *data, sfx_u8 data_size, sfx_u16 polynom, sfx_u8 *crc) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(data);
SFX_UNUSED(data_size);
SFX_UNUSED(polynom);
SFX_UNUSED(crc);
RETURN();
}
#endif

/*******************************************************************/
MCU_API_status_t MCU_API_get_ep_id(sfx_u8 *ep_id, sfx_u8 ep_id_size_bytes) {
MCU_API_status_t __attribute__((weak)) MCU_API_get_ep_id(sfx_u8 *ep_id, sfx_u8 ep_id_size_bytes) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(ep_id);
SFX_UNUSED(ep_id_size_bytes);
RETURN();
}

/*******************************************************************/
MCU_API_status_t MCU_API_get_nvm(sfx_u8 *nvm_data, sfx_u8 nvm_data_size_bytes) {
MCU_API_status_t __attribute__((weak)) MCU_API_get_nvm(sfx_u8 *nvm_data, sfx_u8 nvm_data_size_bytes) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(nvm_data);
SFX_UNUSED(nvm_data_size_bytes);
RETURN();
}

/*******************************************************************/
MCU_API_status_t MCU_API_set_nvm(sfx_u8 *nvm_data, sfx_u8 nvm_data_size_bytes) {
MCU_API_status_t __attribute__((weak)) MCU_API_set_nvm(sfx_u8 *nvm_data, sfx_u8 nvm_data_size_bytes) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(nvm_data);
SFX_UNUSED(nvm_data_size_bytes);
RETURN();
}

#if (defined CONTROL_KEEP_ALIVE_MESSAGE) || (defined BIDIRECTIONAL)
/*******************************************************************/
MCU_API_status_t MCU_API_get_voltage_temperature(sfx_u16 *voltage_idle_mv, sfx_u16 *voltage_tx_mv, sfx_s16 *temperature_tenth_degrees) {
MCU_API_status_t __attribute__((weak)) MCU_API_get_voltage_temperature(sfx_u16 *voltage_idle_mv, sfx_u16 *voltage_tx_mv, sfx_s16 *temperature_tenth_degrees) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(voltage_idle_mv);
SFX_UNUSED(voltage_tx_mv);
SFX_UNUSED(temperature_tenth_degrees);
RETURN();
}
#endif

#if (defined CERTIFICATION) && (defined BIDIRECTIONAL)
/*******************************************************************/
MCU_API_status_t MCU_API_print_dl_payload(sfx_u8 *dl_payload, sfx_u8 dl_payload_size, sfx_s16 rssi_dbm) {
MCU_API_status_t __attribute__((weak)) 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;
#endif
SFX_UNUSED(dl_payload);
SFX_UNUSED(dl_payload_size);
SFX_UNUSED(rssi_dbm);
RETURN();
}
#endif

#ifdef VERBOSE
/*******************************************************************/
MCU_API_status_t MCU_API_get_initial_pac(sfx_u8 *initial_pac, sfx_u8 initial_pac_size_bytes) {
MCU_API_status_t __attribute__((weak)) MCU_API_get_initial_pac(sfx_u8 *initial_pac, sfx_u8 initial_pac_size_bytes) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(initial_pac);
SFX_UNUSED(initial_pac_size_bytes);
RETURN();
}
#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) {
MCU_API_status_t __attribute__((weak)) 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
SFX_UNUSED(latency_type);
SFX_UNUSED(latency_ms);
RETURN();
}
#endif

#ifdef VERBOSE
/*******************************************************************/
MCU_API_status_t MCU_API_get_version(sfx_u8 **version, sfx_u8 *version_size_char) {
MCU_API_status_t __attribute__((weak)) MCU_API_get_version(sfx_u8 **version, sfx_u8 *version_size_char) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
MCU_API_status_t status = MCU_API_SUCCESS;
#endif
SFX_UNUSED(version);
SFX_UNUSED(version_size_char);
RETURN();
}
#endif

#ifdef ERROR_CODES
/*******************************************************************/
void MCU_API_error(void) {
void __attribute__((weak)) MCU_API_error(void) {
/* To be implemented by the device manufacturer */
}
#endif
Loading

0 comments on commit d528cca

Please sign in to comment.