Can I include the libraries downloaded with arduino support package directly into my IO device builder block

18 ビュー (過去 30 日間)
Hello Mathworks community,
So I wanted to build a custom simulink block to connect my ESP32 to AWS using IO device builder. some libraries I'm going to need are WiFi and WiFiClientSecure; which are libraries usually included with the ESP32 core and don't need external files to be added. and indeed when I navigate into the files of the support package these libraries are there. but I have found no way of including them into my code without copying the files into my custom block directory.
so my question is: is there a way to directly include them in my code?

回答 (1 件)

Aravind
Aravind 2024 年 11 月 26 日 6:48
The core libraries that come with the Arduino Support Package can be directly included in the generated code of the "IO Device Builder" app, so there is no need to manually add or copy these library files into the custom block directory.
In fact, manually adding such libraries can lead to conflicts with the core libraries in the support package, resulting in unexpected behavior. The "IO Device Builder" app is intended for including only external libraries that are not already part of the support package.
Since "WiFi.h" and "WiFiClientSecure.h" are core libraries included in the support package, you can simply use them in the generated ".CPP" file by adding these lines at the top of the file:
#include "WiFi.h"
#include "WiFiClientSecure.h"
I hope this clears up your question.
  1 件のコメント
Abdussamad Mohammed
Abdussamad Mohammed 2024 年 12 月 3 日 14:57
well, that's exactly what I expected when I started this project. but lo and behold, the error that got me to do include the files explicitly.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by