mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-07-01 18:47:39 +00:00
Minor changes
This commit is contained in:
parent
8f6bf2c440
commit
fe62b11365
4 changed files with 18 additions and 8 deletions
|
@ -17,6 +17,7 @@ void publish(void *publisher, char *filepath, char* client, long int interval);
|
|||
|
||||
int main (int argc, char *argv [])
|
||||
{
|
||||
printf("%d\n",ZMQ_MSG_SIZE);
|
||||
if(argc != 6){
|
||||
printf("Usage: %s <abslogdir> <loginterval> <ip> <port> <key>",argv[0]);
|
||||
exit(1);
|
||||
|
|
|
@ -8,25 +8,24 @@
|
|||
#define MIN_INTERVAL 30
|
||||
#define INA260_SYSFS "/sys/kernel/ina260"
|
||||
#define INA260_POWER_REGISTER "registers/power"
|
||||
|
||||
#ifndef ZMQ_TOKEN
|
||||
#define ZMQ_TOKEN "ina260-zmq-publisher"
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MSG_SIZE
|
||||
#define ZMQ_MSG_SIZE 255*10
|
||||
#endif
|
||||
|
||||
#define STR(symbol) #symbol
|
||||
#define STRINGIFY(symbol) STR(symbol)
|
||||
|
||||
#define TIMESTAMP() (time(NULL))
|
||||
|
||||
#define INTERVAL(duration)\
|
||||
((TIMESTAMP()) - ((TIMESTAMP())%(duration)))
|
||||
|
||||
#define INTERVAL_NEXT(duration)\
|
||||
((INTERVAL(duration))+(duration))
|
||||
|
||||
#define INTERVAL_LAST(duration)\
|
||||
(INTERVAL(INTERVAL((TIMESTAMP()),(duration))-1,(duration)))
|
||||
|
||||
#define FILE_EXISTS(path) (access((path), F_OK) == 0)
|
||||
|
||||
void mkdirp(char *path);
|
Loading…
Add table
Add a link
Reference in a new issue