Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyTubongbanua committed Dec 25, 2024
1 parent 81d9095 commit a06a149
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/desktop/playground/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <atlogger/atlogger.h>
#include <string.h>
#include <atclient/connection.h>

#define TAG "main"

Expand All @@ -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; }
Expand Down

0 comments on commit a06a149

Please # to comment.