Skip to content

Commit

Permalink
Fix RS-232 reset implementation
Browse files Browse the repository at this point in the history
Fix bug in reset command that was causing the reset command to not work. Note: this requires
firmware support for the command to function. If there acceptor does not reset, request a firmware
update from PTI.
  • Loading branch information
Cory Todd committed Jan 20, 2016
1 parent 5f210c0 commit 5514b90
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Apex7000_BillValidator/ApexValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ private void DoResetAcceptor()
{
byte[] reset = Request.ResetTarget;
// Toggle message number (ack #) if last message was okay and not a re-send request.
reset[2] = (byte)(0x10 | Ack);
Checksum(reset);
reset[2] = (byte)((Ack == 0) ? 0x60 : 0x61);
reset = Checksum(reset);
WriteWrapper(reset);

// Toggle ACK number
Expand Down
2 changes: 1 addition & 1 deletion Apex7000_BillValidator/DataContracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ internal struct Request
{
// basic message 0 1 2 3 4 5 6 7
// start, len, ack, bills,escrow,resv'd,end, checksum
internal static readonly byte[] BaseMessage = { 0x02, 0x08, 0x10, 0x7F, 0x10, 0x00, 0x03 };
internal static readonly byte[] BaseMessage = { 0x02, 0x08, 0x60, 0x7F, 0x10, 0x00, 0x03 };

internal static readonly byte[] ResetTarget = { 0x02, 0x08, 0x61, 0x7f, 0x7f, 0x7f, 0x03 };
}
Expand Down
2 changes: 1 addition & 1 deletion Apex7000_BillValidator_Test/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<CheckBox x:Name="chkEscrowMode" Content="Escrow Mode" IsChecked="{Binding IsEscrowMode,Mode=OneWay, IsAsync=True}" Checked="chkEscrowMode_Checked" Unchecked="chkEscrowMode_Unchecked"/>
</StatusBarItem>
<StatusBarItem Grid.Column="5">
<Button x:Name="btnReset" Content="Reset" Height="25" Width="100" Click="btnReset_Click" Visibility="Hidden" />
<Button x:Name="btnReset" Content="Reset" Height="25" Width="100" Click="btnReset_Click" />
</StatusBarItem>
<StatusBarItem Grid.Column="6">
<TextBlock>State:</TextBlock>
Expand Down

0 comments on commit 5514b90

Please sign in to comment.