" 36 | tail /var/log/* 37 | echo "" 38 | ;; 39 | # System Request 40 | reboot) 41 | getReturn 1234 "info" "Camera will reboot." 42 | /sbin/reboot 43 | ;; 44 | poweroff) 45 | getReturn 1234 "info" "Camera will safely power off." 46 | /sbin/poweroff 47 | ;; 48 | set_hostname) 49 | if [ -n "$F_hostname" ]; then 50 | if [ $(cat $CONFIGPATH/hostname.conf) != "$F_hostname" ]; then 51 | echo "$F_hostname" > $CONFIGPATH/hostname.conf 52 | hostname $F_hostname 53 | if [ $(cat $CONFIGPATH/hostname.conf) = "$F_hostname" ]; then 54 | getReturn 1234 "success" "The hostname has been changed successfully to '$F_hostname'." 55 | else 56 | getReturn 1234 "error" "An error occurred while changing the hostname." 57 | fi 58 | else 59 | getReturn 1234 "info" "The hostname is already set to '$F_hostname', so has not been changed." 60 | fi 61 | else 62 | getReturn 1234 "info" "The 'hostname' parameter is empty, so has not been changed." 63 | fi 64 | ;; 65 | set_timezone) 66 | if [ -n "$F_tz" ]; then 67 | if [ $(cat /etc/TZ) != "$F_tz" ]; then 68 | echo "$F_tz" > /etc/TZ 69 | if [ $(cat /etc/TZ) = "$F_tz" ]; then 70 | $BINPATH/busybox ntpd -q -n -p time.google.com 2>&1 71 | getReturn 1234 "success" "The timezone has been changed successfully to '$F_tz'." 72 | else 73 | getReturn 1234 "error" "An error occurred while changing the timezone." 74 | fi 75 | else 76 | getReturn 1234 "info" "The timezone is already set to '$F_tz', so has not been changed." 77 | fi 78 | else 79 | getReturn 1234 "info" "The 'tz=[value]' parameter is empty, so has not been changed." 80 | fi 81 | ;; 82 | systeminfo) 83 | echo "Content-type: application/json; charset=utf-8; Pragma: no-cache; Expires: Wednesday, 27-Dec-95 05:29:10 GMT" 84 | echo "" 85 | 86 | echo "{ 87 | \"code\": 123, 88 | \"status\": \"info\", 89 | \"description\": \"System informations\", 90 | \"system\": { 91 | \"hostname\": \"$(cat $CONFIGPATH/hostname.conf)\", 92 | \"kernel\": \"$($BINPATH/busybox uname -r)\", 93 | \"uptime\": $(cat /proc/uptime | cut -d. -f1), 94 | \"cpu_avg\": $(cat /proc/loadavg | cut -d " " -f1), 95 | \"datetime\": { 96 | \"date\": \"$(date +'%Y-%m-%d')\", 97 | \"time\": \"$(date +'%T')\" 98 | }, 99 | \"network\": { 100 | \"mac\": \"$(cat /params/config/.product_config | grep MAC | cut -c16-27 | sed 's/\(..\)/\1:/g;s/:$//')\", 101 | \"router\": { 102 | \"name\": \"$(iwgetid -r)\", 103 | \"mac\": \"$(iwgetid -r -a)\", 104 | \"ip\": \"$(ifconfig wlan0 | grep 'inet addr'| cut -d: -f2 | cut -d' ' -f1)\", 105 | \"channel\": $(iwgetid -r -c), 106 | \"freq\": \"$(iwgetid -r -f | cut -de -f1)\", 107 | \"rx\": $(ifconfig wlan0 | grep 'RX bytes' | cut -d: -f2 | cut -d' ' -f1), 108 | \"tx\": $(ifconfig wlan0 | grep 'TX bytes' | cut -d: -f3 | cut -d' ' -f1), 109 | \"signal\": $(cat /proc/net/wireless | tr -s ' ' $'\t' | grep wlan0: | cut -f4 | cut -d. -f1) 110 | } 111 | }, 112 | \"disk_space\": { 113 | \"total\": $(df | tr -s ' ' $'\t' | grep /dev/mmcblk0p1 | cut -f2), 114 | \"used\": $(df | tr -s ' ' $'\t' | grep /dev/mmcblk0p1 | cut -f3), 115 | \"free\": $(df | tr -s ' ' $'\t' | grep /dev/mmcblk0p1 | cut -f4) 116 | }, 117 | \"memory\": { 118 | \"total\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep MemTotal: | cut -f2), 119 | \"free\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep MemFree: | cut -f2), 120 | \"buffers\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep Buffers: | cut -f2), 121 | \"cached\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep Cached: | cut -f2 | head -1), 122 | \"swap\": { 123 | \"total\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep SwapTotal: | cut -f2), 124 | \"free\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep SwapFree: | cut -f2) 125 | } 126 | } 127 | } 128 | }" 129 | ;; 130 | # Control LED and IR 131 | set_led) 132 | if ! [ $F_led ]; then 133 | getReturn 1234 "info" "The 'led' parameter is empty." 134 | exit 1 135 | fi 136 | 137 | case "$F_led" in 138 | blue) 139 | if ! [ -n $F_state ]; then 140 | getReturn 1234 "info" "The 'state' parameter is empty." 141 | exit 1 142 | fi 143 | 144 | if [ $F_state == 0 ]; then 145 | setGpio 39 1 146 | if [ $? -eq 0 ]; then 147 | getReturn 1234 "success" "The blue LED has been changed state successfully to Off." 148 | else 149 | getReturn 1234 "error" "An error occurred while changing the Blue LED state to Off." 150 | fi 151 | elif [ $F_state == 1 ]; then 152 | setGpio 38 1 && setGpio 39 0 153 | if [ $? -eq 0 ]; then 154 | getReturn 1234 "success" "The blue LED has been changed state successfully to On." 155 | else 156 | getReturn 1234 "error" "An error occurred while changing the Blue LED state to On." 157 | fi 158 | elif [ $F_state == 2 ]; then 159 | if [ `cat /sys/class/gpio/gpio38/value` == 1 -a `cat /sys/class/gpio/gpio39/value` == 0 ]; then 160 | setGpio 39 1 161 | if [ $? -eq 0 ]; then 162 | getReturn 1234 "success" "The blue LED has been changed state successfully to Off." 163 | else 164 | getReturn 1234 "error" "An error occurred while changing the Blue LED state to Off." 165 | fi 166 | else 167 | setGpio 38 1 && setGpio 39 0 168 | if [ $? -eq 0 ]; then 169 | getReturn 1234 "success" "The blue LED has been changed state successfully to On." 170 | else 171 | getReturn 1234 "error" "An error occurred while changing the Blue LED state to On." 172 | fi 173 | fi 174 | else 175 | getReturn 1234 "error" "Unsupported LED state '$F_state'." 176 | fi 177 | ;; 178 | yellow) 179 | if ! [ $F_state ]; then 180 | getReturn 1234 "info" "The 'state' parameter is empty." 181 | exit 1 182 | fi 183 | 184 | if [ $F_state == 0 ]; then 185 | setGpio 38 1 186 | if [ $? -eq 0 ]; then 187 | getReturn 1234 "success" "The yellow LED has been changed state successfully to Off." 188 | else 189 | getReturn 1234 "error" "An error occurred while changing the yellow LED state to Off." 190 | fi 191 | elif [ $F_state == 1 ]; then 192 | setGpio 38 0 && setGpio 39 1 193 | if [ $? -eq 0 ]; then 194 | getReturn 1234 "success" "The yellow LED has been changed state successfully to On." 195 | else 196 | getReturn 1234 "error" "An error occurred while changing the yellow LED state to On." 197 | fi 198 | elif [ $F_state == 2 ]; then 199 | if [ `cat /sys/class/gpio/gpio38/value` == 0 -a `cat /sys/class/gpio/gpio39/value` == 1 ]; then 200 | setGpio 38 1 201 | if [ $? -eq 0 ]; then 202 | getReturn 1234 "success" "The yellow LED has been changed state successfully to Off." 203 | else 204 | getReturn 1234 "error" "An error occurred while changing the yellow LED state to Off." 205 | fi 206 | else 207 | setGpio 38 0 && setGpio 39 1 208 | if [ $? -eq 0 ]; then 209 | getReturn 1234 "success" "The yellow LED has been changed state successfully to On." 210 | else 211 | getReturn 1234 "error" "An error occurred while changing the yellow LED state to On." 212 | fi 213 | fi 214 | else 215 | getReturn 1234 "error" "Unsupported LED state '$F_state'." 216 | fi 217 | ;; 218 | ir) 219 | if ! [ $F_state ]; then 220 | getReturn 1234 "info" "The 'state' parameter is empty." 221 | exit 1 222 | fi 223 | 224 | if [ $F_state == 0 ]; then 225 | setGpio 49 1 226 | if [ $? -eq 0 ]; then 227 | getReturn 1234 "success" "The IR LED has been changed state successfully to Off." 228 | else 229 | getReturn 1234 "error" "An error occurred while changing the IR LED state to Off." 230 | fi 231 | elif [ $F_state == 1 ]; then 232 | setGpio 49 0 233 | if [ $? -eq 0 ]; then 234 | getReturn 1234 "success" "The IR LED has been changed state successfully to On." 235 | else 236 | getReturn 1234 "error" "An error occurred while changing the IR LED state to On." 237 | fi 238 | elif [ $F_state == 2 ]; then 239 | if [ `cat /sys/class/gpio/gpio49/value` == 0 ]; then 240 | setGpio 49 1 241 | if [ $? -eq 0 ]; then 242 | getReturn 1234 "success" "The IR LED has been changed state successfully to Off." 243 | else 244 | getReturn 1234 "error" "An error occurred while changing the IR LED state to Off." 245 | fi 246 | else 247 | setGpio 49 0 248 | if [ $? -eq 0 ]; then 249 | getReturn 1234 "success" "The IR LED has been changed state successfully to On." 250 | else 251 | getReturn 1234 "error" "An error occurred while changing the IR LED state to On." 252 | fi 253 | fi 254 | else 255 | getReturn 1234 "error" "Unsupported LED state '$F_state'." 256 | fi 257 | ;; 258 | *) 259 | getReturn 1234 "error" "Unsupported LED '$F_led'." 260 | ;; 261 | esac 262 | ;; 263 | set_ir_cut) 264 | if ! [ $F_state ]; then 265 | getReturn 1234 "info" "The 'state' parameter is empty." 266 | exit 1 267 | fi 268 | 269 | if [ $F_state == 0 ]; then 270 | setGpio 25 1 && setGpio 26 0 271 | if [ $? -eq 0 ]; then 272 | getReturn 1234 "success" "The IR CUT has been changed state successfully to Off." 273 | else 274 | getReturn 1234 "error" "An error occurred while changing the IR CUT state to Off." 275 | fi 276 | elif [ $F_state == 1 ]; then 277 | setGpio 25 0 && setGpio 26 1 278 | if [ $? -eq 0 ]; then 279 | getReturn 1234 "success" "The IR CUT has been changed state successfully to On." 280 | else 281 | getReturn 1234 "error" "An error occurred while changing the IR CUT state to On." 282 | fi 283 | elif [ $F_state == 2 ]; then 284 | if [ `cat /sys/class/gpio/gpio25/value` == 0 -a `cat /sys/class/gpio/gpio26/value` == 1 ]; then 285 | setGpio 25 1 && setGpio 26 0 286 | if [ $? -eq 0 ]; then 287 | getReturn 1234 "success" "The IR CUT has been changed state successfully to Off." 288 | else 289 | getReturn 1234 "error" "An error occurred while changing the IR CUT state to Off." 290 | fi 291 | else 292 | setGpio 25 0 && setGpio 26 1 293 | if [ $? -eq 0 ]; then 294 | getReturn 1234 "success" "The IR CUT has been changed state successfully to On." 295 | else 296 | getReturn 1234 "error" "An error occurred while changing the IR CUT state to On." 297 | fi 298 | fi 299 | else 300 | getReturn 1234 "error" "Unsupported LED state '$F_state'." 301 | fi 302 | ;; 303 | # Control NightVision 304 | set_nightvision) 305 | if ! [ $F_state ]; then 306 | if [ $F_auto ]; then 307 | if [ $F_auto == 0 ]; then 308 | $SDPATH/daemon-scripts/nightvision-detection stop 309 | if [ $? -eq 0 ]; then 310 | getReturn 1234 "syccess" "Daemon Night Vision Detection stopped." 311 | exit 0 312 | else 313 | getReturn 1234 "error" "An error occurred while stopping the Daemon Night Vision Detection." 314 | exit 1 315 | fi 316 | elif [ $F_auto == 1 ]; then 317 | $SDPATH/daemon-scripts/nightvision-detection start 318 | if [ $? -eq 0 ]; then 319 | getReturn 1234 "syccess" "Daemon Night Vision Detection started." 320 | exit 0 321 | else 322 | getReturn 1234 "error" "An error occurred while starting the Daemon Night Vision Detection." 323 | exit 1 324 | fi 325 | else 326 | getReturn 1234 "error" "Unsupported auto state '$F_auto'." 327 | exit 1 328 | fi 329 | else 330 | getReturn 1234 "info" "The 'state' parameter is empty." 331 | exit 1 332 | fi 333 | fi 334 | 335 | if [ $F_state == 0 ]; then 336 | $BINPATH/setconf -k n -v 0 &>/dev/null & 337 | setGpio 25 0 && setGpio 26 1 && setGpio 49 1 338 | if [ $? -eq 0 ]; then 339 | getReturn 1234 "success" "The Night Vision mode has been changed state successfully to Disabled." 340 | else 341 | getReturn 1234 "error" "An error occurred while changing the Night Vision mode state to Disabled." 342 | fi 343 | elif [ $F_state == 1 ]; then 344 | $BINPATH/setconf -k n -v 1 &>/dev/null & 345 | setGpio 25 1 && setGpio 26 0 && setGpio 49 0 346 | if [ $? -eq 0 ]; then 347 | getReturn 1234 "success" "The Night Vision mode has been changed state successfully to Enabled." 348 | else 349 | getReturn 1234 "error" "An error occurred while changing the Night Vision mode state to On." 350 | fi 351 | elif [ $F_state == 2 ]; then 352 | if [ `cat /sys/class/gpio/gpio25/value` == 1 -a `cat /sys/class/gpio/gpio26/value` == 0 -a `cat /sys/class/gpio/gpio49/value` == 0 ]; then 353 | $BINPATH/setconf -k n -v 0 &>/dev/null & 354 | setGpio 25 0 && setGpio 26 1 && setGpio 49 1 355 | if [ $? -eq 0 ]; then 356 | getReturn 1234 "success" "The Night Vision mode has been changed state successfully to Disabled." 357 | else 358 | getReturn 1234 "error" "An error occurred while changing the Night Vision mode state to Disabled." 359 | fi 360 | else 361 | $BINPATH/setconf -k n -v 1 &>/dev/null & 362 | setGpio 25 1 && setGpio 26 0 && setGpio 49 0 363 | if [ $? -eq 0 ]; then 364 | getReturn 1234 "success" "The Night Vision mode has been changed state successfully to Enabled." 365 | else 366 | getReturn 1234 "error" "An error occurred while changing the Night Vision mode state to Enabled." 367 | fi 368 | fi 369 | else 370 | getReturn 1234 "error" "Unsupported Night Vision state '$F_state'." 371 | fi 372 | ;; 373 | # Control Motor PTZ 374 | set_motor) 375 | if [ -n "$F_ns" ]; then 376 | if [ "$F_ns" -le 2600 -a "$F_ns" -ge 0 ]; then 377 | F_ns=$F_ns 378 | else 379 | F_ns=2500 380 | fi 381 | else 382 | F_ns=$CONFIG_MOTOR_NS 383 | fi 384 | 385 | if ! [ -n $F_direction ]; then 386 | getReturn 1234 "info" "The 'direction' parameter is empty." 387 | exit 1 388 | fi 389 | 390 | case "$F_direction" in 391 | stop) 392 | $BINPATH/motor -d s &>/dev/null & 393 | if [ $? -eq 0 ]; then 394 | getReturn 1234 "success" "The motor on the camera has been stopped." 395 | else 396 | getReturn 1234 "error" "An error occurred while stopping the motor." 397 | fi 398 | ;; 399 | left) 400 | $BINPATH/motor -d l -s $F_ns &>/dev/null & 401 | if [ $? -eq 0 ]; then 402 | getReturn 1234 "success" "The motor has been moved to the left for '$F_ns'ns." 403 | else 404 | getReturn 1234 "error" "An error occurred while moved to the left for '$F_ns'ns." 405 | fi 406 | ;; 407 | right) 408 | $BINPATH/motor -d r -s $F_ns &>/dev/null & 409 | if [ $? -eq 0 ]; then 410 | getReturn 1234 "success" "The motor has been moved to the right for '$F_ns'ns." 411 | else 412 | getReturn 1234 "error" "An error occurred while moved to the right for '$F_ns'ns." 413 | fi 414 | ;; 415 | up) 416 | $BINPATH/motor -d u -s $F_ns &>/dev/null & 417 | if [ $? -eq 0 ]; then 418 | getReturn 1234 "success" "The motor has been moved to the up for '$F_ns'ns." 419 | else 420 | getReturn 1234 "error" "An error occurred while moved to the up for '$F_ns'ns." 421 | fi 422 | ;; 423 | down) 424 | $BINPATH/motor -d d -s $F_ns &>/dev/null & 425 | if [ $? -eq 0 ]; then 426 | getReturn 1234 "success" "The motor has been moved to the down for '$F_ns'ns." 427 | else 428 | getReturn 1234 "error" "An error occurred while moved to the down for '$F_ns'ns." 429 | fi 430 | ;; 431 | *) 432 | getReturn 1234 "error" "Unsupported LED '$F_led'." 433 | ;; 434 | esac 435 | ;; 436 | motor_calibrate) 437 | if [ $F_calibrate == "vertical" ]; then 438 | $BINPATH/motor -d v -s 100 &>/dev/null & 439 | if [ $? -eq 0 ]; then 440 | getReturn 1234 "success" "Motor is calibration on vertical." 441 | exit 0 442 | else 443 | getReturn 1234 "error" "An error occurred while calibrating vertical motor." 444 | exit 1 445 | fi 446 | elif [ $F_calibrate == "horizontal" ]; then 447 | $BINPATH/motor -d h -s 100 &>/dev/null & 448 | if [ $? -eq 0 ]; then 449 | getReturn 1234 "success" "Motor is calibration on horizontal." 450 | exit 0 451 | else 452 | getReturn 1234 "error" "An error occurred while calibrating horizontal motor." 453 | exit 1 454 | fi 455 | else 456 | getReturn 1234 "error" "Unsupported motor calibration=''$F_calibrate''." 457 | exit 1 458 | fi 459 | 460 | $BINPATH/motor -d v -s 100 &>/dev/null & 461 | sleep 2 462 | $BINPATH/motor -d h -s 100 &>/dev/null & 463 | if [ $? -eq 0 ]; then 464 | getReturn 1234 "success" "Both motors has been calibrated." 465 | else 466 | getReturn 1234 "error" "An error occurred while calibrating both motors." 467 | fi 468 | ;; 469 | # Control Audio 470 | audio_test) 471 | $BINPATH/ossplay -g 1000 /usr/share/notify/CN/init_ok.wav &>/dev/null & 472 | getReturn 1234 "info" "Started playing test audio." 473 | ;; 474 | audio_record_start) 475 | $BINPATH/busybox nohup $BINPATH/ossrecord $SDPATH/test.wav &>/dev/null & 476 | getReturn 1234 "info" "Audio recording to the \"audio.wav\" file has been started." 477 | ;; 478 | audio_record_stop) 479 | killall ossrecord 480 | getReturn 1234 "success" "The \"ossrecord\" process was killed." 481 | ;; 482 | # Control Video 483 | h264_record_start) 484 | $BINPATH/busybox nohup $BINPATH/h264Snap > $SDPATH/video.h264 &>/dev/null & 485 | ;; 486 | h264_record_stop) 487 | killall h264Snap 488 | getReturn 1234 "success" "The 'ossrecord' process was killed." 489 | ;; 490 | h264_start) 491 | $BINPATH/busybox nohup $BINPATH/v4l2rtspserver -F 10 &>/dev/null & 492 | getReturn 1234 "success" "The h264 RTSP started." 493 | ;; 494 | mjpeg_start) 495 | $BINPATH/busybox nohup $BINPATH/v4l2rtspserver -fMJPG -F 10 &>/dev/null & 496 | getReturn 1234 "success" "The mjpeg RTSP started." 497 | ;; 498 | rtsp_stop) 499 | killall v4l2rtspserver 500 | getReturn 1234 "success" "The 'v4l2rtspserver' process was killed." 501 | ;; 502 | get_snaphot) 503 | if [ $F_raw == 1 ]; then 504 | $BINPATH/getimage > /run/snaphot.jpg 505 | else 506 | if [ `ps | grep v4l2rtspserver | grep -v grep | wc -l` -eq 1 ]; then 507 | PARAMS=" -v 0 -rtsp_transport tcp -y -i rtsp://0.0.0.0:8554/unicast -vframes 1" 508 | if [ -n $F_width -a -n $F_height -a $F_width -eq $F_width -a $F_height -eq $F_height ]; then PARAMS="$PARAMS -s $F_width"x"$F_height"; fi 509 | if [ $F_flip == 1 ]; then PARAMS="$PARAMS -vf transpose=1,transpose=1"; fi 510 | if [ $F_nightvision == 1 ]; then PARAMS="$PARAMS -vf lutyuv=u=128:v=128"; fi 511 | PARAMS="$PARAMS -f image2 /run/snaphot.jpg" 512 | 513 | $BINPATH/busybox nohup $BINPATH/avconv $PARAMS 514 | else 515 | # $BINPATH/getimage > /run/snaphot.jpg 516 | # PARAMS="" 517 | # 518 | # if [ $F_nightvision == 1 ]; then PARAMS="$PARAMS -n"; fi 519 | # if [ $F_flip == 1 ]; then PARAMS="$PARAMS -r"; fi 520 | # if [ -n $F_width -a $F_width -eq $F_width ]; then PARAMS="$PARAMS -W $F_width"; else PARAMS="$PARAMS -W 1920"; fi 521 | # if [ -n $F_height -a $F_height -eq $F_height ]; then PARAMS="$PARAMS -H $F_height"; else PARAMS="$PARAMS -H 1080"; fi 522 | 523 | # $BINPATH/v4l2rtspserver -fMJPG $PARAMS -O /stdout > /run/snaphot.jpg 524 | 525 | $BINPATH/busybox nohup $BINPATH/v4l2rtspserver -fMJPG -F 10 &>/dev/null & 526 | 527 | PARAMS=" -v 0 -rtsp_transport tcp -y -i rtsp://0.0.0.0:8554/unicast -vframes 1" 528 | if [ -n $F_width -a -n $F_height -a $F_width -eq $F_width -a $F_height -eq $F_height ]; then PARAMS="$PARAMS -s $F_width"x"$F_height"; fi 529 | if [ $F_flip == 1 ]; then PARAMS="$PARAMS -vf transpose=1,transpose=1"; fi 530 | if [ $F_nightvision == 1 ]; then PARAMS="$PARAMS -vf lutyuv=u=128:v=128"; fi 531 | PARAMS="$PARAMS -f image2 /run/snaphot.jpg" 532 | 533 | $BINPATH/busybox nohup $BINPATH/avconv $PARAMS 534 | 535 | killall v4l2rtspserver 536 | fi 537 | fi 538 | 539 | if [ -f /run/snaphot.jpg ]; then 540 | if [ $F_json == 1 ]; then 541 | echo "Content-type: application/json; charset=utf-8; Pragma: no-cache; Expires: Wednesday, 27-Dec-95 05:29:10 GMT" 542 | echo "" 543 | echo "{ 544 | \"code\": 123, 545 | \"status\": \"info\", 546 | \"description\": \"Take a snaphot.\", 547 | \"snaphot\": \"`cat /run/snaphot.jpg | $BINPATH/busybox base64 | tr -d '\n'`\" 548 | }" 549 | rm /run/snaphot.jpg 550 | else 551 | echo "Content-type: image/jpg; charset=utf-8; Pragma: no-cache; Expires: Wednesday, 27-Dec-95 05:29:10 GMT" 552 | echo "" 553 | cat /run/snaphot.jpg 554 | rm /run/snaphot.jpg 555 | fi 556 | else 557 | getReturn 1234 "error" "An error occurred while taking snaphot." 558 | fi 559 | ;; 560 | # Other 561 | check_light) 562 | # if [ `dd if=/dev/jz_adc_aux_0 count=10 | sed -e 's/[^\.]//g' | wc -m` -lt 30 ]; then 563 | if [ `dd if=/dev/jz_adc_aux_0 count=20 | sed -e 's/[^\.]//g' | wc -m` -lt 50 ]; then 564 | getReturn 1234 "info" "Light sensor say's Day." 565 | else 566 | getReturn 1234 "info" "Light sensor say's Night." 567 | fi 568 | ;; 569 | xiaomi_start) 570 | getReturn 1234 "info" "Official software will running." 571 | busybox insmod /driver/sinfo.ko 2>&1 572 | busybox rmmod sample_motor 2>&1 573 | $BINPATH/busybox nohup /system/bin/iCamera & &>/dev/null & 574 | ;; 575 | *) 576 | getReturn 1234 "error" "Unsupported command '$F_action'" 577 | ;; 578 | esac 579 | else 580 | echo "Content-type: text/html; charset=utf-8; Pragma: no-cache; Expires: Wednesday, 27-Dec-95 05:29:10 GMT" 581 | echo "" 582 | 583 | echo " 584 | 585 | 586 |
Please see API Documentation on GitBook for know what use this API.
719 |Please read Manual on GitBook.
724 |Available on GitHub.
729 |You can report issue and suggest new function or contribute development.
730 |