Displaying 3 results from an estimated 3 matches for "dtr_bit".
2007 Jun 18
1
Megatec - modem control lines
...wing patch:
Index: /home/arjen/Devel/nut/trunk/drivers/megatec.c
===================================================================
--- trunk/drivers/megatec.c (revision 965)
+++ trunk/drivers/megatec.c (working copy)
@@ -853,13 +853,22 @@
void upsdrv_initups(void)
{
+ int dtr_bit = TIOCM_DTR;
+ int rts_bit = TIOCM_RTS;
+
upsfd = ser_open(device_path);
ser_set_speed(upsfd, device_path, B2400);
+
+ ioctl(upsfd, TIOCMBIS, &dtr_bit);
+ ioctl(upsfd, TIOCMBIC, &rts_bit);
}
void upsdrv_cleanup(void)
{
+ int dtr_bit = TIOCM...
2006 Jan 27
0
[PATCH] fentonups patch to make it work with some powercom ups's
...;
+#include <sys/termios.h>
#include "main.h"
#include "serial.h"
@@ -176,11 +179,27 @@ static char *get_id(void)
return NULL;
}
+static void set_powercom_lines (void)
+{
+// straced from powercom's upsmon
+//ioctl(4, TIOCMSET, [TIOCM_DTR|0x4000]) = 0
+
+ int dtr_bit = TIOCM_DTR|0x4000;
+ ioctl(upsfd, TIOCMSET, &dtr_bit);
+}
+
void upsdrv_initinfo(void)
{
int modelnum, i, ret;
char temp[256], model[32], *raw;
+ if (testvar("powercom")) {
+ set_powercom_lines();
+// straced from powercom's upsmon (reset?)
+ ret = ser_send(upsfd,...
2009 Feb 04
2
[nut-commits] svn commit r1765 - in trunk: . drivers man
...s)");
> 959 addvar(VAR_VALUE, "ups.delay.start", "Override restart
> delay (10s)");
This doesn't work without using getval() somewhere in the driver.
> 971 ioctl(upsfd, TIOCMBIC, &rts_bit);
> 972 ioctl(upsfd, TIOCMBIC, &dtr_bit);
We have library functions in serial.c to handle this. Use them.
Best regards, Arjen
--
Please keep list traffic on the list