Skip to content
Snippets Groups Projects
Commit 64e8e720 authored by Ruben Otto's avatar Ruben Otto :crab:
Browse files

chore: update userspace communication docs

parent 466e4fac
Branches
No related tags found
No related merge requests found
......@@ -22,5 +22,23 @@ make
## Communication
### Userspace
The client programs that aggregate the desired system data are sending them to the daemon process.
This is done via a simple packet, `measurement_t` which is defined in [`common/include/measurement.h`](common/include/measurement.h).
It holds the data of a measurement, which can be an integer, unsigned integer, float or double, the type of the data and an id that identifies the sender.
The id is an `uint8_t` and should be unique for each client that sends data, so the maximum amount of clients is 255.
The packet is sent via a message queue, which is created by the daemon process.
Clients will wait until the message queue is created and then send their data to the daemon.
Key and project id for the message queue are defined in [`common/include/userspace_comm.h`](common/include/userspace_comm.h).
The daemon caches the data and waits until one of three conditions are met to send the data to the kernel module (which then sends them over the GPIO pins):
- A measurement with an previously unknown measurement id is received
- A measurement with different data type for a known measurement id is received
- A measurement with different data for a known measurement id is received
If one of these conditions is met, the data is sent to the kernel module via the `data_t` struct that is defined in [`common/include/measurement.h`](common/include/measurement.h).
It contains a field for the pre-defined sender id, the count of measurements and the measurements themselves.
The sent data contains the latest received measurements for each measurement id.
### Kernel module
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment