Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Changes to build ArduinoIoTCloud Sketch #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: arduino
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libraries/SocketWrapper/SocketWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#include <zephyr/net/socket.h>

#include <api/Common.h>
#include <api/IPAddress.h>

class ZephyrSocketWrapper {
protected:
int sock_fd;
Expand Down
4 changes: 2 additions & 2 deletions libraries/SocketWrapper/ZephyrClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class ZephyrClient : public arduino::Client, ZephyrSocketWrapper {
return ret;
}
#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)
int connectSSL(const char* host, uint16_t port, char* cert) {
auto ret = ZephyrSocketWrapper::connectSSL((char*)host, port, cert);
int connectSSL(const char* host, uint16_t port, const char* cert) {
auto ret = ZephyrSocketWrapper::connectSSL((char*)host, port, (char*)cert);
if (ret) {
_connected = true;
}
Expand Down
9 changes: 7 additions & 2 deletions libraries/SocketWrapper/ZephyrSSLClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@

#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)
class ZephyrSSLClient : public ZephyrClient {
private:
const char* _cert = nullptr;

public:
int connect(const char* host, uint16_t port) override {
return connectSSL(host, port, nullptr);
return connectSSL(host, port, _cert);
}
int connect(const char* host, uint16_t port, char* cert) {
int connect(const char* host, uint16_t port, const char* cert) {
return connectSSL(host, port, cert);
}
void setCACert(const char* cert) {
_cert = cert;
}
};
#endif
23 changes: 15 additions & 8 deletions loader/llext_exports.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <zephyr/kernel.h>

#define FORCE_EXPORT_SYM(name) \
Expand Down Expand Up @@ -48,13 +49,21 @@ EXPORT_SYMBOL(isupper);
EXPORT_SYMBOL(islower);
EXPORT_SYMBOL(isxdigit);

EXPORT_SYMBOL(sin);
EXPORT_SYMBOL(cos);
EXPORT_SYMBOL(tan);
EXPORT_SYMBOL(atan);
EXPORT_SYMBOL(pow);
EXPORT_SYMBOL(atan2);
EXPORT_SYMBOL(atan2f);
EXPORT_SYMBOL(atanf);
EXPORT_SYMBOL(asinf);
EXPORT_SYMBOL(acosf);
EXPORT_SYMBOL(sqrt);
EXPORT_SYMBOL(sqrtf);
EXPORT_SYMBOL(ldexp);

EXPORT_SYMBOL(mktime);

EXPORT_SYMBOL(k_sched_lock);
EXPORT_SYMBOL(k_sched_unlock);
Expand Down Expand Up @@ -187,19 +196,15 @@ EXPORT_SYMBOL(k_work_schedule);
//FORCE_EXPORT_SYM(k_timer_user_data_set);
//FORCE_EXPORT_SYM(k_timer_start);

EXPORT_SYMBOL(sin);
EXPORT_SYMBOL(cos);
EXPORT_SYMBOL(tan);
EXPORT_SYMBOL(atan);
EXPORT_SYMBOL(pow);

EXPORT_SYMBOL(puts);
EXPORT_SYMBOL(putchar);
EXPORT_SYMBOL(printf);
EXPORT_SYMBOL(sprintf);
EXPORT_SYMBOL(snprintf);
EXPORT_SYMBOL(cbvprintf);
;
EXPORT_SYMBOL(sscanf);
EXPORT_SYMBOL(vsnprintf);

FORCE_EXPORT_SYM(abort);
#if defined(CONFIG_RING_BUFFER)
EXPORT_SYMBOL(ring_buf_get);
Expand Down Expand Up @@ -239,4 +244,6 @@ FORCE_EXPORT_SYM(__aeabi_dcmpge);

#if defined (CONFIG_CPP)
FORCE_EXPORT_SYM(__cxa_pure_virtual);
#endif
#endif

FORCE_EXPORT_SYM(__assert_no_args);
Loading