This commit is contained in:
sirlilpanda
2025-08-28 21:19:47 +12:00
commit d4e72630e9
12 changed files with 2829 additions and 0 deletions

28
src/device.c Normal file
View File

@@ -0,0 +1,28 @@
#include "device.h"
#include <string.h>
static void pressPwrMethod(Device_t *device) {
device->state.methods.pressPwr(device);
}
static void pressStrInputMethod(Device_t *device) {
device->state.methods.pressStrInput(device);
}
static void pressLockMethod(Device_t *device) {
device->state.methods.pressLock(device);
}
void initDevice(Device_t* device) {
*device = (Device_t){
.state = NULL,
.entered_string = "frogs",
.entered_string_len = 6,
.methods = (DeviceInterface_t){
.pressPwr = &pressPwrMethod,
.pressStrInput = &pressStrInputMethod,
.pressLock = &pressLockMethod,
},
};
}