Displaying 2 results from an estimated 2 matches for "modelnum".
2006 Apr 26
1
RE nut 2.0 fentonups and Xanto S3000R
...see if it's in the mtab2 */
- if (check_mtab2(raw))
+ if (check_mtab2(raw, 1))
return;
mch = raw[17];
@@ -175,28 +178,36 @@ static char *get_id(void)
void upsdrv_initinfo(void)
{
int modelnum, i, ret;
- char temp[256], model[32], *raw;
+ char temp[256], qmodel[32], *model, *raw =
NULL;
- raw = get_id();
+ model = getval("model");
- if (!raw)
- fa...
2006 Jan 27
0
[PATCH] fentonups patch to make it work with some powercom ups's
...9,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, "%c%c%c%c%c\r", 1, 2, 2, 3, 5);
+ ret = ser_get_line(upsfd, temp, sizeof(temp), ENDCHAR, "&...