feat: 实现TCP Server

This commit is contained in:
zimoyin
2026-03-02 21:59:43 +08:00
parent 043306819b
commit a79dfae57d
144 changed files with 15785 additions and 140 deletions
@@ -0,0 +1,25 @@
<?php
namespace app\net\parsers;
/**
* 新版电流采集器报文解析器(长度38)
*/
class NewCurrentCollectorParser implements PacketParserInterface
{
public function supports(string $hexString): bool
{
return strlen($hexString) === 38;
}
public function parse(string $hexString): array
{
return [
'hexType' => 4,
'isMatched' => true,
'detectionDevice' => substr($hexString, 16, 2),
'channel1' => substr($hexString, 24, 2),
];
}
}