In serial programming mode, o_nonblock or o_ndelay is not set for open.
Returns the c_cc [vtime] And c_cc [Vmin] image read functions.
Vtime defines the waiting time, in the unit of hundreds of milliseconds (usually an 8-bit unsigned char variable, the value cannot be greater than cc_t ).
Vmin defines the minimum number of bytes to wait, which may be 0.
If the value of
Vtime defines the amount of time that is required to wait (the value cannot be greater than cc_t).Vmin defines the minimum number of bytes required to wait.Options.c_cc[vtime] = X; Sets the time-out period from acquisition to 1 bytes to start a timerOptions.c_cc[vmin] = Y; Set the minimum number of bytes required to waitEffects on the read () function in the original mode :1, x=0,y!=0. The function read ()
There are two Arrays: {code ...} compare whether the values of Vtime in array A and Date in array B are the same. If the values are the same, merge the values (vtime, qr, Date, and Md5) into array C. If the values are different, put array A in array C. (Array A must be compared with array B. array B has only two Arrays:
===========A:array( [0] => Array ( [
Struct termios options; // Serial Port Configuration StructureTcgetattr (FD, options); // get the current settingsBzero ( options, sizeof (options ));Options. c_cflag | = b115200 | clocal | cread; // set the baud rate, connect locally, and enable receivingOptions. c_cflag = ~ Csize; // mask the data bitOptions. c_cflag | = cs8; // The data bit is 8, and cs7 for 7Options. c_cflag = ~ Cstopb; // One Stop bit. The two stop bits are | = cstopbOptions. c_cflag = ~ Parenb; // no verification// Op
coledatetime have almost the same functions.Compared with ctime, coledatetime supports DWORD variables.The number of digits used by coledatetime is twice that of the Double Floating Point. Since ctime is only a simple calculation of the number of seconds passed since January 1, January 1, 1970, so it will reach 4 2 9 4 9 6 7 2 9 5 in 2 0 3 7 years, thus it cannot be used again.// Cstring ---> coledatetimeColevariant vtime (strcstring); coledatetime t
do the contrast to confirm with.Here is a snippet of network code for analysis:Serial Port Operation Example#include #include #include #include #include #include "serial.h"#define DEV_NAME "/dev/ttys1"int set_port_attr (int fd,int baudrate, int databit, const char *stopbit, char parity, int vtime,int vmin);static void Set_baudrate (struct termios *opt, unsigned int baudrate);static void Set_data_bit (struct termios *opt, unsigned int databit);static
' | cut-d'-f 5-
Note: Cut is a text truncation command. It uses spaces as separators to intercept fields after 5th bits,
To intercept: 5th elements and 8th elements, write as follows:
Ffmpeg-I test. flv 2> 1 | grep 'creationdate' | cut-d'-f 5, 8
② Obtain the video size
Use cut to intercept the tenth element with space as the separator, which is also the video size.
Ffmpeg-I test. flv 2> 1 | grep 'video' | cut-d'-f 10 | sed s /,//
Sed command: Sed's/string to be replaced/New String/G'
For exa
'-F 5-
Description: Cut is a text intercept command: Take a space as a separator, intercept the 5th-bit field,
If you want to intercept: elements 5th and 8th, you should write this:
Ffmpeg-i test.flv 2>1 | grep ' CreationDate ' | Cut-d '-F 5,8
② Get video size size
Use cut to intercept a space-delimited tenth element is also a video dimension
Ffmpeg-i test.flv 2>1 | grep ' Video ' | Cut-d '-F 10 | Sed s/,//
sed command : sed ' s/the string/new string to be replaced/g '
For example:
The example in this article describes how PHP custom functions implement the format of seconds. Share to everyone for your reference, specific as follows:
function Vtime ($time) {
$output = ';
foreach (Array (86400 => ' Day ', 3600 => ' hour ', => ' min ', 1 => ' sec ') as $key => $value) {
if ($time >= $k EY) $output. = Floor ($time/$key). $value;
$time%= $key;
}
if ($output = = ") {
$output =0;
}
return $output;
}
$now =
VARCHAR2 (30);
BEGIN
Department:=emppack.seldname (7369);
Dbms_output. Put_Line (' Department name is ' | | department);
End;
/
Q. Write a database trigger to show when an employee raises a salary at any time.
A.
CREATE OR REPLACE TRIGGER Emp_salup
After UPDATE of Sal on EMP
For each ROW
DECLARE
Vsal number;
BEGIN
VSAL:=NVL (: new.sal,0)-NVL (: old.sal,0);
IF vsal
Raise_application_error ( -20001, ' increased Salary is not zero and littler than zero ');
End IF;
End;
/
Q. Wr
a text intercept command: Take a space as a delimiter, intercept the 5th bit after the field,
If you want to intercept: the 5th element and the 8th element, you should write this:
Ffmpeg-i test.flv 2>1 | grep ' CreationDate ' | Cut-d '-F 5,8
② Get Video size
Using cut to intercept the tenth element with a space delimiter is also the video size
Ffmpeg-i test.flv 2>1 | grep ' Video ' | Cut-d '-F 10 | Sed s/,//
sed command : sed ' s/string to replace/new string/g '
For example: sed s/,//: means:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.