summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-05-06 15:01:11 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-05-06 15:01:11 -0400
commitbef15f8e1b20aff978b71866b501a4da85881434 (patch)
tree2c4aeed4caf5feef141a3ed7d5b313d4baba057d /src
parentda00f4eb7bf4cdcd463756ce0b73e5a4540bf9ff (diff)
board v1.7
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 5db59d4..69edfd3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3,8 +3,10 @@
#include <stdio.h>
#include <stdint.h>
#include <errno.h>
+#include <string.h>
#include <osm/bind.h>
+#include <osm/protocol.h>
#include <sys/socket.h>
@@ -14,10 +16,20 @@ volatile double humidity = 0;
int _sock_connect(void *data)
{
int fd = (uintptr_t)data;
+
+ OSMInitFrame frame = {0};
+ memcpy(frame.magic, OSM_MAGIC_INIT, 4);
+ frame.keylen = 0;
+
+ write(fd, &frame, sizeof(frame));
+ printf("Wrote 1!\n");
double temp = temperature;
write(fd, &temp, sizeof(temp));
+ printf("Wrote 2!\n");
close(fd);
+
+ printf("Wrote!\n");
return 0;
}