FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Britain information technology serial port WiFi programming method on WinCE industrial control motherboard

     

    When the ETA6103 works, the software is used as a serial port, and the AT command is sent to establish an internet connection. Configuration information, network data transmission is transmitted through a serial port. In order to facilitate user programming, Britain has encapsulated a CuartWifi class, providing a public function for configuring wireless networks and establishing TCP / UDP transfer, and users do not have to care for specific AT instructions. Instructions for use Reference routines UART_WIFI, add serial.h, serial.cpp, eta6103.h, etc., ETA6103.cpp. Add a reference #include "eta6103.h" You can create classes and use cuartwifi mywifi; WiFi connection management Reference routine APCONNECT, this routine simplicity how to manage AP connection Call Open, AutoCFG method initialization module Call the getaplist method query near the AP Call Connectap method connection AP Call the setFAP to set the AP after the default connection after the power is called (cannot be set when the AP cannot be connected) Call the disconnectap method to disconnect the AP connection Call the GetCurip query AP assigned to the IP address UDP communication Reference routine UDP. Call Open, AutoCFG method initialization module Cuartwifi m_eta6103; m_eta6103.open (); M_eta6103.autocfg (); Call ConnectUDP to open the UDP connection, and create a thread to wait for the message to receive IP = "192.168.201.248"; RPORT = 6000; LPORT = 5000; Bret = m_eta6103.connectudp (0, IP, RPORT, LPORT); m_hrecvthread = CreateThread (0, 0, Recvtread, this, 0, null); Send data to the distal end Charstr [32] = "Test UDP"; Len = Strlen (STR); Bret = m_eta6103.sendmsg (0, Str, LEN); Receive thread DWord Cudpdlg :: Recvtread (LPVOID LPARAM) { CUDPDLG * PDLG = (cudpdlg *) LPARAM; DWORD DWLEN; CharRecvbuf [1024]; While (! pdlg->m_bthreadstop) { PDLG->m_eta6103.waitmsg (); // Waiting for the message IF (dwret == Wait_Object_0) { PDLG->m_eta6103.readmsg (0, Recvbuf, 1023, & DWLEN); // read data While (dwlen>0) { // Processing code PDLG->m_eta6103.readmsg (0, Recvbuf, 1024, & DWLEN); // Recycled until reading buffer } } } // While (! pdlg->m_bthreadstop) Return0; } TCP client communication Reference routine TCPCLIENT. Call Open, AutoCFG method initialization module Cuartwifi m_eta6103; m_eta6103.open (); M_eta6103.autocfg (); Call ConnectUDP to open the UDP connection, and create a thread to wait for the message to receive IP = "192.168.201.248"; Port = 6000; Bret = m_eta6103. ConnectTCPServer (0, IP, Port); m_hrecvthread = CreateThread (0, 0, Recvtread, this, 0, null); Send data to the distal end Charstr [32] = "test tcpclient"; Len = Strlen (STR); Bret = m_eta6103.sendmsg (0, Str, LEN); Receive thread DWord Cudpdlg :: Recvtread (LPVOID LPARAM) { CUDPDLG * PDLG = (cudpdlg *) LPARAM; DWORD DWLEN; CharRecvbuf [1024]; While (! pdlg->m_bthreadstop) { PDLG->m_eta6103.waitmsg (); // Waiting for the message IF (dwret == Wait_Object_0) { PDLG->m_eta6103.readmsg (0, Recvbuf, 1023, & DWLEN); // read data While (dwlen>0) { // Processing code PDLG->m_eta6103.readmsg (0, Recvbuf, 1024, & DWLEN); // Recycled until reading buffer } } } // While (! pdlg->m_bthreadstop) Return0; } It can be seen that the TCP client uses and UDP almost the same, but the function called when connected is different. TCP server communication Reference routine TCPCLIENT. Call Open, AutoCFG method initialization module Cuartwifi m_eta6103; m_eta6103.open (); M_eta6103.autocfg (); Call CreateTCPServer Open the server connection and create a thread to listen to client connection and data reception. Port = 6000; Bret = m_eta6103. CreateTCPServer (port); m_hrecvthread = CreateThread (0, 0, Recvtread, this, 0, null); Send data to the corresponding client Charstr [32] = "Test TCPServer"; INTID = 1; // Send information to the client of the link number 1 Len = Strlen (STR); Bret = m_eta6103.sendmsg (ID, str, len); Receive thread In the routine, receive client connections and messages, encapsulate into the same event, and then determine the type of event by marking bit, the customer can modify the package code as needed, change to each event, or modified to multiple Threads to process connection events, and messages receive events. DWORD CTCPSERVERDLG :: Recvtread (LPVOID LPARAM) { CTCPSERVERDLG * PDLG = (CTCPSERVERDLG *) LPARAM; DWORD DWLEN; CharRecvbuf [1024]; DWORD DWRET; Intlen; Inti; INTN; While (! pdlg->m_bthreadstop) { DWRET = PDLG->m_eta6103.waitmsg (); IF (dwret == Wait_Object_0) { For (i = 0; I<5; i ++) { IF (pdlg->m_eta6103.m_link [i] .Eventflag & evt_stat) // state change { IF (pdlg->m_eta6103.m_link [i] .stat == 0) // close { // User Disconnect Code Processing } Else // connect { // User connection code processing } } IF (pdlg->m_eta6103.m_link [i] .Eventflag & evt_recv) // data reception { PDLG->m_eta6103.readmsg (i, recvbuf, 1020, & dwlen); While (dwlen>0) { // Data Receive Code Processing PDLG->m_eta6103.readmsg (0, Recvbuf, 1024, & DWLEN); } } IF (pdlg->m_eta6103.m_link [i] .Eventflag & evt_err) // Error event { // Error event code processing } PDLG->m_eta6103.m_link [i] .Eventflag = 0; } } } // While (! pdlg->m_bthreadstop) Return0; } Speed ​​test routine Routing TestSpeed ​​is used to test file reception speed. The baud rate (maximum 460800, recommended by default 115200) via setCuruart), the user can select the configuration that best suits you. Note that during high-speed transmission, if the receiving buffer is not ever, the data packet is lost. Recommended reference routines, add processing code in the corresponding location. Read more

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us