Enabled configuration of EMSI tunables in setup

This commit is contained in:
2023-07-06 09:20:33 +10:00
parent c3d4c1fc31
commit 0f7a42c503
4 changed files with 26 additions and 25 deletions

View File

@@ -39,6 +39,13 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
private const NL = "\n";
private const DEL = "\x08";
/* FEATURES */
/** Ignore NRQ */
public const F_IGNORE_NRQ = 1<<0;
/** Send an immediate EMSI_INQ on connect */
public const F_DO_PREVENT = 1<<1;
private const EMSI_BUF = 8192;
private const TMP_LEN = 1024;
@@ -825,6 +832,9 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
if ($this->originate) {
$gotreq = 0;
if ($this->setup->optionGet(EMSI::F_DO_PREVENT,'emsi_options'))
$this->capSet(EMSI::F_DO_PREVENT,self::O_YES);
// Send a character to get a response from the remote
$t1 = $this->client->timer_set(self::EMSI_HSTIMEOUT);
do {
@@ -848,8 +858,8 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
return self::TIMEOUT;
if ($this->client->timer_expired($t2)) {
if ($this->setup->do_prevent && $tries === 0) {
$this->setup->do_prevent = 0;
if ($this->capGet(EMSI::F_DO_PREVENT,self::O_YES) && $tries === 0) {
$this->capSet(EMSI::F_DO_PREVENT,self::O_NO);
$this->client->buffer_add(self::EMSI_INQ.self::CR);
$this->client->buffer_flush(5);