linux ´®¿Ú¶àÏß³ÌÎÊÌâ £¨100£©
ÏÂÃæÊÇÁ½¸öỊ̈߳¬tty_handleÊǶÁ£¬tty_testÊÇд£¨ÕâÀïÖ÷Òª×öÒ»¸ö²âÊÔд¹¦ÄÜ£©£¬
add_data_to_link_listÖ÷ÒªÊǰÑÊý¾Ý¼ÓÈë¶ÓÁÐÖУ¬µ«ÊÇÔËÐÐÒ»¶Îʱ¼äºó·¢ÏÖÖ»ÊÇ
ºìÉ«²¿·ÖΪ³ö´íµÄ¿ªÊ¼£¬ºÃÏñдÊý¾Ý¿ªÊ¼³ö´í£¬µ«ÊǽÓÊÜÏß³ÌÊÇÕý³£µÄ
×¢£ºµ±tty stop ·¢ËͳöÈ¥ºó´®¿ÚµÃµ½Ò»¸ö12×Ö½Ú³¤µÄÊý¾Ý£¬ºóÃæÊý¾ÝûÓнÓÊܵ½£¬ÕâÊÇΪʲô£¿
write 7 bytes to tty left
write 7 bytes to tty stop
Get data from tty and length is 12 :
[21]
[1]
[42]
[5]
[da]
[41]
[2c]
[1]
[70]
[a8]
[3b]
[ff]
write 7 bytes to tty left
write 7 bytes to tty stop
write 7 bytes to tty left
write 7 bytes to tty stop
write 7 bytes to tty left
write 7 bytes to tty stop
write 7 bytes to tty left
C/C++ code:
/************************************************************************************
* tty_handle() To read the data from tty and write into the queue.
************************************************************************************/
void tty_handle(void )
{
int length;
int k = 0,j=0;
unsigned char buffer[MAX_LEN];
if (DEBUG)
printf("Init tty handle thread\n");
if (fd_tty < 0)
{
printf("The tty port error while handing the tty\n");
exit(1);
}
memset(buffer,
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
ÎÒÔÚLINUXÉÏÓÐÁ½¸öÓû§
Ò» root
¶þ myadmin
¡¾myadmin@localhost~¡¿$ dir
Desktop myphp
[myadminlocalhost~]$ cd myphp¡¢DesktopÄܽøÈ¥ÆäËûµÄϵͳĿ¼½ø²»È¥
Ö»ÓÐÕâÁ½¸öĿ¼ ÎÒÏë½øÈëÆäËûµÄÏ ......
ÔÚLINUX裏°²裝 CURL 時,³ö現ÈçÏÂ報錯
checking for SSL support in libcurl... no
checking for curl_easy_perform in -lcurl... no
configure: error: There is something ......
ÏÖÔÚÐèÒªÔÚÒ»¸öǶÈëʽϵͳÖÐʵÏÖʱ¼äº¯Êý£¬±àÒëÆ÷δÌṩtime¿âº¯Êý£¬ÇëÎÊ´ó¼ÒÈçºÎÓÃcÓïÑÔʵÏÖʱ¼äº¯Êý°¡£¿
ÄêÔÂÈÕʱ·ÖÃë µ½ ÕûÊýÃ루´Ó1970Ä꿪ʼ£© Ö®¼äµÄÏà¹Ø×ª»»°¡
ÀàËÆmktime ºÍlocaltimeµÄ¹¦ÄÜ£¬Ð»Ð»
mktime ......