Integrate Dingo Camera Server Stuffs
This commit is contained in:
@@ -386,28 +386,48 @@ static int PLC_Action(SConnection *pCon, SicsInterp *pSics,
|
||||
if (strcasecmp(argv[1], "hattach") == 0) {
|
||||
}
|
||||
else if (strcasecmp(argv[1], "shutter") == 0) {
|
||||
if (strcasecmp(argv[2], "open") == 0) {
|
||||
//if (strcasecmp(argv[2], "open") == 0) {
|
||||
if (strcasecmp(argv[2], "on") == 0) {
|
||||
/* open shutter */
|
||||
AsyncUnitSendTxn(self->unit, "WRITE 1", 4, PutCallback, self, 132);
|
||||
//AsyncUnitSendTxn(self->unit, "set shutter=on", 14, PutCallback, self, 132);
|
||||
AsyncUnitSendTxn(self->unit, "READ", 4, PutCallback, self, 132);
|
||||
return OKOK;
|
||||
}
|
||||
else if (strcasecmp(argv[2], "close") == 0 ||
|
||||
strcasecmp(argv[2], "shut") == 0) {
|
||||
//else if (strcasecmp(argv[2], "close") == 0 ||
|
||||
else if (strcasecmp(argv[2], "off") == 0) {
|
||||
// strcasecmp(argv[2], "shut") == 0) {
|
||||
/* close shutter */
|
||||
AsyncUnitSendTxn(self->unit, "WRITE 2", 4, PutCallback, self, 132);
|
||||
AsyncUnitSendTxn(self->unit, "set shutter=off", 15, PutCallback, self, 132);
|
||||
return OKOK;
|
||||
}
|
||||
else if (strcasecmp(argv[2], "auto") == 0) {
|
||||
AsyncUnitSendTxn(self->unit, "set shutter=auto", 16, PutCallback, self, 132);
|
||||
return OKOK;
|
||||
}
|
||||
else {
|
||||
snprintf(line, 132, "%s %s does not understand %s",
|
||||
argv[0], argv[1], argv[2]);
|
||||
snprintf(line, 132, "%s %s does not understand %s", argv[0], argv[1], argv[2]);
|
||||
SCWrite(pCon, line, eError);
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(argv[1], "focuslight") == 0) {
|
||||
if (strcasecmp(argv[2], "on") == 0) {
|
||||
AsyncUnitSendTxn(self->unit, "set focuslight=on", 17, PutCallback, self, 132);
|
||||
return OKOK;
|
||||
} else if (strcasecmp(argv[2], "off") == 0) {
|
||||
AsyncUnitSendTxn(self->unit, "set focuslight=off", 18, PutCallback, self, 132);
|
||||
return OKOK;
|
||||
} else {
|
||||
snprintf(line, 132, "%s %s does not understand %s", argv[0], argv[1], argv[2]);
|
||||
SCWrite(pCon, line, eError);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
snprintf(line, 132, "%s does not understand %s", argv[0], argv[1]);
|
||||
SCWrite(pCon, line, eError);
|
||||
return 0;
|
||||
}
|
||||
snprintf(line, 132, "%s does not understand %s", argv[0], argv[1]);
|
||||
SCWrite(pCon, line, eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static pSafetyPLCController PLC_Create(const char* pName)
|
||||
|
||||
Reference in New Issue
Block a user