@@ -287,45 +287,29 @@ impl From<OsdpStatusReportType> for libosdp_sys::osdp_status_report_type {
287287/// Event to describe various status changes on PD
288288///
289289/// This event is used by the PD to indicate status such as input, output,
290- /// tamper, etc.,. up to a maximum of 32 status bits can be reported. The values
290+ /// tamper, etc.,. up to a maximum of 64 status bits can be reported. The values
291291/// of the least significant N bit of status are considered, where N is the
292292/// number of items as described in the corresponding capability codes,
293293/// - PdCapability::OutputControl
294294/// - PdCapability::ContactStatusMonitoring
295295#[ derive( Clone , Copy , Debug , Serialize , Deserialize , PartialEq , Eq , Hash ) ]
296296#[ cfg_attr( feature = "defmt-03" , derive( defmt:: Format ) ) ]
297297pub struct OsdpStatusReport {
298- type_ : OsdpStatusReportType ,
299- nr_entries : usize ,
300- mask : u32 ,
301- }
302-
303- impl OsdpStatusReport {
304- /// Create an input event with given bit mask
305- pub fn new_input ( nr_entries : usize , mask : u32 ) -> Self {
306- Self {
307- type_ : OsdpStatusReportType :: Input ,
308- nr_entries,
309- mask,
310- }
311- }
312-
313- /// Create an output event with given bit mask
314- pub fn new_output ( nr_entries : usize , mask : u32 ) -> Self {
315- Self {
316- type_ : OsdpStatusReportType :: Output ,
317- nr_entries,
318- mask,
319- }
320- }
298+ /// The kind of event to report see `enum osdp_event_status_type_e`
299+ pub type_ : OsdpStatusReportType ,
300+ /// Number of valid entries in `report`
301+ pub nr_entries : usize ,
302+ /// Status report
303+ #[ serde( with = "serde_arrays" ) ]
304+ pub report : [ u8 ; 64 ] ,
321305}
322306
323307impl From < libosdp_sys:: osdp_status_report > for OsdpStatusReport {
324308 fn from ( value : libosdp_sys:: osdp_status_report ) -> Self {
325309 OsdpStatusReport {
326310 type_ : value. type_ . into ( ) ,
327311 nr_entries : value. nr_entries as usize ,
328- mask : value. mask ,
312+ report : value. report ,
329313 }
330314 }
331315}
@@ -335,7 +319,7 @@ impl From<OsdpStatusReport> for libosdp_sys::osdp_status_report {
335319 libosdp_sys:: osdp_status_report {
336320 type_ : value. type_ . into ( ) ,
337321 nr_entries : value. nr_entries as i32 ,
338- mask : value. mask ,
322+ report : value. report ,
339323 }
340324 }
341325}
0 commit comments