From a2ec147a074c85b7eae7a0f391d56d4969506171 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 14 Nov 2023 13:15:55 +0100 Subject: [PATCH] update Readme --- Readme.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 9475a9f..9e90f9a 100644 --- a/Readme.md +++ b/Readme.md @@ -27,6 +27,24 @@ To build the example for the ESP32 start an ESP-IDF shell in esp32/esp_project o - `idf.py flash` - `idf.py monitor` +Examples for the ESP32 are in `esp32/esp_project/main`. +There are currently two, SendEncrypted and Verify. +The example can be set in `esp32/esp_project(_risc_v)/main/CMakeLists.txt` as the second argument after SRCS. + +Any code using the library should compile under ESP-IDF if the following code is added at the end of the file: +``` +#include "wifi.h" + +void +app_main(void) +{ + wifi_init(WIFI_SSID, WIFI_PASSWORD); + + main(); +} + +``` + To use the library in an ESP-IDF project: - Add the matrix and olm components (can be found in `esp32/esp_project/components/`) - Add `wifi.c/.h` (can be found in `esp32/esp_project/main/`) @@ -51,9 +69,9 @@ MatrixHttpInit(&client->hc, SERVER); MatrixClientSetUserId(client, USER_ID); MatrixClientLoginPassword(client, - "pscho", - "Wc23EbmB9G3faMq", - "Test1"); + USERNAME, + PASSWORD, + DEVICE_NAME); MatrixClientDeleteDevice(client); @@ -73,11 +91,10 @@ MatrixMegolmOutSession * megolmOutSession; MatrixClientNewMegolmOutSession(&client, ROOM_ID, &megolmOutSession); -printf("megolm session id: %.10s... key: %.10s...\n", megolmOutSession->id, megolmOutSession->key); MatrixClientShareMegolmOutSession(&client, USER_ID, - "ULZZOKJBYN", + DEVICE_ID2, megolmOutSession); MatrixClientSendEventEncrypted(&client, -- 2.50.1