⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 term.h

📁 picocom 是一款linux下的串口调试工具
💻 H
📖 第 1 页 / 共 2 页
字号:
 * because the device was closed and re-opened. This function gives * you a way to do transparent "open"s and "close"s: Before you close * a device, it has certain settings managed by the library. When you * close it and then re-open it many of these settings are lost, since * the device reverts to system-default settings. By calling movefd, * you conceptually _maintain_ the old (pre-close) settings to the new * (post-open) filedes. */int term_replace (int oldfd, int newfd);/* * F term_apply  * * Applies the settings stored in the nexttermios structure associated * with the managed filedes "fd", to the respective terminal device. * It then copies nexttermios to currtermios. * * Returns negative on failure, non negative on success. In case of * failure the currtermios structure is not affected. */int term_apply (int fd);/* * F term_revert  * * Discards all the changes made to the nexttermios structure * associated with the managed filedes "fd" that have not been applied * to the device. It does this by copying currtermios to nexttermios. * * Returns negative on failure, non negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored. */int term_revert (int fd);/* F term_reset * * Reset the terminal device associated with the managed filedes "fd" * to its "original" settings. This function applies the settings in * the "origtermios" structure to the actual device. It also discards * the settings in the "currtermios" and "nexttermios" stuctures by * making them equal to "origtermios". * * Returns negative on failure, non-negative of success. On failure * the the "origtermios", "currtermios", and "nexttermios" stuctures * associated with the filedes remain unaffected. */int term_reset (int fd);/* * F term_refresh  * * Updates the contents of the currtermios structure associated with * the managed filedes "fd", by reading the settings from the * respective terminal device. * * Returns negative on failure, non negative on success. On failure * the currtermios structure remains unaffected. */int term_refresh (int fd);/* F term_set_raw *  * Sets the "nexttermios" structure associated with the managed * filedes "fd" to raw mode. The effective settings of the device are * not affected by this function. *  * Returns negative on failure, non-negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored. * * When in raw mode, no characters are processed by the terminal * driver and there is no line-discipline or buffering. More * technically setting to raw mode means, affecting the following * terminal settings as indicated: * *   -ignbrk -brkint -parmrk -istrip -inlcr -igncr -icrnl -ixon *   -opost -echo -echonl -icannon -isig -iexten -csize -parenb  *   cs8 min=1 time=0 */int term_set_raw (int fd);/* F term_set_baudrate * * Sets the baudrate in the "nexttermios" structure associated with * the managed filedes "fd" to "baudrate". The effective settings of * the device are not affected by this function. * * Supported baudrates: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, *   1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400 * * Returns negative on failure, non negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored. */int term_set_baudrate (int fd, int baudrate);/* F term_set_parity * * Sets the parity mode in the "nexttermios" structure associated with * the managed filedes "fd" to "parity". The effective settings of the * device are not affected by this function. * * Supported parity modes are: p_even, p_odd, p_none. * * Returns negative on failure, non negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored. */int term_set_parity (int fd, enum parity_e parity);/* F term_set_databits *  * Sets the databits number in the "nexttermios" structure associated * with the managed filedes "fd" to "databits". The effective settings * of the device are not affected by this function. * * 5, 6, 7, and 8 databits are supported by the library. * * Returns negative on failure, non negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored. */int term_set_databits (int fd, int databits);/* F term_set_flowcntrl * * Sets the folwcontrol mode in the "nexttermios" structure associated * with the managed filedes "fd" to "flowcntl". The effective settings * of the device are not affected by this function. *  * The following flow control modes are supportd by the library: * FC_NONE, FC_RTSCTS, FC_XONXOFF. * * Returns negative on failure, non negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored. */int term_set_flowcntrl (int fd, enum flowcntrl_e flowcntl);/* F term_set_hupcl * * Enables ("on" = nonzero) or disables ("on" = zero) the * "HUP-on-close" setting in the "nexttermios" structure associated * with the managed filedes "fd". The effective settings of the device * are not affected by this function. * * Returns negative on failure, non negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored.  */int term_set_hupcl (int fd, int on);/* F term_set_local. * * Enables ("local" = nonzero) or disables ("local" = zero) the * "local-mode" setting in the "nexttermios" structure associated with * the managed filedes "fd". The effective settings of the device are * not affected by this function. * * Returns negative on failure, non negative on success. Returns * failure only to indicate invalid arguments, so the return value can * be safely ignored.  */int term_set_local (int fd, int local);/* F temr_set * * Sets most of the parameters in the "nexttermios" structure * associated with the managed filedes "fd". Actually sets the * following: * *   Raw mode if "raw" is nonzero.  *   Baudrate to "baud".  *   Parity mode to "parity".  *   Flow control mode to "fc".  *   Enables local mode if "local" is nonzero, dis. otherwise.  *   Enables HUP-on-close if "hupcl" is nonzero, dis. otherwise * * The effective settings of the device are not affected by this * function. Additionally if the filedes "fd" is not managed, it is * added to the framework. * * Returns negative on failure, non negative on success. On failure * none of the settings of "nexttermios" is affected. *If* the filedes * "fd" is already in the framework, then the function returns failure * only to indicate invalid arguments, so, in this case, the return * value can be safely ignored. If the function successfully adds the * filedes to the framework, and following this it fails, then it will * remove the filedes before returning. */int term_set (int fd,               int raw,               int baud,               enum parity_e parity, int bits, enum flowcntrl_e fc,			  int local, int hupcl);/* F term_pulse_dtr * * Pulses the DTR line of the device associated with the managed * filedes "fd". The DTR line is lowered for 1sec and then raised * again. * * Returns negative on failure, non negative on success. */int term_pulse_dtr (int fd);/* F term_lower_dtr * * Lowers the DTR line of the device associated with the managed * filedes "fd". * * Returns negative on failure, non negative on success. */int term_lower_dtr (int fd);/* F term_raise_dtr * * Raises the DTR line of the device associated with the managed * filedes "fd". * * Returns negative on failure, non negative on success. */int term_raise_dtr (int fd);/* F term_drain  * * Drains (flushes) the output queue of the device associated with the * managed filedes "fd". This functions blocks until all the contents * of output queue have been transmited. * * Returns negative on failure, non negative on success. */int term_drain (int fd);/* F term_flush *  * Discards all the contents of the input AND output queues of the * device associated with the managed filedes "fd". Although it is * called flush this functions does NOT FLUSHES the terminal * queues. It just DISCARDS their contents. The name has stuck from * the POSIX terminal call: "tcflush". * * Returns negative on failure, non negative on success. */int term_flush (int fd);/* F term_break * * This function generates a break condition on the device associated * with the managed filedes "fd", by transmiting a stream of * zero-bits. The stream of zero-bits has a duriation typically * between 0.25 and 0.5 seconds. * * Returns negative on failure, non negative on success. */int term_break(int fd);/***************************************************************************/#endif /* of TERM_H *//***************************************************************************//* * Local Variables: * mode:c * tab-width: 4 * c-basic-offset: 4 * End: */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -