summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;
}