?? main.c
字號:
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include "ptzimpl.h"
int main(void){
/*int tty0,tty1,ss0,ss1;
if( (tty0=open("/dev/ttyS0", O_RDWR | O_NOCTTY)) < 0 )
{
printf("ERROR. Open ttyS0 device...\n");
//return -1;
}
else
printf("OK. Open ttyS0 device...\n");
close(tty0);
if( (tty1=open("/dev/ttyS1", O_RDWR | O_NOCTTY)) < 0 )
{
printf("ERROR. Open ttyS1 device...\n");
//return -1;
}
else
printf("OK. Open ttyS1 device...\n");
close(tty1);
if( (ss0=open("/dev/tts/2", O_RDWR | O_NOCTTY)) < 0 )
{
printf("ERROR. Open ss2 device...\n");
//return -1;
}
else
printf("OK. Open ss2 device...\n");
close(ss0);
if( (ss1=open("/dev/tts/3", O_RDWR | O_NOCTTY)) < 0 )
{
printf("ERROR. Open ss3 device...\n");
//return -1;
}
else
printf("OK. Open ss3 device...\n");
close(ss1);
/*while(1){
printf("echo test > /dev/tts/1\n");
system("echo 1000> /dev/tts/1");
system("echo 1000> /dev/ttyS1");
//usleep(10000);
}*/
if( Init485() != 0 )
{
printf("ERROR. Init 485\n");
return -1;
}
int i=20;
while(1){
DeviceControl(i);
if(i==0)
i=20;
else i--;
sleep(1);
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -