📄 sdb.c
字号:
/* * Program: sdb * Funtcion: Serial Debugger * Date: 2002-02-19 * Version: 0.0.5 * Author: Paul Dean */#include <stdio.h> //* printf */#include <fcntl.h> //* open */#include <string.h> //* bzero */#include <stdlib.h> //* exit */#include <sys/times.h> //* times */#include <unistd.h> //* read, write, close */#include <sys/stat.h> //* lstat */#include "types.h"#include "serial.h"#include "args.h"#include "cmd.h"static PACKAGE_INFO pkgInfo = { "sdb", //* program */ "serutils", //* package */ "0.0.4", //* version */ "Paul Dean", //* author */ 0 //* reserved */}, *pPkgInfo = &pkgInfo;static PORT_INFO portInfo = { 0, //* debug */ 0, //* echo */ 115200, //* baudrate */ 0, //* port */ 8, //* databit */ 1, //* flow control: hardware */ 'N', //* no parity check */ "1", //* stopbit */ NULL, //* device */ 0 //* reserved */}, *pPortInfo = &portInfo;static ARGUMENTS args = { &pkgInfo, &portInfo };P_ARGUMENTS pArgs = &args;int main (int argc, char *argv[]){ parse_arguments (argc, argv, 0, pPkgInfo, pPortInfo); //* open comport */ if (OpenComPort (pPortInfo)) { fprintf (stderr, "Make sure /dev/ttyS%d " "not in use or you have enough privilege.\n\n", pPortInfo->port); exit (-1); } cmd (); CloseComPort (); exit (0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -