diff --git a/script/check-posix-build-autotools b/script/check-posix-build-autotools index 17cf4ad11..67522519a 100755 --- a/script/check-posix-build-autotools +++ b/script/check-posix-build-autotools @@ -42,6 +42,15 @@ build() if [[ $OSTYPE != "darwin"* ]]; then reset_source make -f src/posix/Makefile-posix RCP_RESTORATION_MAX_COUNT=2 RCP_BUS=spi + + reset_source + ./tests/toranj/build.sh posix + + reset_source + ./tests/toranj/build.sh posix-15.4+trel + + reset_source + ./tests/toranj/build.sh posix-trel fi } diff --git a/script/check-posix-build-cmake b/script/check-posix-build-cmake index 84649cdbf..11d8b95a7 100755 --- a/script/check-posix-build-cmake +++ b/script/check-posix-build-cmake @@ -45,6 +45,13 @@ build() ) "$(dirname "$0")"/cmake-build posix "${options[@]}" + + options+=( + "-DOT_TREL=ON" + ) + + reset_source + "$(dirname "$0")"/cmake-build posix "${options[@]}" } main() diff --git a/src/posix/platform/trel_udp6.cpp b/src/posix/platform/trel_udp6.cpp index 5710f12f8..d18684377 100644 --- a/src/posix/platform/trel_udp6.cpp +++ b/src/posix/platform/trel_udp6.cpp @@ -109,12 +109,12 @@ static const char *BufferToString(const uint8_t *aBuffer, uint16_t aLength) char * cur = &string[0]; char * end = &string[sizeof(string) - 1]; - cur += snprintf(cur, end - cur, "[(len:%d) ", aLength); + cur += snprintf(cur, (uint16_t)(end - cur), "[(len:%d) ", aLength); VerifyOrExit(cur < end); while (aLength-- && (num < kMaxWrite)) { - cur += snprintf(cur, end - cur, "%02x ", *aBuffer++); + cur += snprintf(cur, (uint16_t)(end - cur), "%02x ", *aBuffer++); VerifyOrExit(cur < end); num++; @@ -122,7 +122,7 @@ static const char *BufferToString(const uint8_t *aBuffer, uint16_t aLength) if (aLength != 0) { - cur += snprintf(cur, end - cur, "... "); + cur += snprintf(cur, (uint16_t)(end - cur), "... "); VerifyOrExit(cur < end); } @@ -168,7 +168,7 @@ static void UpdateUnicastAddress(const otIp6Address *aUnicastAddress, bool aToAd request.ifa.ifa_prefixlen = TREL_UNICAST_ADDRESS_PREFIX_LEN; request.ifa.ifa_flags = IFA_F_NODAD; request.ifa.ifa_scope = TREL_UNICAST_ADDRESS_SCOPE; - request.ifa.ifa_index = sInterfaceIndex; + request.ifa.ifa_index = (unsigned int)(sInterfaceIndex); rta = reinterpret_cast((reinterpret_cast(&request)) + NLMSG_ALIGN(request.nh.nlmsg_len)); rta->rta_type = IFA_LOCAL; diff --git a/tests/toranj/build.sh b/tests/toranj/build.sh index 3dd4dde5d..adcb71c32 100755 --- a/tests/toranj/build.sh +++ b/tests/toranj/build.sh @@ -100,6 +100,14 @@ configure_options=( "--enable-ncp" ) +posix_configure_options=( + "--disable-docs" + "--enable-tests=$tests" + "--enable-coverage=$coverage" + "--enable-ftd" + "--enable-cli" +) + if [ -n "${top_builddir}" ]; then top_srcdir=$(pwd) mkdir -p "${top_builddir}" @@ -202,7 +210,7 @@ case ${build_config} in ${top_srcdir}/configure \ CPPFLAGS="$cppflags_config" \ --with-platform=posix \ - "${configure_options[@]}" || die + "${posix_configure_options[@]}" || die make -j 8 || die ;; @@ -218,7 +226,7 @@ case ${build_config} in ${top_srcdir}/configure \ CPPFLAGS="$cppflags_config" \ --with-platform=posix \ - "${configure_options[@]}" || die + "${posix_configure_options[@]}" || die make -j 8 || die ;; @@ -234,7 +242,7 @@ case ${build_config} in ${top_srcdir}/configure \ CPPFLAGS="$cppflags_config" \ --with-platform=posix \ - "${configure_options[@]}" || die + "${posix_configure_options[@]}" || die make -j 8 || die ;; @@ -250,7 +258,7 @@ case ${build_config} in ${top_srcdir}/configure \ CPPFLAGS="$cppflags_config" \ --with-platform=posix \ - "${configure_options[@]}" || die + "${posix_configure_options[@]}" || die make -j 8 || die ;; diff --git a/tests/toranj/openthread-core-toranj-config-posix.h b/tests/toranj/openthread-core-toranj-config-posix.h index fb411377b..8a2c58fbb 100644 --- a/tests/toranj/openthread-core-toranj-config-posix.h +++ b/tests/toranj/openthread-core-toranj-config-posix.h @@ -45,6 +45,14 @@ */ #define OPENTHREAD_CONFIG_PLATFORM_INFO "POSIX-toranj" +/** + * @def OPENTHREAD_CONFIG_LOG_OUTPUT + * + * Selects if, and where the LOG output goes to. + * + */ +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED + /** * @def OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE * diff --git a/tests/toranj/openthread-core-toranj-config-simulation.h b/tests/toranj/openthread-core-toranj-config-simulation.h index 7b6887375..ea97044b1 100644 --- a/tests/toranj/openthread-core-toranj-config-simulation.h +++ b/tests/toranj/openthread-core-toranj-config-simulation.h @@ -59,4 +59,12 @@ */ #define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1 +/** + * @def OPENTHREAD_CONFIG_LOG_OUTPUT + * + * Selects if, and where the LOG output goes to. + * + */ +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP + #endif /* OPENTHREAD_CORE_TORANJ_CONFIG_SIMULATION_H_ */ diff --git a/tests/toranj/openthread-core-toranj-config.h b/tests/toranj/openthread-core-toranj-config.h index 18c30723b..bd4d063d1 100644 --- a/tests/toranj/openthread-core-toranj-config.h +++ b/tests/toranj/openthread-core-toranj-config.h @@ -256,14 +256,6 @@ */ #define OPENTHREAD_CONFIG_MAC_FILTER_SIZE 80 -/** - * @def OPENTHREAD_CONFIG_LOG_OUTPUT - * - * Selects if, and where the LOG output goes to. - * - */ -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP - /** * @def OPENTHREAD_CONFIG_LOG_LEVEL *