Files
tcpserver-flow/app/net/parsers/NewCurrentCollectorParser.php
T
2026-03-08 22:58:56 +08:00

25 lines
541 B
PHP

<?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),
];
}
}