diff --git a/CHANGELOG b/CHANGELOG index 11b3d44..edcb2d0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +February 2018 + 1.4.3 protocol-dependent header message support + January 2018 1.4.2 checking entered terminal and PIN key values to be [^a-fA-F0-9] diff --git a/package.json b/package.json index b87cace..3e00099 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "electron-atm", "productName": "Electron ATM", - "version": "1.4.2", + "version": "1.4.3", "description": "A simple APTRA Advance NDC ATM emulator", "main": "main.js", "scripts": { diff --git a/src/controllers/builder.js b/src/controllers/builder.js index 9b34f1f..66dfde4 100644 --- a/src/controllers/builder.js +++ b/src/controllers/builder.js @@ -1,6 +1,7 @@ class Builder{ - constructor(luno = '000'){ + constructor(luno = '000', header = ''){ this.luno = luno; + this.header = header; } /** @@ -105,7 +106,7 @@ class Builder{ * @return {[type]} [description] */ build(object){ - let message = ''; + let message = this.header; if(!object) return null; diff --git a/src/listeners/builder.js b/src/listeners/builder.js index b3a9cef..e739ef7 100644 --- a/src/listeners/builder.js +++ b/src/listeners/builder.js @@ -10,7 +10,12 @@ if(host && host.luno) else luno = '000'; -let builder = new Builder(luno); +if(host && host.header) + header = host.header; +else + header = ''; + +let builder = new Builder(luno, header); ipc.on('build-message-to-host', (event, message) => { var built = builder.build(message); diff --git a/src/listeners/settings.js b/src/listeners/settings.js index 356ca77..6f8753e 100644 --- a/src/listeners/settings.js +++ b/src/listeners/settings.js @@ -7,6 +7,7 @@ $(function(){ $('#settings-atm-host').val(host.ip); $('#settings-atm-port').val(host.port); $('#settings-luno').val(host.luno); + $('#settings-header').val(host.header); } let keys = {}; @@ -76,7 +77,8 @@ $(function(){ var host = { ip: $('#settings-atm-host').val(), port: $('#settings-atm-port').val(), - luno: $('#settings-luno').val() + luno: $('#settings-luno').val(), + header: $('#settings-header').val() }; settings.set('host', host);