IAC binary
This commit is contained in:
parent
34569f476f
commit
0189b091ab
@ -943,10 +943,35 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
|||||||
// Peek for the next 2 chars
|
// Peek for the next 2 chars
|
||||||
do {
|
do {
|
||||||
$iac = $this->client->read(10,1,MSG_PEEK);
|
$iac = $this->client->read(10,1,MSG_PEEK);
|
||||||
|
$iaccmd = NULL;
|
||||||
|
|
||||||
|
switch (ord($iac)) {
|
||||||
|
case 0x00:
|
||||||
|
if ($iaccmd === 0xfb) {
|
||||||
|
Log::debug(sprintf('%s: - IAC WILL BINARY [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
|
// Config with DO
|
||||||
|
$this->client->send(chr(0xff).chr(0xfd).$iac);
|
||||||
|
} elseif ($iaccmd === 0xfd) {
|
||||||
|
Log::debug(sprintf('%s: - IAC DO BINARY [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
|
// Config with WILL
|
||||||
|
$this->client->send(chr(0xff).chr(0xfb).$iac);
|
||||||
|
$this->client->iac_bin = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 0xfb:
|
||||||
|
Log::debug(sprintf('%s: - IAC WILL [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
$iaccmd = ord($iac);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0xfd:
|
||||||
|
Log::debug(sprintf('%s: - IAC DO [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
$iaccmd = ord($iac);
|
||||||
|
break;
|
||||||
|
|
||||||
switch ($iac) {
|
|
||||||
default:
|
default:
|
||||||
Log::debug(sprintf('%s: - IAC [%02x]',self::LOGKEY,$iac));
|
Log::debug(sprintf('%s: - IAC [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
$iac = NULL;
|
$iac = NULL;
|
||||||
}
|
}
|
||||||
|
@ -197,6 +197,7 @@ final class SocketClient {
|
|||||||
return match ($key) {
|
return match ($key) {
|
||||||
'address_remote', 'port_remote' => $this->{$key},
|
'address_remote', 'port_remote' => $this->{$key},
|
||||||
'cps', 'speed' => Arr::get($this->session,$key),
|
'cps', 'speed' => Arr::get($this->session,$key),
|
||||||
|
'iac_bin' => Arr::get($this->session,$key),
|
||||||
'rx_free' => self::RX_BUF_SIZE-$this->rx_left,
|
'rx_free' => self::RX_BUF_SIZE-$this->rx_left,
|
||||||
'rx_left' => strlen($this->rx_buf),
|
'rx_left' => strlen($this->rx_buf),
|
||||||
'tx_free' => self::TX_BUF_SIZE-strlen($this->tx_buf),
|
'tx_free' => self::TX_BUF_SIZE-strlen($this->tx_buf),
|
||||||
@ -210,6 +211,7 @@ final class SocketClient {
|
|||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'cps':
|
case 'cps':
|
||||||
case 'speed':
|
case 'speed':
|
||||||
|
case 'iac_bin':
|
||||||
$this->session[$key] = $value;
|
$this->session[$key] = $value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user