#include <wipal/phy/phy.hh>
Some PHY headers (e.g. Prism, RadioTap, etc.) embed timing information. For instance Prism headers have mactime
and hosttime
fields, RadioTap headers have a TSF
field. Those fields must be updated during synchronization. This abstract class provides a common interface so WiPal's synchronization functions work whatever the PHY header. When implementing a custom PHY header, subclass this to export timing information to WiPal's internals.
Some PHY headers hold precise timestamps indicating when frames are recorded on the medium (e.g. mactime
for Prism headers). WiPal may use this instead of PCAP timestamps to enable a better synchronization. Such timestamps must be of type uint32_t, uint64_t, or struct timeval. When implementing a custom PHY header, define impl_type
to the type you want to use and make timestamps available to WiPal with the get()
method. (Use WiPal's virtual types mechanism to define impl_type
).
If your custom PHY header does not provide such precise timestamps, define impl_type
to whatever type you want (e.g. an empty struct). WiPal's synchronization function will then use PCAP timestamps for synchronization.
Public Types | |
Static hierarchies related types | |
typedef HIDDEN | exact_type |
typedef HIDDEN | impl_type |
Public Member Functions | |
impl_type | get () const |
exact_type & | operator+= (tool::microseconds microseconds) |
exact_type | operator+ (tool::microseconds microseconds) const |
Downcast methods | |
const exact_type & | exact () const |
exact_type & | exact () |
const exact_type * | exact_ptr () const |
exact_type * | exact_ptr () |
typedef HIDDEN phy::time< Bottom >::exact_type |
Exact type for this template instanciation.
Reimplemented from tool::static_base< Bottom >.
Reimplemented in phy::empty_time< Bottom >, phy::uint64_time< Bottom >, and prism::time.
Retrieve the timestamp to use for synchronization.
This method calls get_impl()
which must be defined in subclasses. Do not override it. Define get_impl()
in subclasses instead.
time< B >::exact_type & phy::time< B >::operator+= | ( | tool::microseconds | microseconds | ) | [inline] |
Add a microsecond count to the current time value.
This methods calls increment()
which must be defined in subclasses. Do not override it. Define increment()
in subclasses instead.
increment()
must return a reference to itself.
time< B >::exact_type phy::time< B >::operator+ | ( | tool::microseconds | microseconds | ) | const [inline] |
const static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact | ( | ) | const [inline, inherited] |
Safely downcast to the exact type as a const reference.
static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact | ( | ) | [inline, inherited] |
Safely downcast to the exact type as a non-const reference.
const static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr | ( | ) | const [inline, inherited] |
Safely downcast to the exact type as a const pointer.
static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr | ( | ) | [inline, inherited] |
Safely downcast to the exact type as a non-const pointer.