rbsb.c

来自「Embedded zModem C sources」· C语言 代码 · 共 51 行

C
51
字号
#include "zmodem.h"
#include "rbsb.h"
#include "zport.h"
#include "v2cfg.h"

#if defined(RZ_MODULE)

///////////////////////////////////////////////////////////////////////////////
// Send a string to the modem, processing for \336 and \335
int zPuts(char *str)
{
	int c;

	while(*str)
	{
		switch(c = *str++)
		{
			case '\336' :
				// sleep one second
				//zDelay(1000);
				break;
			case '\335' :
				// send break signal to modem 
				// xSendBreak();
				break;
			default :
				SendLine(c);
				break;
		}
	}
	return 0;
}

///////////////////////////////////////////////////////////////////////////////
// ReadLine(int nTimeout)
// nTimeout : if 0, no timeout.
// return TIMEOUT if timeouted.
// else char read.
int ReadLine(int nTimeout)
{
	int c;

	while(1)
	{
		if((c = zGetch(nTimeout)) < 0)
			return TIMEOUT;
		else
			return (c & 0377);
	}
}
#endif//zmodem

⌨️ 快捷键说明

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