diff --git a/CMock b/CMock index 8b59a0d..4f94b71 160000 --- a/CMock +++ b/CMock @@ -1 +1 @@ -Subproject commit 8b59a0d868ec418682960d5ae696637fdf20c0aa +Subproject commit 4f94b7195f69194e465dec1a95c6415d6966890b diff --git a/Makefile b/Makefile index c81a2df..9aa9bb0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -# Source, copyright: https://github.com/viva64/pvs-studio-makefile-examples -# commit 82a0f0a, /example-1 -# Modified for C on mac, added Doxygen # Apache License # Version 2.0, January 2004 # http://www.apache.org/licenses/ @@ -214,7 +211,7 @@ OFLAGS = -g3 LDFLAGS = DFLAGS = -INCLUDES += src/ +INCLUDES += src INCLUDES += ./CMock/vendor/unity/src INCLUDES += ./build/test/mocks INC_PARAMS = $(foreach d, $(INCLUDES), -I$d) @@ -253,6 +250,20 @@ TEST_MAKEFILE_EXT_ADV_MAX = ${BUILD_DIR}_ext_adv_max/MakefileTestSupport all: clean astyle doxygen sonar +# Specify all tests as dependencies of 'all' (workaround for JetBrains CLion) +# It is needed because on the first scan of Makefile the $(TEST_MAKEFILE) does not exist and it is not included. +all: test_ruuvi_endpoint_3 \ + test_ruuvi_endpoint_5 \ + test_ruuvi_endpoint_6 \ + test_ruuvi_endpoint_8 \ + test_ruuvi_endpoint_c5 \ + test_ruuvi_endpoint_ca_uart \ + test_ruuvi_endpoint_e0 \ + test_ruuvi_endpoint_f0 \ + test_ruuvi_endpoint_fa \ + test_ruuvi_endpoint_ibeacon \ + test_ruuvi_endpoints + doxygen: clean doxygen diff --git a/src/ruuvi_endpoint_ca_uart.c b/src/ruuvi_endpoint_ca_uart.c index 0d79427..1cca10b 100644 --- a/src/ruuvi_endpoint_ca_uart.c +++ b/src/ruuvi_endpoint_ca_uart.c @@ -387,12 +387,12 @@ static re_status_t re_ca_uart_decode_set_all_params ( + RE_CA_UART_CMD_FLTR_ID_LEN]; payload->params.all_params.bools.fltr_tags.state = (flags >> RE_CA_UART_ALL_FLTR_TAG_BIT) & 1U; - payload->params.all_params.bools.coded_phy.state = - (flags >> RE_CA_UART_ALL_CODED_PHY_BIT) & 1U; - payload->params.all_params.bools.scan_phy.state = - (flags >> RE_CA_UART_ALL_SCAN_PHY_BIT) & 1U; - payload->params.all_params.bools.ext_payload.state = - (flags >> RE_CA_UART_ALL_EXT_PLD_BIT) & 1U; + payload->params.all_params.bools.use_coded_phy.state = + (flags >> RE_CA_UART_ALL_USE_CODED_PHY_BIT) & 1U; + payload->params.all_params.bools.use_1m_phy.state = + (flags >> RE_CA_UART_ALL_USE_1M_PHY_BIT) & 1U; + payload->params.all_params.bools.use_2m_phy.state = + (flags >> RE_CA_UART_ALL_USE_2M_PHY_BIT) & 1U; payload->params.all_params.bools.ch_37.state = (flags >> RE_CA_UART_ALL_CH_37_BIT) & 1U; payload->params.all_params.bools.ch_38.state = @@ -953,12 +953,12 @@ static re_status_t re_ca_uart_encode_set_all_params (uint8_t * const buffer, buffer[written++] = RE_CA_UART_FIELD_DELIMITER; buffer[written] = ( ( (payload->params.all_params.bools.fltr_tags.state & 1U) << RE_CA_UART_ALL_FLTR_TAG_BIT) - | ( (payload->params.all_params.bools.coded_phy.state & 1U) - << RE_CA_UART_ALL_CODED_PHY_BIT) - | ( (payload->params.all_params.bools.scan_phy.state & 1U) - << RE_CA_UART_ALL_SCAN_PHY_BIT) - | ( (payload->params.all_params.bools.ext_payload.state & 1U) - << RE_CA_UART_ALL_EXT_PLD_BIT) + | ( (payload->params.all_params.bools.use_coded_phy.state & 1U) + << RE_CA_UART_ALL_USE_CODED_PHY_BIT) + | ( (payload->params.all_params.bools.use_1m_phy.state & 1U) + << RE_CA_UART_ALL_USE_1M_PHY_BIT) + | ( (payload->params.all_params.bools.use_2m_phy.state & 1U) + << RE_CA_UART_ALL_USE_2M_PHY_BIT) | ( (payload->params.all_params.bools.ch_37.state & 1U) << RE_CA_UART_ALL_CH_37_BIT) | ( (payload->params.all_params.bools.ch_38.state & 1U) diff --git a/src/ruuvi_endpoint_ca_uart.h b/src/ruuvi_endpoint_ca_uart.h index ae97a16..9b22da0 100644 --- a/src/ruuvi_endpoint_ca_uart.h +++ b/src/ruuvi_endpoint_ca_uart.h @@ -89,15 +89,15 @@ #define RE_CA_UART_ACK_BYTE (1U) //!< Byte of bool params, starting from 0. #define RE_CA_UART_ACK_BIT (0U) //!< Bit of bool params, starting from 0. -#define RE_CA_UART_FLTR_ID_BYTE (2U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_BOOL_BYTE (1U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_FLTR_TAG_BIT (0U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_CODED_PHY_BIT (1U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_SCAN_PHY_BIT (2U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_EXT_PLD_BIT (3U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_CH_37_BIT (4U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_CH_38_BIT (5U) //!< Byte of bool params, starting from 0. -#define RE_CA_UART_ALL_CH_39_BIT (6U) //!< Byte of bool params, starting from 0. +#define RE_CA_UART_FLTR_ID_BYTE (2U) //!< Byte of bool params, starting from 0. +#define RE_CA_UART_ALL_BOOL_BYTE (1U) //!< Byte of bool params, starting from 0. +#define RE_CA_UART_ALL_FLTR_TAG_BIT (0U) //!< Bit of bool params, starting from 0. +#define RE_CA_UART_ALL_USE_CODED_PHY_BIT (1U) //!< Bit of bool params, starting from 0. +#define RE_CA_UART_ALL_USE_1M_PHY_BIT (2U) //!< Bit of bool params, starting from 0. +#define RE_CA_UART_ALL_USE_2M_PHY_BIT (3U) //!< Bit of bool params, starting from 0. +#define RE_CA_UART_ALL_CH_37_BIT (4U) //!< Bit of bool params, starting from 0. +#define RE_CA_UART_ALL_CH_38_BIT (5U) //!< Bit of bool params, starting from 0. +#define RE_CA_UART_ALL_CH_39_BIT (6U) //!< Bit of bool params, starting from 0. #define RE_CA_UART_STX_ETX_LEN (1U) //!< Length of cmd with bool payload #define RE_CA_UART_DEVICE_ID_LEN (8U) //!< Length of device id payload @@ -315,9 +315,9 @@ typedef struct typedef struct { re_ca_uart_ble_bool_t fltr_tags; //!< Filter tag bool state. - re_ca_uart_ble_bool_t coded_phy; //!< Coded phy bool state. - re_ca_uart_ble_bool_t scan_phy; //!< Scanned phy bool state. - re_ca_uart_ble_bool_t ext_payload; //!< Pyload extension bool state. + re_ca_uart_ble_bool_t use_coded_phy;//!< Use BLE Coded PHY bool state. + re_ca_uart_ble_bool_t use_1m_phy; //!< Use BLE 1M PHY bool state. + re_ca_uart_ble_bool_t use_2m_phy; //!< Use BLE 2M PHY bool state. re_ca_uart_ble_bool_t ch_37; //!< Channel 37 bool state. re_ca_uart_ble_bool_t ch_38; //!< Channel 38 bool state. re_ca_uart_ble_bool_t ch_39; //!< Channel 39 bool state. diff --git a/test/test_ruuvi_endpoint_ca_uart.c b/test/test_ruuvi_endpoint_ca_uart.c index f8487b9..e072934 100644 --- a/test/test_ruuvi_endpoint_ca_uart.c +++ b/test/test_ruuvi_endpoint_ca_uart.c @@ -349,9 +349,9 @@ void test_ruuvi_endpoint_ca_uart_set_all_params_encode (void) re_ca_uart_ble_all_t params = {0}; params.fltr_id.id = 0x101; params.bools.fltr_tags.state = 1; - params.bools.coded_phy.state = 1; - params.bools.scan_phy.state = 1; - params.bools.ext_payload.state = 1; + params.bools.use_coded_phy.state = 1; + params.bools.use_1m_phy.state = 1; + params.bools.use_2m_phy.state = 1; params.bools.ch_37.state = 1; params.bools.ch_38.state = 1; params.bools.ch_39.state = 1; @@ -391,9 +391,9 @@ void test_ruuvi_endpoint_ca_uart_set_all_params_with_max_adv_len_encode (void) re_ca_uart_ble_all_t params = {0}; params.fltr_id.id = 0x101; params.bools.fltr_tags.state = 1; - params.bools.coded_phy.state = 1; - params.bools.scan_phy.state = 1; - params.bools.ext_payload.state = 1; + params.bools.use_coded_phy.state = 1; + params.bools.use_1m_phy.state = 1; + params.bools.use_2m_phy.state = 1; params.bools.ch_37.state = 1; params.bools.ch_38.state = 1; params.bools.ch_39.state = 1; @@ -431,9 +431,9 @@ void test_ruuvi_endpoint_ca_uart_all_encode_invalid (void) re_ca_uart_ble_all_t params = {0}; params.fltr_id.id = 0x101; params.bools.fltr_tags.state = 1; - params.bools.coded_phy.state = 1; - params.bools.scan_phy.state = 1; - params.bools.ext_payload.state = 1; + params.bools.use_coded_phy.state = 1; + params.bools.use_1m_phy.state = 1; + params.bools.use_2m_phy.state = 1; params.bools.ch_37.state = 1; params.bools.ch_38.state = 1; params.bools.ch_39.state = 1; @@ -1329,9 +1329,9 @@ void test_ruuvi_endpoint_ca_uart_set_all_params_decode (void) re_ca_uart_ble_all_t expect_params = {0}; expect_params.fltr_id.id = 0x101; expect_params.bools.fltr_tags.state = 1; - expect_params.bools.coded_phy.state = 1; - expect_params.bools.scan_phy.state = 1; - expect_params.bools.ext_payload.state = 1; + expect_params.bools.use_coded_phy.state = 1; + expect_params.bools.use_1m_phy.state = 1; + expect_params.bools.use_2m_phy.state = 1; expect_params.bools.ch_37.state = 1; expect_params.bools.ch_38.state = 1; expect_params.bools.ch_39.state = 1; @@ -1366,9 +1366,9 @@ void test_ruuvi_endpoint_ca_uart_set_all_params_with_max_adv_len_decode (void) re_ca_uart_ble_all_t expect_params = {0}; expect_params.fltr_id.id = 0x101; expect_params.bools.fltr_tags.state = 1; - expect_params.bools.coded_phy.state = 1; - expect_params.bools.scan_phy.state = 1; - expect_params.bools.ext_payload.state = 1; + expect_params.bools.use_coded_phy.state = 1; + expect_params.bools.use_1m_phy.state = 1; + expect_params.bools.use_2m_phy.state = 1; expect_params.bools.ch_37.state = 1; expect_params.bools.ch_38.state = 1; expect_params.bools.ch_39.state = 1; @@ -1400,9 +1400,9 @@ void test_ruuvi_endpoint_ca_uart_all_decode_invalid (void) re_ca_uart_ble_all_t expect_params = {0}; expect_params.fltr_id.id = 0x101; expect_params.bools.fltr_tags.state = 1; - expect_params.bools.coded_phy.state = 0; - expect_params.bools.scan_phy.state = 0; - expect_params.bools.ext_payload.state = 0; + expect_params.bools.use_coded_phy.state = 0; + expect_params.bools.use_1m_phy.state = 0; + expect_params.bools.use_2m_phy.state = 0; expect_params.bools.ch_37.state = 0; expect_params.bools.ch_38.state = 0; expect_params.bools.ch_39.state = 0;