Commit 2253f95a770057e0ff75b09eb75891c4fcace571

Authored by Adhidarma Hadiwinoto
1 parent 4d61b71e54
Exists in master

config.disable_delete_inbox_on_startup

Showing 2 changed files with 8 additions and 4 deletions Side-by-side Diff

... ... @@ -12,6 +12,8 @@
12 12 "http_command_server": {
13 13 "apikey": "PLEASE_CHANGE_ME",
14 14 "listen_port": "2110"
15   - }
  15 + },
  16 +
  17 + "disable_delete_inbox_on_startup": false
16 18  
17 19 }
18 20 \ No newline at end of file
... ... @@ -224,14 +224,16 @@ function init() {
224 224 logger.info('Querying signal strength');
225 225 await writeToPortAndWaitForOK('AT+CSQ\r');
226 226  
227   - logger.info('Deleting existing messages');
228   - // await writeToPortAndWaitForOK('AT+CMGD=0,4\r');
229   -
230 227 await readManufacturer();
231 228 await readModel();
232 229 await readIMEI();
233 230 await readIMSI();
234 231  
  232 + if (!config.disable_delete_inbox_on_startup) {
  233 + logger.info('Deleting existing messages');
  234 + await writeToPortAndWaitForOK('AT+CMGD=0,4\r');
  235 + }
  236 +
235 237 port.unpipe(parserWaitForOK);
236 238  
237 239 registerSignalStrengthBackgroundQuery();