2011-05-29 17:20:41 +02:00
|
|
|
/**
|
2011-06-09 18:29:30 +02:00
|
|
|
* S0 Hutschienenzähler directly connected to an rs232 port
|
2011-05-29 17:20:41 +02:00
|
|
|
*
|
|
|
|
* @package vzlogger
|
|
|
|
* @copyright Copyright (c) 2011, The volkszaehler.org project
|
|
|
|
* @license http://www.gnu.org/licenses/gpl.txt GNU Public License
|
|
|
|
* @author Steffen Vogel <info@steffenvogel.de>
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* This file is part of volkzaehler.org
|
|
|
|
*
|
|
|
|
* volkzaehler.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* volkzaehler.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with volkszaehler.org. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2011-09-10 00:00:26 +02:00
|
|
|
#ifndef _S0_H_
|
|
|
|
#define _S0_H_
|
2011-05-29 17:20:41 +02:00
|
|
|
|
2011-06-11 23:42:58 +02:00
|
|
|
#include <termios.h>
|
|
|
|
|
|
|
|
typedef struct {
|
2011-11-21 00:38:05 +01:00
|
|
|
char *device;
|
2011-12-05 21:42:57 +01:00
|
|
|
int resolution;
|
2011-11-21 00:38:05 +01:00
|
|
|
|
2011-12-05 21:42:57 +01:00
|
|
|
int fd; /* file descriptor of port */
|
|
|
|
struct termios old_tio; /* required to reset port */
|
2011-09-10 00:00:26 +02:00
|
|
|
} meter_handle_s0_t;
|
2011-06-11 23:42:58 +02:00
|
|
|
|
2011-11-21 00:38:05 +01:00
|
|
|
/* forward declarations */
|
|
|
|
struct meter;
|
|
|
|
struct reading;
|
2011-10-07 22:26:03 +02:00
|
|
|
|
2011-11-21 00:38:05 +01:00
|
|
|
int meter_init_s0(struct meter *mtr, list_t options);
|
2012-02-03 15:24:16 +01:00
|
|
|
void meter_free_s0(struct meter *mtr);
|
2011-10-07 22:26:03 +02:00
|
|
|
int meter_open_s0(struct meter *mtr);
|
2011-11-21 00:38:05 +01:00
|
|
|
int meter_close_s0(struct meter *mtr);
|
2011-10-07 22:26:03 +02:00
|
|
|
size_t meter_read_s0(struct meter *mtr, struct reading *rds, size_t n);
|
2011-05-29 17:20:41 +02:00
|
|
|
|
2011-09-10 00:00:26 +02:00
|
|
|
#endif /* _S0_H_ */
|