Test file for communicating with iSC250 terminals #379

Merged
merged 1 commit into from Jul 24, 2014

Conversation

Projects
None yet
2 participants
@jdpurdyvi
Contributor

jdpurdyvi commented Jul 24, 2014

Just the start of something 馃樅

@gohanman

This comment has been minimized.

Show comment Hide comment
@gohanman

gohanman Jul 24, 2014

Contributor

Nifty. Do you have to keep the connection open and listen for packets from the terminal, or can you periodically reconnect & request status for a polling style solution?

Also, nice CRC "function" :P

Contributor

gohanman commented Jul 24, 2014

Nifty. Do you have to keep the connection open and listen for packets from the terminal, or can you periodically reconnect & request status for a polling style solution?

Also, nice CRC "function" :P

gohanman added a commit that referenced this pull request Jul 24, 2014

Merge pull request #379 from jdpurdyvi/posDevelop
Test file for communicating with iSC250 terminals

@gohanman gohanman merged commit d7428bc into CORE-POS:posDevelop Jul 24, 2014

@jdpurdyvi

This comment has been minimized.

Show comment Hide comment
@jdpurdyvi

jdpurdyvi Jul 24, 2014

Contributor

It looks like the socket needs to remain open. I'm not exactly the expert in this though. Maybe a persistent named socket would work? Something to try.

If we socket_close() in the middle of the function, then socket_connect() to reconnect, the next message fails. Also, the Windows RBA test application doesn't work simultaneously while the PHP code is in a long sleep(), and vice-versa.

Anyways. Who's up for designing the "Retail Base Application" forms?

Contributor

jdpurdyvi commented Jul 24, 2014

It looks like the socket needs to remain open. I'm not exactly the expert in this though. Maybe a persistent named socket would work? Something to try.

If we socket_close() in the middle of the function, then socket_connect() to reconnect, the next message fails. Also, the Windows RBA test application doesn't work simultaneously while the PHP code is in a long sleep(), and vice-versa.

Anyways. Who's up for designing the "Retail Base Application" forms?

@gohanman

This comment has been minimized.

Show comment Hide comment
@gohanman

gohanman Jul 24, 2014

Contributor

If that's the case, I'm not sure PHP is the best choice for the low-level interaction. If the script's being executed by Apache, it's almost certain to get axed by some rule or another. A script running for minutes let alone hours is bad behavior. There are also sorts of process and memory management settings that would need to be adjusted and who knows what other potential instability that could introduce. Might even have to custom-compile Apache and/or PHP to remove some of the safeties. Running as CLI might work a little better but I wouldn't be surprised if memory usage spikes. I kind of doubt PHP's garbage collection is well-optimized for such an uncommon usage.

One way or another I think running it as a separate process from Apache will make it a hell of a lot easier to maintain an open connection. Communication between the long-running process and the browser presents the same challenge either way so no sense fighting against all the default execution limits.

Contributor

gohanman commented Jul 24, 2014

If that's the case, I'm not sure PHP is the best choice for the low-level interaction. If the script's being executed by Apache, it's almost certain to get axed by some rule or another. A script running for minutes let alone hours is bad behavior. There are also sorts of process and memory management settings that would need to be adjusted and who knows what other potential instability that could introduce. Might even have to custom-compile Apache and/or PHP to remove some of the safeties. Running as CLI might work a little better but I wouldn't be surprised if memory usage spikes. I kind of doubt PHP's garbage collection is well-optimized for such an uncommon usage.

One way or another I think running it as a separate process from Apache will make it a hell of a lot easier to maintain an open connection. Communication between the long-running process and the browser presents the same challenge either way so no sense fighting against all the default execution limits.

@gohanman

This comment has been minimized.

Show comment Hide comment
@gohanman

gohanman Jul 26, 2014

Contributor

Am I reading this right:
chr(2) => STX byte
next three bytes => command identifier (01., 28., etc)
body of command / params
chr(3) => ETX byte
long xox => CRC byte
chr(3) => another ETX

What are the middle bytes on the line display command - the 91000104? I'm guessing it designates which line to display on and the length of the displayed string. I'm striking out trying to guess where the length bytes were; that would let the rest fall into place.

Contributor

gohanman commented Jul 26, 2014

Am I reading this right:
chr(2) => STX byte
next three bytes => command identifier (01., 28., etc)
body of command / params
chr(3) => ETX byte
long xox => CRC byte
chr(3) => another ETX

What are the middle bytes on the line display command - the 91000104? I'm guessing it designates which line to display on and the length of the displayed string. I'm striking out trying to guess where the length bytes were; that would let the rest fall into place.

@jdpurdyvi

This comment has been minimized.

Show comment Hide comment
@jdpurdyvi

jdpurdyvi Jul 28, 2014

Contributor

For the display command, I just copied the output from the "Retail Base Test Application" that Ingenico provides. If you reference the RBA developer's guide, command "28." is "28.x: Set Variable Request". In this instance it means to set a certain line number of the currently displaying form to $10.25. Nothing too fancy. I wasn't able to spend any time on dev this weekend. Maybe Tuesday?

Contributor

jdpurdyvi commented Jul 28, 2014

For the display command, I just copied the output from the "Retail Base Test Application" that Ingenico provides. If you reference the RBA developer's guide, command "28." is "28.x: Set Variable Request". In this instance it means to set a certain line number of the currently displaying form to $10.25. Nothing too fancy. I wasn't able to spend any time on dev this weekend. Maybe Tuesday?

@gohanman

This comment has been minimized.

Show comment Hide comment
@gohanman

gohanman Jul 28, 2014

Contributor

Nevermind, I figured it out. I don't have the RBA documentation handy, but looking at the old i6550 implementation it appears to be identical.

Contributor

gohanman commented Jul 28, 2014

Nevermind, I figured it out. I don't have the RBA documentation handy, but looking at the old i6550 implementation it appears to be identical.

@jdpurdyvi jdpurdyvi deleted the jdpurdyvi:posDevelop branch Sep 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment