Add Zmodem/BINKP/EMSI
This commit is contained in:
48
app/Console/Commands/EMSISend.php
Normal file
48
app/Console/Commands/EMSISend.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Node;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\Sock\SocketClient;
|
||||
|
||||
use App\Classes\Protocol\EMSI as EMSIClass;
|
||||
|
||||
class EMSISend extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'emsi:send {ftn : FTN to Send to}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'EMSI send';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \App\Classes\Sock\SocketException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Call EMSI send');
|
||||
|
||||
$no = Node::findFTN($this->argument('ftn'));
|
||||
|
||||
$client = SocketClient::create($no->address,$no->port,38400);
|
||||
|
||||
$o = new EMSIClass;
|
||||
$o->session(EMSIClass::SESSION_AUTO,$client,$no);
|
||||
|
||||
Log::info(sprintf('Connection ended: %s',$client->getAddress()),['m'=>__METHOD__]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user