Candidate

@interface Candidate

A class for candidate measurement objects. Each candidate has a dispersion associated with it. This dispersion increases with time. If at a particular time T, the candidate’s dispersion > MAX_TOLERABLE_DISPERSION, then the candidate is no longer useful and should be filtered out.

  • T1

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t originateTime;

    Swift

    var originateTime: Int64 { get set }
  • T2

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t receiveTime;

    Swift

    var receiveTime: Int64 { get set }
  • T3

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t transmitTime;

    Swift

    var transmitTime: Int64 { get set }
  • T4

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t responseTime;

    Swift

    var responseTime: Int64 { get set }
  • Time values in nanos or ticks

    Declaration

    Objective-C

    @property (getter=isNanos, assign, readwrite, nonatomic) BOOL nanos;

    Swift

    var isNanos: Bool { get set }
  • computed candidate offset

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t offset;

    Swift

    var offset: Int64 { get set }
  • RTT

    computed candidate RTT

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t RTT;

    Swift

    var rtt: Int64 { get set }
  • WC Server Precision in ppm

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t wcServerPrecisionInNanos;

    Swift

    var wcServerPrecisionInNanos: Int64 { get set }
  • WC Server maximum frequency error

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) uint32_t wcServerMaxFreqError;

    Swift

    var wcServerMaxFreqError: UInt32 { get set }
  • From-the-wire WC Server response message

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) WCSyncMessage *responseMsg;

    Swift

    var responseMsg: WCSyncMessage! { get set }
  • quality of measurement, is it a followup?

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int8_t quality;

    Swift

    var quality: Int8 { get set }
  • Undocumented

    Declaration

    Objective-C

    @interface Candidate
  • Initialise a candidate object with a received WC Sync packet and calculate initial dispersion - parameter: response_msg a WCSyncMessage response received from the Wall Clock server - parameter: quality the quality of the response - parameter: is_nanos Boolean flag, true if time is in nano seconds.

    Declaration

    Objective-C

    - (id)initWithResponseMsg:(WCSyncMessage *)response_msg
                      Quality:(int8_t)quality
                  TimeIsNanos:(BOOL)is_nanos;

    Swift

    init!(responseMsg response_msg: WCSyncMessage!, quality: Int8, timeIsNanos is_nanos: Bool)

    Parameters

    response_msg

    a WCSyncMessage response received from the Wall Clock server

    quality

    the quality of the response

    is_nanos

    Boolean flag, true if time is in nano seconds.

  • Compute and return candidate offset

    Declaration

    Objective-C

    - (int64_t)getOffset;

    Swift

    func getOffset() -> Int64

    Return Value

    candidate offset in nanoseconds

  • Compute and return candidate round trip time

    Declaration

    Objective-C

    - (int64_t)getRTT;

    Swift

    func getRTT() -> Int64

    Return Value

    RTT in nanoseconds

  • Compute and return dispersion for candidate offset at a particular time instant - parameter: time current time in nanoseconds

    Declaration

    Objective-C

    - (int64_t)getDispersionAtTime:(int64_t)time;

    Swift

    func getDispersionAtTime(_ time: Int64) -> Int64

    Parameters

    time

    current time in nanoseconds

  • Returns the time in nanoseconds after which candidate measurement will be greater than the maximum tolerable dispersion - parameter: accuracy_target_nanos Maximum tolerable dispersion to achieve wall clock synchronisation of desired accuracy

    Declaration

    Objective-C

    - (int64_t)getCandidateExpirationTime:(int64_t)accuracy_target_nanos;

    Swift

    func getExpirationTime(_ accuracy_target_nanos: Int64) -> Int64

    Parameters

    accuracy_target_nanos

    Maximum tolerable dispersion to achieve wall clock synchronisation of desired accuracy