Closed borokovic closed 2 months ago
Thanks for the issue.
Please provide more information (e.g. a code example) to reproduce the error.
Im using serialport-gsm together with node-pdu.
const Enkoding = require("node-pdu/PDU/Helper"); const cmd = "*171*1*1*5*085767240000*123456#"; const perintah = Enkoding.encode7Bit(cmd); console.log(perintah);
I tried using the new version, but my capabilities were limited
I can achieve the desired result by appending a \r
to your input:
const pdu = require('./dist/index');
const cmd = '*171*1*1*5*085767240000*123456#\r';
const perintah = pdu.utils.Helper.encode7Bit(cmd);
console.log(perintah);
The website uses a \r
as padding character, whereby this library uses an @
as padding character when encoding:
Encode7bit produces incorrect for some strings. For example:
*171*1*1*5*085767240000*123456#
generates AAD82DA68AA962AA9A0A86ABDD6C37190D0683C15431D98C56B38D00 which should be AAD82DA68AA962AA9A0A86ABDD6C37190D0683C15431D98C56B38D1Ahttp://smstools3.kekekasvi.com/topic.php?id=288