diff options
Diffstat (limited to 'esp32/esp_project/main')
| -rw-r--r-- | esp32/esp_project/main/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | esp32/esp_project/main/main.c | 40 |
2 files changed, 42 insertions, 0 deletions
diff --git a/esp32/esp_project/main/CMakeLists.txt b/esp32/esp_project/main/CMakeLists.txt new file mode 100644 index 0000000..8d26c93 --- /dev/null +++ b/esp32/esp_project/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "main.c"
+ INCLUDE_DIRS "")
\ No newline at end of file diff --git a/esp32/esp_project/main/main.c b/esp32/esp_project/main/main.c new file mode 100644 index 0000000..d53fdf7 --- /dev/null +++ b/esp32/esp_project/main/main.c @@ -0,0 +1,40 @@ +/*
+ * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: CC0-1.0
+ */
+
+#define OLMLIB_VERSION_MAJOR 3
+#define OLMLIB_VERSION_MINOR 2
+#define OLMLIB_VERSION_PATCH 15
+
+#define OLM_STATIC_DEFINE
+
+#include <mongoose.h>
+#include <olm/olm.h>
+#include <matrix.h>
+
+#define SERVER "https://matrix.org"
+#define ACCESS_TOKEN "syt_cHNjaG8_yBvTjVTquGCikvsAenOJ_49mBMO"
+#define DEVICE_ID "MAZNCCZLBR"
+#define ROOM_ID "!koVStwyiiKcBVbXZYz:matrix.org"
+
+void
+app_main(void)
+{
+ MatrixClient client;
+ MatrixClientInit(&client,
+ SERVER);
+
+ MatrixHttpInit(&client);
+
+ MatrixClientSetAccessToken(&client,
+ ACCESS_TOKEN);
+
+ MatrixClientSendEvent(&client,
+ ROOM_ID,
+ "m.room.message",
+ "{\"body\":\"Hello\",\"msgtype\":\"m.text\"}");
+
+ MatrixHttpDeinit(&client);
+}
|
