diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-05-06 15:01:11 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-05-06 15:01:11 -0400 |
commit | bef15f8e1b20aff978b71866b501a4da85881434 (patch) | |
tree | 2c4aeed4caf5feef141a3ed7d5b313d4baba057d /src/main.c | |
parent | da00f4eb7bf4cdcd463756ce0b73e5a4540bf9ff (diff) |
board v1.7
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; } |