Data processing gateway refers to the storage protocol conversion and data in the buffer zone and forwarding. When receiving a set of data, the first protocol conversion, and then save it to the buffer corresponding. High and low CAN protocols for the same, does not need to switch, so is the conversion between CAN protocol and LIN protocol.
CAN protocol and LIN protocol are based on frame (frame) for the data unit communication. In the conversion of LIN protocol to the CAN protocol, the first is the LIN frame decomposition, the identifier field (identfield) extracted from the ID identifier, data from the field (data field) to extract valid data, and then the information package into line with the requirements of the CAN frame format. So is the conversion of CAN protocol to the LIN protocol process. The first CAN frame decomposition, from the arbitration domain (arbitration field) and data domain (data field) to extract the useful information, and then packaged into accord with the LIN frame format requirements.
Data from the 4 buffer BUF1 ~ BUF4 FIFO (First InFirst Out) buffer, the circular queue (circular queue) to realize data fifo. Two pointers Read and Write respectively, indicating position team the first element and tail elements in the buffer space, their initial value in the queue initialization should be set to 0, each read or write to a data, to adjust parameters of the buffer zone. Write data, inserting a new element Write which refers to the location, and then add 1 Write; read data, delete the element pointed to by Read, then add Read 1 and return the deleted elements.