diff options
| author | Patrick | 2023-07-13 13:44:26 +0200 |
|---|---|---|
| committer | Patrick | 2023-07-13 13:44:26 +0200 |
| commit | 10325eaf40c80eb91f1c1eceea880c3abd54efd7 (patch) | |
| tree | e160ff671e0b4404148b0e389e3d630b62fc191e /esp32/esp_project/main/main.c | |
| parent | 6646bd126f9faf1e687b203512d29da243acaa90 (diff) | |
| download | matrix_esp_thesis-10325eaf40c80eb91f1c1eceea880c3abd54efd7.tar.gz matrix_esp_thesis-10325eaf40c80eb91f1c1eceea880c3abd54efd7.zip | |
added esp project
Diffstat (limited to 'esp32/esp_project/main/main.c')
| -rw-r--r-- | esp32/esp_project/main/main.c | 40 |
1 files changed, 40 insertions, 0 deletions
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);
+}
|
