99
1010#include <zephyr/kernel.h>
1111#include <zephyr/sys/printk.h>
12+ #include <Os/File.hpp>
1213
1314const struct device* serial = DEVICE_DT_GET(DT_NODELABEL(cdc_acm_uart0));
1415const struct device* lora = DEVICE_DT_GET(DT_NODELABEL(lora0));
@@ -19,7 +20,25 @@ int main(int argc, char* argv[]) {
1920 // This sleep is necessary to allow the USB CDC ACM interface to initialize before
2021 // the application starts writing to it.
2122 k_sleep(K_MSEC(3000));
22-
23+ Os::File file;
24+ U8 message[] = "Hello Ines\n";
25+ U8 message1[sizeof(message) + 1] = {0};
26+ Os::File::Status status;
27+ FwSizeType size;
28+ // = file.open("/tmp1", Os::File::Mode::OPEN_CREATE);
29+ // Os::File::Status status = file.open("/tmp1", Os::File::Mode::OPEN_CREATE);
30+ // FwSizeType size = static_cast<FwSignedSizeType>(sizeof(message));
31+ // printk("Status: %d - open\n", static_cast<int>(status));
32+ // status = file.write(message, size);
33+ // printk("Status: %d - write %" PRI_FwSizeType "\n", static_cast<int>(status), size);
34+ // file.close();
35+ status = file.open("/tmp1", Os::File::Mode::OPEN_READ);
36+ printk("Status: %d - open (R)\n", static_cast<int>(status));
37+ size = static_cast<FwSignedSizeType>(sizeof(message));
38+ status = file.read(message1, size);
39+ printk("Status: %d - read %" PRI_FwSizeType "\n", static_cast<int>(status), size);
40+ message1[sizeof(message)] = 0;
41+ printk("Message: %s\n", message1);
2342 Os::init();
2443 // Object for communicating state to the topology
2544 ReferenceDeployment::TopologyState inputs;
0 commit comments