From a06a149cff54ad41118bde46ed10f6b95556b096 Mon Sep 17 00:00:00 2001 From: JeremyTubongbanua Date: Wed, 25 Dec 2024 03:22:24 +0000 Subject: [PATCH] fix: --- examples/desktop/playground/main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/examples/desktop/playground/main.c b/examples/desktop/playground/main.c index 9411b902..fbbb54c7 100644 --- a/examples/desktop/playground/main.c +++ b/examples/desktop/playground/main.c @@ -1,4 +1,6 @@ #include +#include +#include #define TAG "main" @@ -9,6 +11,25 @@ int main() { // Enter your code here + const char *host = "vip.ve.atsign.zone"; + const int port = 64; + + unsigned char recv[1024]; + size_t recv_size = sizeof(recv); + size_t recv_len = 0; + + atclient_connection connection; + atclient_connection_init(&connection, ATCLIENT_CONNECTION_TYPE_ATSERVER); + + if((ret = atclient_connection_connect(&connection, host, port)) != 0) { + atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_connection_connect failed with exit code: %d\n", ret); + goto exit; + } + + atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_INFO, "Connected to %s:%d\n", host, port); + + atclient_connection_send(&connection, (unsigned char *)"bob🛠\n", strlen("bob🛠\n"), recv, recv_size, &recv_len); + ret = 0; exit: { return ret; }