Inspired by recent journey into lisp and scheme, I thought I’d have a crack at bringing some lisp-like heterogeneous lists into c. To compliment this, I’ll also implement some lisp primitives, namely cons, car and cdr, for list operations. Up for discussion: are the lists in this post truly heterogeneous?
Our c program can read serial data from a gps device. In this post we’ll look at how to set up a UDP server that other clients can query for up to date gps data. ... #include <string.h> ... //for threading #include <pthread.h> //for udp server #include <sys/types.h> #include <sys/socket.h>
Update: Missing memset(&new_config, 0, sizeof(new_config) in set_input_mode function would sometimes cause garbled incoming data from gps. Seems to have fixed the issue. The software implementation we discussed last time (written in awk) is fairly hamstrung. Running topreveals that the cpu usage idles at ~20% on my machine (my machine is