strategy:
fail-fast: false
matrix:
- revno: ["--mr v3.7-branch", "--mr v4.2.0"] # LTS, latest stable
+ revno: ["--mr v3.7-branch", "--mr v4.2.0", "--mr v4.3.0"] # LTS, latest stable
name: Zephyr ${{ matrix.revno }}
steps:
- uses: actions/checkout@v4
#elif MG_ARCH == MG_ARCH_PICOSDK
while (len--) *p++ = (unsigned char) (get_rand_32() & 255);
success = true;
+#elif MG_ARCH == MG_ARCH_ZEPHYR
+#if MG_TLS == MG_TLS_BUILTIN || \
+ (MG_TLS == MG_TLS_MBED && (!defined(MBEDTLS_VERSION_NUMBER) || \
+ MBEDTLS_VERSION_NUMBER < 0x04000000))
+ return (sys_csrand_get(buf, len) == 0); // do not fallback on reseed error
+#else
+ sys_rand_get(buf, len);
+ success = true;
+#endif
#elif MG_ARCH == MG_ARCH_WIN32
#if defined(_MSC_VER) && _MSC_VER < 1700
static bool initialised = false;
#include <zephyr/kernel.h>
#include <zephyr/version.h>
-
-#include <ctype.h>
-#include <errno.h>
#include <zephyr/net/socket.h>
+//#include <zephyr/posix/dirent.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/posix/sys/select.h>
+#include <zephyr/random/random.h>
+
+
+#include <ctype.h>
+#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/version.h>
-
-#include <ctype.h>
-#include <errno.h>
#include <zephyr/net/socket.h>
+//#include <zephyr/posix/dirent.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/posix/sys/select.h>
+#include <zephyr/random/random.h>
+
+
+#include <ctype.h>
+#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#elif MG_ARCH == MG_ARCH_PICOSDK
while (len--) *p++ = (unsigned char) (get_rand_32() & 255);
success = true;
+#elif MG_ARCH == MG_ARCH_ZEPHYR
+#if MG_TLS == MG_TLS_BUILTIN || \
+ (MG_TLS == MG_TLS_MBED && (!defined(MBEDTLS_VERSION_NUMBER) || \
+ MBEDTLS_VERSION_NUMBER < 0x04000000))
+ return (sys_csrand_get(buf, len) == 0); // do not fallback on reseed error
+#else
+ sys_rand_get(buf, len);
+ success = true;
+#endif
#elif MG_ARCH == MG_ARCH_WIN32
#if defined(_MSC_VER) && _MSC_VER < 1700
static bool initialised = false;