@@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
13
13
use super :: ConvertEndian ;
14
14
15
15
/// LED Colors as specified in OSDP for the on_color/off_color parameters.
16
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
16
+ #[ derive( Clone , Copy , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
17
17
pub enum OsdpLedColor {
18
18
/// No Color
19
19
#[ default]
@@ -68,7 +68,7 @@ impl From<OsdpLedColor> for u8 {
68
68
}
69
69
70
70
/// LED params sub-structure. Part of LED command: OsdpCommandLed
71
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
71
+ #[ derive( Clone , Copy , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
72
72
pub struct OsdpLedParams {
73
73
/// Control code serves different purposes based on which member of
74
74
/// [`OsdpCommandLed`] it is used with. They are,
@@ -128,7 +128,7 @@ impl From<OsdpLedParams> for libosdp_sys::osdp_cmd_led_params {
128
128
}
129
129
130
130
/// Command to control the behavior of it's on-board LEDs
131
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
131
+ #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
132
132
pub struct OsdpCommandLed {
133
133
/// Reader (another device connected to this PD) for which this command is
134
134
/// issued for.
@@ -174,7 +174,7 @@ impl From<OsdpCommandLed> for libosdp_sys::osdp_cmd_led {
174
174
}
175
175
176
176
/// Command to control the behavior of a buzzer in the PD
177
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
177
+ #[ derive( Clone , Copy , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
178
178
pub struct OsdpCommandBuzzer {
179
179
/// Reader (another device connected to this PD) for which this command is
180
180
/// issued for.
@@ -230,7 +230,7 @@ impl From<OsdpCommandBuzzer> for libosdp_sys::osdp_cmd_buzzer {
230
230
231
231
/// Command to manipulate the on-board display unit (Can be LED, LCD, 7-Segment,
232
232
/// etc.,) on the PD.
233
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
233
+ #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
234
234
pub struct OsdpCommandText {
235
235
/// Reader (another device connected to this PD) for which this command is
236
236
/// issued for.
@@ -294,7 +294,7 @@ impl From<OsdpCommandText> for libosdp_sys::osdp_cmd_text {
294
294
}
295
295
296
296
/// Command to control digital output exposed by the PD.
297
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
297
+ #[ derive( Clone , Copy , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
298
298
pub struct OsdpCommandOutput {
299
299
/// The output number this to apply this action.
300
300
///
@@ -341,7 +341,7 @@ impl From<OsdpCommandOutput> for libosdp_sys::osdp_cmd_output {
341
341
/// Command to set the communication parameters for the PD. The effects of this
342
342
/// command is expected to be be stored in PD's non-volatile memory as the CP
343
343
/// will expect the PD to be in this state moving forward.
344
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
344
+ #[ derive( Clone , Copy , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
345
345
pub struct OsdpComSet {
346
346
address : u8 ,
347
347
baud_rate : u32 ,
@@ -379,7 +379,7 @@ impl From<OsdpComSet> for libosdp_sys::osdp_cmd_comset {
379
379
}
380
380
381
381
/// Command to set secure channel keys to the PD.
382
- #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , Eq ) ]
382
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
383
383
pub struct OsdpCommandKeyset {
384
384
key_type : u8 ,
385
385
/// Key data
@@ -422,7 +422,7 @@ impl From<OsdpCommandKeyset> for libosdp_sys::osdp_cmd_keyset {
422
422
}
423
423
424
424
/// Command to to act as a wrapper for manufacturer specific commands
425
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
425
+ #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
426
426
pub struct OsdpCommandMfg {
427
427
/// 3-byte IEEE assigned OUI used as vendor code
428
428
pub vendor_code : ( u8 , u8 , u8 ) ,
@@ -462,7 +462,7 @@ impl From<OsdpCommandMfg> for libosdp_sys::osdp_cmd_mfg {
462
462
}
463
463
464
464
/// Command to kick-off a file transfer to the PD.
465
- #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq , Eq ) ]
465
+ #[ derive( Clone , Copy , Debug , Default , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
466
466
pub struct OsdpCommandFileTx {
467
467
id : i32 ,
468
468
flags : u32 ,
@@ -501,7 +501,7 @@ impl From<OsdpCommandFileTx> for libosdp_sys::osdp_cmd_file_tx {
501
501
502
502
/// CP interacts with and controls PDs by sending commands to it. The commands
503
503
/// in this enum are specified by OSDP specification.
504
- #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , Eq ) ]
504
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
505
505
pub enum OsdpCommand {
506
506
/// Command to control the behavior of it’s on-board LEDs
507
507
Led ( OsdpCommandLed ) ,
@@ -546,7 +546,7 @@ impl From<OsdpCommand> for libosdp_sys::osdp_cmd {
546
546
OsdpCommand :: Buzzer ( c) => libosdp_sys:: osdp_cmd {
547
547
id : libosdp_sys:: osdp_cmd_e_OSDP_CMD_BUZZER,
548
548
__bindgen_anon_1 : libosdp_sys:: osdp_cmd__bindgen_ty_1 {
549
- buzzer : c. clone ( ) . into ( ) ,
549
+ buzzer : c. into ( ) ,
550
550
} ,
551
551
} ,
552
552
OsdpCommand :: Text ( c) => libosdp_sys:: osdp_cmd {
@@ -558,13 +558,13 @@ impl From<OsdpCommand> for libosdp_sys::osdp_cmd {
558
558
OsdpCommand :: Output ( c) => libosdp_sys:: osdp_cmd {
559
559
id : libosdp_sys:: osdp_cmd_e_OSDP_CMD_OUTPUT,
560
560
__bindgen_anon_1 : libosdp_sys:: osdp_cmd__bindgen_ty_1 {
561
- output : c. clone ( ) . into ( ) ,
561
+ output : c. into ( ) ,
562
562
} ,
563
563
} ,
564
564
OsdpCommand :: ComSet ( c) => libosdp_sys:: osdp_cmd {
565
565
id : libosdp_sys:: osdp_cmd_e_OSDP_CMD_COMSET,
566
566
__bindgen_anon_1 : libosdp_sys:: osdp_cmd__bindgen_ty_1 {
567
- comset : c. clone ( ) . into ( ) ,
567
+ comset : c. into ( ) ,
568
568
} ,
569
569
} ,
570
570
OsdpCommand :: KeySet ( c) => libosdp_sys:: osdp_cmd {
@@ -582,13 +582,13 @@ impl From<OsdpCommand> for libosdp_sys::osdp_cmd {
582
582
OsdpCommand :: FileTx ( c) => libosdp_sys:: osdp_cmd {
583
583
id : libosdp_sys:: osdp_cmd_e_OSDP_CMD_FILE_TX,
584
584
__bindgen_anon_1 : libosdp_sys:: osdp_cmd__bindgen_ty_1 {
585
- file_tx : c. clone ( ) . into ( ) ,
585
+ file_tx : c. into ( ) ,
586
586
} ,
587
587
} ,
588
588
OsdpCommand :: Status ( c) => libosdp_sys:: osdp_cmd {
589
589
id : libosdp_sys:: osdp_cmd_e_OSDP_CMD_STATUS,
590
590
__bindgen_anon_1 : libosdp_sys:: osdp_cmd__bindgen_ty_1 {
591
- status : c. clone ( ) . into ( ) ,
591
+ status : c. into ( ) ,
592
592
} ,
593
593
} ,
594
594
}
0 commit comments