push
This commit is contained in:
@@ -687,19 +687,20 @@ class AstmMessageService
|
||||
protected function reassembleAstmFrames(string $raw): string
|
||||
{
|
||||
$buffer = '';
|
||||
$frames = preg_split('/\x02\d/', $raw); // STX + sequence number
|
||||
$frames = [];
|
||||
|
||||
foreach ($frames as $frame) {
|
||||
// buang ETX, checksum, EOT
|
||||
$frame = preg_replace('/\x03.*$/s', '', $frame);
|
||||
$frame = preg_replace('/\x04/', '', $frame);
|
||||
// ambil semua frame
|
||||
preg_match_all('/\x02(\d)(.*?)\x03(..)/s', $raw, $frames);
|
||||
|
||||
$buffer .= $frame;
|
||||
foreach ($frames[2] as $content) {
|
||||
// gabungkan isi frame (tanpa ETX & checksum)
|
||||
$buffer .= $content;
|
||||
}
|
||||
|
||||
return trim($buffer);
|
||||
}
|
||||
|
||||
|
||||
protected function processBDAstmResponse(string $raw, $data): bool
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user