Skip to content

Commit

Permalink
v1.4.3 protocol-dependent header message support
Browse files Browse the repository at this point in the history
  • Loading branch information
timgabets committed Feb 26, 2018
1 parent a96b92e commit ca919f0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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]

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 3 additions & 2 deletions src/controllers/builder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Builder{
constructor(luno = '000'){
constructor(luno = '000', header = ''){
this.luno = luno;
this.header = header;
}

/**
Expand Down Expand Up @@ -105,7 +106,7 @@ class Builder{
* @return {[type]} [description]
*/
build(object){
let message = '';
let message = this.header;

if(!object)
return null;
Expand Down
7 changes: 6 additions & 1 deletion src/listeners/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/listeners/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit ca919f0

Please sign in to comment.