sim800
Version:
A modern and opiniated module for SIM800 GSM modems ( SIM800 / SIM800L ).
30 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CmgrCommand = void 0;
const node_pdu_1 = require("node-pdu");
const sim800_command_type_enum_1 = require("../interfaces/sim800-command-type.enum");
const sim800_command_1 = require("./sim800-command");
class CmgrCommand extends sim800_command_1.Sim800Command {
constructor(index) {
super({
command: sim800_command_type_enum_1.Sim800CommandType.ATCMGR,
arg: String(index),
completeWhen: 'OK',
errorWhen: 'ERROR',
expectedData: [
'+CMGR: ',
(data) => {
try {
const sms = (0, node_pdu_1.parse)(data);
return sms instanceof node_pdu_1.Deliver;
}
catch (error) {
return false;
}
},
],
});
}
}
exports.CmgrCommand = CmgrCommand;
//# sourceMappingURL=cmgr-command.js.map