nut-debian/drivers/blazer.h

55 lines
1.9 KiB
C
Raw Permalink Normal View History

2010-03-26 01:20:59 +02:00
/*
* blazer.h: defines/macros for Megatec/Q1 protocol based UPSes
*
2022-07-10 10:23:45 +03:00
* OBSOLETION WARNING: Please to not base new development on this
* codebase, instead create a new subdriver for nutdrv_qx which
* generally covers all Megatec/Qx protocol family and aggregates
* device support from such legacy drivers over time.
*
2010-03-26 01:20:59 +02:00
* A document describing the protocol implemented by this driver can be
* found online at "http://www.networkupstools.org/protocols/megatec.html".
*
* Copyright (C) 2008 - Arjen de Korte <adkorte-guest@alioth.debian.org>
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef BLAZER_H
#define BLAZER_H
#define MAXTRIES 3
/*
* The driver core will do all the protocol handling and provides
* the following (interface independent) parts already
*
* upsdrv_updateinfo()
* upsdrv_shutdown()
*
* Communication with the UPS is done through blazer_command() of which
* the prototype is declared below. It shall send a command and reads
* a reply if buf is not a NULL pointer and buflen > 0.
*
* Returns < 0 on error, 0 on timeout and the number of bytes send/read on
* success.
*/
2022-07-10 10:23:45 +03:00
ssize_t blazer_command(const char *cmd, char *buf, size_t buflen);
2010-03-26 01:20:59 +02:00
void blazer_makevartable(void);
void blazer_initups(void);
void blazer_initinfo(void);
#endif /* BLAZER_H */