/*bool HandleCommandWithRetData( * InterfaceCommand command, byte[] commandData) * { * byte[] responseData; * return this.HandleCommandWithRetData( * command, commandData, out responseData); * }*/ bool PollDevice(out ResponsePoll pollResponse) { bool ret = false; pollResponse = null; var pollCmdHandler = new PollCmdHandler( this, InterfaceCommand.Poll, null); if (pollCmdHandler.Handle(out pollResponse) == true) { ret = true; } return(ret); }
void HandlePollResponse(ResponsePoll pollResponse) { Debug.WriteLine( string.Format("Poll - {0:X} , {1:X}", pollResponse.FirstCode, pollResponse.SecondCode)); if (m_PollState != pollResponse.FirstCode) { switch (pollResponse.FirstCode) { case PollResponseCode.Bill_Stacked: HandleBillStacked(pollResponse.SecondCode); break; case PollResponseCode.Idle: break; case PollResponseCode.Drop_Cassete_Out_Of_Position: if (m_PollState != PollResponseCode.Drop_Cassete_Out_Of_Position) { Debug.WriteLine("Casste dropped"); } break; case PollResponseCode.Unit_Disabled: if (m_PollState == PollResponseCode.Dispensed) { if (OnDispenseEnd != null) { OnDispenseEnd(this, EventArgs.Empty); } } break; case PollResponseCode.Dispensing: { if (OnDispensing != null) { OnDispensing(this, EventArgs.Empty); } } break; case PollResponseCode.Jam_In_Acceptor: case PollResponseCode.Jam_In_Stacker: { if (OnJam != null) { OnJam(this, EventArgs.Empty); } break; } default: Debug.WriteLine("BV Poll Response " + pollResponse.FirstCode); break; } m_PollState = pollResponse.FirstCode; if (OnPollStatus != null) { OnPollStatus(this, new PollStatus(pollResponse.FirstCode)); } } }