# tsched This project is the second assignment for CCOM-4017. Check out the [instructions](instructions.md). I am using a sockets library I developed mysel. For more information on how the sockets library was developed, feel free to visit the repo: - https://tangled.org/@stau.space/enchufe This sockets library relies on having GNU's version of the POSIX utilities that should be available on a POSIX compliant system. Additionally, I am using GNU's implementation of semaphores, although they are not POSIX, they should be available on most systems. For threads, I am using a builtin library called `threads.h`. This library is documented on [cppreference.com](https://cppreference.com) as: - https://en.cppreference.com/w/c/header/threads.html From this library I used the functionality provided to create the threads and the mutex that they define. # Running If you would like to change the range of time that each program is sleeping, there is a macro called `SLEEP_TIME` defined in line 10 of `./src/edevice.c`. Changing this to some other number `n` will change the range of times to be `0` to `n - 1`. ## Cluster ```sh ./build.sh cluster.py ``` This will simply run the cluster on the server's loopback `127.0.0.1` and on port `42069`. If youu want to supply your own server and port, use: ```sh ./build.sh cluster.py server_address server_port ``` where `server_address` is the IPv4 address of the cluster, and `server_port` is the port number of the cluster. ## Embedded device This is the same as the cluster. The default server and port are the loopback and `42069` respectively, and supplying the parameters for `ADDRESS` and `PORT` will let make know on which server and port you want to run it. ```sh ./build.sh edevice.py server_address server_port ``` where `server_address` is the IPv4 address of the cluster, and `server_port` is the port number of the cluster. # Building If you just want to build the files, run: ```sh make .build/edevice ``` To build the embedded device and run: ```sh make .build/cluster ``` To build the cluster. From these two executables, you can then run the programs like, ```sh ./.build/cluster server_address server_port ./.build/edevice server_address server_port ``` # Contributions I would like to thank Gabriel Romero, Pablo Torres, Sergio Rodriguez and Anasofia Colon while developing this project. Without them, this project would have been impossible.