wz_mini_hacks/libcallback_wz_mod/irled.c
Alfonso Gamboa 26af3aa7bc rtsp fixes
2022-05-07 01:23:49 -07:00

25 lines
600 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern int local_sdk_close_night_light();
extern int local_sdk_open_night_light();
extern int local_sdk_auto_night_light();
extern void CommandResponse(int fd, const char *res);
char *IrLed(int fd, char *tokenPtr) {
char *p = strtok_r(NULL, " \t\r\n", &tokenPtr);
if(!p) return "error";
if(!strcmp(p, "on")) {
local_sdk_open_night_light();
} else if(!strcmp(p, "off")) {
local_sdk_close_night_light();
} else if(!strcmp(p, "auto")) {
local_sdk_auto_night_light();
} else {
return "error";
}
return "ok";
}