在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 測試測量 > 設計應用 > 大型貨車超載超速實時檢測系統(tǒng)

            大型貨車超載超速實時檢測系統(tǒng)

            作者: 時間:2014-04-18 來源:網(wǎng)絡 收藏

            本文引用地址:http://www.biyoush.com/article/259120.htm

            4.3 GPRS模塊

            ARM將收集到的重量和速度信號經過處理之后,如果貨車超載或者超速就將相關的貨車信息(車牌號,超速超重多少等)傳送到GPRS模塊,通過GPRS傳送到主服務器上,主程序程序流程圖如圖4.9:

            /************************************************

            * GPRS demo, use ppp to connect internet

            * use ttyS1 to ctrol GPRS

            * by Zou jian guo [email protected]>

            * 2004-11-02

            *************************************************/

            #include termios.h>

            #include stdio.h>

            #include unistd.h>

            #include fcntl.h>

            #include time.h>

            //#include sys/signal.h>

            #include pthread.h>

            #include tty.h

            #include gprs.h

            /*--------------------------------------------------------*/

            #define ENDMINITERM 27 /* ESC to quit miniterm */

            #define FALSE 0

            #define TRUE 1

            /*--------------------------------------------------------*/

            volatile int STOP=FALSE;

            int GET_GPRS_OK=FALSE;

            int baud=B115200;

            int get_baudrate(int argc,char** argv);

            char * cmd[20]={

            at,

            ate1,

            at+chfa=1, //設置通話通道為1,AT+CHFA 命令切換主副音頻通道

            at+clvl=100, //設置受話器音量最大, AT+CLVL 命令可以調節(jié)輸出音頻信號增益

            at+cmic=1,10 //設置通道1的話筒增益

            // atd12345678r,

            };

            void * keyshell() ;

            /* modem input handler */

            void* gprs_show(void * data)

            {

            while(1)

            {

            if(GET_GPRS_OK){

            GET_GPRS_OK=FALSE;

            printf(%s,GPRS_BUF);

            GPRS_parse(GPRS_BUF,gps_info);

            GPRS_show();

            }

            usleep(100);

            if(STOP)break;

            }

            }

            /* modem input handler */

            void* gprs_read(void * data)

            {

            int i=0;

            char c;

            char buf[1024];

            printf(nread modemn);

            while (STOP==FALSE)

            {

            tty_read(c,1);

            printf(%c,c);

            }

            printf(exit from reading modemn);

            return NULL;

            }

            int main(int argc,char** argv)

            {

            int ok;

            pthread_t th_a, th_b, th_show;

            void * retval;

            if(argc 2) {

            printf ( Default baudrate is 115200 bps. If not, please enter the baudrate as a parametern);

            }

            else

            baud=get_baudrate(argc, argv);

            tty_init();

            pthread_create(th_a, NULL, keyshell, 0);

            pthread_create(th_b, NULL, gprs_read, 0);

            pthread_create(th_show, NULL, gprs_show, 0);

            while(!STOP){

            usleep(100000);

            }

            tty_end();

            exit(0);

            }

            int get_baudrate(int argc,char** argv)

            {

            int v=atoi(argv[1]);

            switch(v){

            case 4800:

            return B4800;

            case 9600:

            return B9600;

            case 19200:

            return B19200;

            case 38400:

            return B38400;

            case 57600:

            return B57600;

            case 115200:

            return B115200;

            default:

            return -1;

            }

            }

            void gprs_init()

            {

            int i;

            for(i=0; i5; i++) {

            tty_writecmd(cmd[i], strlen(cmd[i]));

            }

            }

            void gprs_hold()

            {

            tty_writecmd(at, strlen(at));

            tty_writecmd(ath, strlen(ath));

            }

            void gprs_ans()

            {

            tty_writecmd(at, strlen(at));

            tty_writecmd(ata, strlen(ata));

            }

            void gprs_call(char *number, int num)

            {

            tty_write(atd, strlen(atd));

            tty_write(number, num);

            tty_write(;r, strlen(;r));

            usleep(200000);

            }

            void gprs_msg(char *number, int num)

            {

            char ctl[]={26,0};

            char text[]=Welcome to use up-tech embedded platform!;

            tty_writecmd(at, strlen(at));

            tty_writecmd(at, strlen(at));

            tty_writecmd(at+cmgf=1, strlen(at+cmgf=1));

            tty_write(at+cmgs=, strlen(at+cmgs=));

            tty_write(, strlen());

            tty_write(number, strlen(number));

            tty_write(, strlen());

            tty_write(;r, strlen(;r));

            tty_write(text, strlen(text));

            tty_write(ctl, 1);

            usleep(300000);

            }

            void gprs_baud(char *baud,int num)

            {

            tty_write(at+ipr=, strlen(at+ipr=));

            tty_writecmd(baud, strlen(baud) );

            usleep(200000);

            }

            稱重傳感器相關文章:稱重傳感器原理
            傾角傳感器相關文章:傾角傳感器原理


            關鍵詞: 超載檢測 超速檢測 霍爾開關 ARM9

            評論


            相關推薦

            技術專區(qū)

            關閉