-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable_payout: add the
DisablePayout
messages
Adds the `DisablePayoutCommand` and `DisablePayoutResponse` messages, as well as the `MessageVariant::DisablePayoutResponse` variant.
- Loading branch information
Showing
9 changed files
with
102 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//! Message types for disabling a payout device. | ||
|
||
mod command; | ||
mod response; | ||
|
||
pub use command::*; | ||
pub use response::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use crate::{len::DISABLE_PAYOUT_COMMAND, CommandOps, MessageOps, MessageType}; | ||
|
||
/// DisablePayout - Command (0x5B) | ||
/// | ||
/// All accepted notes will be routed to the stacker and payout commands will not be accepted. | ||
#[repr(C)] | ||
#[derive(Clone, Copy, Debug, Default, PartialEq)] | ||
pub struct DisablePayoutCommand { | ||
buf: [u8; DISABLE_PAYOUT_COMMAND], | ||
} | ||
|
||
impl DisablePayoutCommand { | ||
/// Creates a new [DisablePayoutCommand] message. | ||
pub fn new() -> Self { | ||
let mut msg = Self { | ||
buf: [0u8; DISABLE_PAYOUT_COMMAND], | ||
}; | ||
|
||
msg.init(); | ||
msg.set_command(MessageType::DisablePayout); | ||
|
||
msg | ||
} | ||
} | ||
|
||
impl_command_display!(DisablePayoutCommand); | ||
impl_message_from_buf!(DisablePayoutCommand); | ||
impl_message_ops!(DisablePayoutCommand); | ||
impl_command_ops!(DisablePayoutCommand); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use crate::{len::DISABLE_PAYOUT_RESPONSE, message::MessageOps, MessageType}; | ||
|
||
/// DisablePayout - Response (0x09) | ||
/// | ||
/// Represents a response to an [DisablePayoutCommand](crate::DisablePayoutCommand) message. | ||
#[repr(C)] | ||
#[derive(Clone, Copy, Debug, Default, PartialEq)] | ||
pub struct DisablePayoutResponse { | ||
buf: [u8; DISABLE_PAYOUT_RESPONSE], | ||
} | ||
|
||
impl DisablePayoutResponse { | ||
/// Creates a new [DisablePayoutResponse] message. | ||
pub fn new() -> Self { | ||
let mut msg = Self { | ||
buf: [0u8; DISABLE_PAYOUT_RESPONSE], | ||
}; | ||
|
||
msg.init(); | ||
|
||
msg | ||
} | ||
} | ||
|
||
impl_message_from_buf!(DisablePayoutResponse); | ||
impl_message_ops!(DisablePayoutResponse, MessageType::DisablePayout); | ||
impl_response_ops!(DisablePayoutResponse); | ||
impl_response_display!(DisablePayoutResponse); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters