Add usleep to strain.c just in case...
[matches/MCTX3420.git] / server / actuators / filetest.c
1 #include "filetest.h"
2
3 static FILE * f = NULL;
4 bool Filetest_Init(const char * name, int id)
5 {
6         f = fopen(name, "w");
7         if (f == NULL)
8                 return false;
9         setbuf(f, NULL); // Unbuffer
10         return true;
11 }
12
13 bool Filetest_Set(int id, double value)
14 {
15         Log(LOGDEBUG, "Writing %lf to file", value);
16         return (fprintf(f, "%lf\n", value) > 1);
17 }
18
19 bool Filetest_Cleanup(int id)
20 {
21         return (fclose(f) == 0);
22 }
23
24 bool Filetest_Sanity(int id, double value)
25 {
26         return (abs(value) <= 1e4);
27 }

UCC git Repository :: git.ucc.asn.au