Embedded Linux development 7 -- UART serial communication

1. Background knowledge 1.1 UART communication format    the full name of serial port is called serial interface, which is usually also called COM interface. Serial interface refers to the sequential transmission of data one by one, and the communication line is simple. Two lines can be used to realize two-way communication, one for ...

Posted by argoSquirrel on Tue, 11 Jan 2022 01:01:21 +0100

C++ File Operation Knowledge Summary

Catalog Basic File ConceptsFile I/OFile Order Read-Write and Random File Read-WriteOpening and Closing of FilesText File Processingget(), getline(), put() functionOther operations 1. Basic Document Concepts The file can be viewed as a continuous set of strings that have no size Strings exist as streams, and files can also be viewed as a c ...

Posted by always_confused on Mon, 10 Jan 2022 18:28:27 +0100

MASQUERADE address selection and port selection of SNAT

Environmental Science:Version: kernel-5.4.54 amd64 dual core Ubuntu 18 04k8s cluster network component: flannel, Kube proxy: IPVSCode tool: vs code1. GeneralSNAT (source address translation) is the core function of the NAT table of IPTABLES. It is widely used in Intranet environments such as routers, ECs and K8S clusters. It is an indispensable ...

Posted by Nightslyr on Mon, 10 Jan 2022 13:16:22 +0100

Connection tracking and NAT analysis of IPTABLES

1.Netfilter structure diagramThe core of Netfilter framework is five hook points. You can filter and modify packets by registering functions at the hook pointsIPTABLES and IPVS realize their main functions by registering hook functionsip_rcv is the entry function of the three-layer protocol stackdev_queue_xmit will finally call the network devi ...

Posted by jbatty on Mon, 10 Jan 2022 11:42:46 +0100

C language learning 10: array

catalogue 1. Basic concept of array 1.1 array 1.2 subscript 1.3 memory continuity of array elements 1.4 array initialization 2. Precautions for array use 1. Basic concept of array 1.1 array A set of data of the same type stored in memory in turn is called an array. Each data it contains is called array element, and the ...

Posted by lewisstevens1 on Mon, 10 Jan 2022 07:39:42 +0100

Data structure -- sequential table (array) topic

Array of related interview questions Click to enter > > Remove element (LeetCode) Give you an array num and a value val. you need to remove all elements with a value equal to Val in place and return the new length of the removed array. Instead of using extra array space, you must use only O(1) extra space and modify the input arr ...

Posted by Valord on Sun, 09 Jan 2022 15:10:09 +0100

C language and character related processing functions

String input function In C language, the input of string can use scanf function or gets function Enter a string with the scanf function The general form of the period is: scanf ('% s', character array name). Scanf processing can input a string, an integer and a single character When using the scanf function to input a string, spaces are tre ...

Posted by citytours on Sun, 09 Jan 2022 06:07:16 +0100

[C language] classroom exercises

The first exercise is to calculate factorials: int main() { int i = 0; int ret = 1; int n = 0; while (1) { scanf("%d", &n); if (0 == n) { printf("Exit program\n"); break; } for (i = 1,ret = 1; i <= n; i++) { ret *= i; } printf("%d The factorial of is:%d\n", n, ret); } return 0; } Compared with the cla ...

Posted by latvaustin on Sun, 09 Jan 2022 05:18:49 +0100

"Bogey sends you an invitation to learn", a one-way and two-way linked list of data structure

catalogue order Hi, this is fox Single linked list Node of one-way linked list Unidirectional linked list experiment Experiment content: Experiment Description: Source code Operation screenshot: Bidirectional linked list Creation of bidirectional linked list Bidirectional linked list experiment Experiment content: Experiment Descr ...

Posted by sonny on Sun, 09 Jan 2022 01:53:30 +0100

C language -- function

catalogue Basic use of functions Parameters of function  Function call Nested calls and chained access to functions Declaration and use of functions Recursion of function Basic use and recursion of functions 1, What is a function Baidu Encyclopedia's definition of function: https://baike.baidu.com/item/%E5%87%BD%E6%95%B0/301912https ...

Posted by myanavrin on Sat, 08 Jan 2022 17:32:20 +0100