April 19, 2024

Communication scheme between ARM and X86 platform based on UDP protocol

With the application of artificial intelligence, ARM products have been spread across various fields: industrial control, wireless communications, consumer electronics, imaging and security products, including most of today's popular digital cameras and printers using ARM technology, in mobile phones. The 32-bit SIM smart card also uses ARM technology. In addition, ARM microprocessors and technologies are also used in many different fields, and will be more widely used in the future. Therefore, communication between ARM and other platforms is particularly important.

1. The nature of the UDP protocol

The UDP protocol is the abbreviation of the English User Datagram Protocol, the user datagram protocol, which is mainly used to support network applications that need to transfer data between computers. Many client/server mode network applications, including network video conferencing systems, require the use of the UDP protocol. The UDP protocol has been in use for many years since its inception. Although its initial brilliance has been overshadowed by some similar protocols, even today, UDP is still a very practical and feasible network transport layer protocol.

The UDP protocol uses its port number to reserve its own data transmission channel for different applications. The UDP and TCP protocols use this mechanism to support the simultaneous transmission and reception of data by multiple applications at the same time. The data sender (which can be the client or server) sends the UDP datagram through the source port, while the data receiver receives the data through the destination port. Some network applications can only use static ports reserved or registered for them; others can use unregistered dynamic ports. Because the UDP header uses two bytes to store the port number, the valid range for the port number is from 0 to 65535. In general, port numbers greater than 49151 represent dynamic ports.

The length of the datagram refers to the total number of bytes including the header and data portion. Because the length of the header is fixed, this field is primarily used to calculate the variable length portion of the data (also known as the data payload). The maximum length of a datagram varies depending on the work environment. In theory, the maximum length of a datagram containing a header is 65535 bytes. However, some practical applications tend to limit the size of the datagram, sometimes to 8192 bytes.

The UDP protocol uses the checksum in the header to ensure data security. The check value is first calculated by the data sender through a special algorithm, and needs to be recalculated after being passed to the receiver.

If a datagram is falsified by a third party during transmission or is damaged due to line noise, etc., the checksum calculation values ​​of the sender and the receiver will not match, and the UDP protocol can detect whether an error has occurred. In fact, the verification function in the UDP protocol is optional, and if it is turned off, the performance of the system can be improved. This is different from the TCP protocol, which requires a check value.

2. Implementation case

The implementation case is as follows: drawing on the touch screen to display on the LCD screen, simultaneously transmitting data through the network, causing it to be displayed on the computer screen, and the computer controls to clear the graphic on the liquid crystal screen.

Proceed as follows:

(1) New construction

(2) Edit the initialization network function in the main.c file. void InitNetWork()//Initialize the network{

U32 ipaddr32, ipmaskaddr32, ipgateaddr32;

U8 *Mac;

Ipaddr32=Get_ipaddr(); //Get the IP address

Ipmaskaddr32=Get_maskaddr();//Get the subnet mask

Ipgateaddr32=Get_gwaddr(); //Get the gateway

Mac=Get_mac(); //Get the network card address NetPortChoose(0);

/ / Select the network port, must be done before configuring the network

initOSNet(ipaddr32, ipmaskaddr32,

Ipgateaddr32, Mac); / / configure the network

OSTImeDly (1000); / / task hangs for 1 second

Printk("init Ethernet and UDP is

Ok! ");

}

(3) Define computer-side sockets, global variables (4) Write Main_Task tasks and message loops are mainly responsible for responding to touch screen messages, drawing on the screen, and then transferring the data to the computer.

The processing of the touch screen message is similar to the keyboard message. The message type pMsg->Message is OSM_TOUCH_SCREEN, and the message parameter pMsg->LParam contains the action information of the touch screen, which is defined as follows:

#define TCHSCR_ACTION_NULL

0

#define TCHSCR_ACTION_CLICK 1 //Touch

Screen click

#define TCHSCR_ACTION_DBCLICK 2 //Touch

Touch screen double click

#define TCHSCR_ACTION_DOWN 3 //Touch

Screen press

#define TCHSCR_ACTION_UP 4 //Touch

Screen lift

#define TCHSCR_ACTION_MOVE 5 //Touch

Screen movement

The message parameter pMsg->WParam contains the touch

The coordinate information of the point, the lower 16 bits are the X coordinate values, and the upper 16 bits are the Y coordinate values. Here, when the touch screen generates a "press" action, the MoveTo() function is used to set the coordinates of the drawing start point, and when the "move" action is generated, the line segment is drawn using the LineTo() function.

Mesh LED Display is only 50% much lower power consumption comparing to conventional LED Display. It selected the special LEDs and high efficiency power supplies.With over70% high transparency rate,can see through and is suitable for glass wall mounting. Over 6500 nits high brightness and vivid color is suitable for all outdoor environment. IP67 IP rating high protection level for whole of the screen, completely protected from water and dust of various weather condition with long life span. 10 to 18kg/m² gross lightweight and super slim screen is easy to install and save installation space.Easy maintenance for both front and rear service are available.

Description:Outdoor decorative LED mesh curtain screen is the perfect architectural decoration patterns in the daytime and night. And it becomes Led Display Screen to display image and video at night;Outdoor decorative Led Curtain Screen is ultra light weight design, which is easy to install. The convenient installation help everyone can install it easily by oneself. It can be packaged in one CMB which is save a lot in transportation. It is not only good for transport but also good for maintenance. Front and back maintain are available due to its special design;LED curtain mesh screen can be installed directly on the wall or glass. The hollow design makes permeability up to 70% which is conducive to ventilation and lighting. The exquisite appearance is good for decoration of shopping mall, hotel, office building and 5s shop etc;The frame shell save install material can be fixed easily. High-intensity sealed lamp with high quality up to IP67 protection level. The beautiful patterns can be customized for customer;LED curtain mesh screen can display text, image and video. Low power consumption is also good for long life span;IP67 protection rate features waterproof, anti-dust, wind resistant and anti-corrosion which is suitable for all kinds of using environment;LED curtain mesh screen is very easy to set up. The cabinet was designed by our engineer very attentively and adopted advanced technology to manufacture which support front and rear installation. Cooling with wind is environment friendly and make noise free;LED mesh curtain screen is widely used in stadium, shopping mall, 5s car shop and theme park etc.

LED mesh screen panel

Indoor Curtain LED Display

Indoor Curtain Led Display,Indoor Rental Curtain Led Display,Indoor Curtain Flexible Led Display,Indoor Foldable Curtain Led Display

Shenzhen Bako Vision Technology Co., Ltd. , http://www.rentalleddisplays.com