thermferm/devices.h

Wed, 17 Apr 2024 19:54:56 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 17 Apr 2024 19:54:56 +0200
changeset 684
b2265c7e5707
parent 654
e981d0185485
child 687
f5d05b420732
permissions
-rw-r--r--

Updated dependencies. Devices json data is created in de devices source for all places where it is needed. Added devices_ws function to broadcast all devices, to be used when any device is changed. The devices loop detects changes in input values and calls devices_ws if so. The server uses the general devices json data.

#ifndef MY_DEVICES_H
#define	MY_DEVICES_H

int read_w1(char *address, char *file);
int write_w1(char *address, char *file, uint8_t val);

int device_out(char *uuid, int value);
int device_in(char *uuid, int *value);

char *device_json(devices_list *device, bool full);

int devices_detect(void);

void *my_devices_loop(void *);

#endif

mercurial