uro / teltonika-fm-parser

Teltonika fm xxxx protocol encoder and decoder
The Unlicense
68 stars 45 forks source link

Getting an error while using the function decodeImei() #23

Closed harshwebdev22 closed 1 day ago

harshwebdev22 commented 3 weeks ago

Getting an error while using the function decodeImei() to decode imei using raw data as in the screen shot But it decoding the packet perfectly using decodeData() function

here is my code

$parser = new FmParser('tcp');
// Decode IMEI
$imei = $parser->decodeImei('0000000000000044080100000192579b98e00008dc51e8183b08d2001000bc0f0036000c05ef01f0011504c800450105b5000eb600084235fa43101544000002f1000056c2100055ba2300010000dcff');

// Decode Data Packet
$packet = $parser->decodeData('0000000000000044080100000192579b98e00008dc51e8183b08d2001000bc0f0036000c05ef01f0011504c800450105b5000eb600084235fa43101544000002f1000056c2100055ba2300010000dcff');

fread(): Argument #2 ($length) must be greater than 0

Screenshot 2024-11-08 at 7 32 07 PM