Struct npl_utils::NPLUtils

source ·
pub struct NPLUtils { /* private fields */ }
Expand description

NPL decoder class

Implementations

Return if this is the first minute that is decoded.

Return if a new minute has arrived.

Force the arrival of a new minute.

This could be useful when reading from a log file.

This method must be called before increase_second()

Return if a new second has arrived.

Get the second counter.

Get the value of the current A bit.

Get the value of the current B bit.

Set the value of the current A bit and clear the flag indicating arrival of a new minute.

This could be useful when reading from a log file.

This method must be called before increase_second().

Arguments
  • value - the value to set the current bit to

Set the value of the current B bit and clear the flag indicating arrival of a new minute.

This could be useful when reading from a log file.

This method must be called before increase_second().

Arguments
  • value - the value to set the current bit to

Get a copy of the date/time structure.

Get the minute year bit, Some(true) means OK.

Get the hour month/day bit, Some(true) means OK.

Get the weekday parity bit, Some(true) means OK.

Get the hour/minute parity bit, Some(true) means OK.

Determine the bit value if a new edge is received. indicates reception errors, and checks if a new minute has started.

This function can deal with spikes, which are arbitrarily set to SPIKE_LIMIT microseconds.

This method must be called before increase_second().

Arguments
  • is_low_edge - indicates that the edge has gone from high to low (as opposed to low-to-high).
  • t - time stamp of the received edge, in microseconds

Determine the length of this minute in bits.

Increase or reset second and clear first_minute when appropriate.

This method must be called after decode_time(), handle_new_edge(), set_current_bit_a(), set_current_bit_b(), and force_new_minute().

Decode the time broadcast during the last minute.

This method must be called before increase_second()

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.