WCSyncMessage
@interface WCSyncMessage : NSObject
A class that provides helper functions to build and parse Wall Clock protocol request/response messages
-
Undocumented
Declaration
Objective-C
@interface WCSyncMessage : NSObject
-
Undocumented
Declaration
Objective-C
@interface WCSyncMessage : NSObject
-
Undocumented
Declaration
Objective-C
@interface WCSyncMessage : NSObject
-
initialise with a buffer
Declaration
Objective-C
- (id)initWithBuffer:(uint8_t *)buffer;
Swift
init!(buffer: UnsafeMutablePointer
Parameters
buffer
a buffer
Return Value
initialised instance
-
- Initialise with a packet and a response time (in nanos). Packet is deep-copied since only one buffer is used for receiving UDP packets. *
- - parameter: packet a WCSyncMessagePkt struct
- - parameter: response_time response time *
- - returns: initialised instance
Declaration
Objective-C
- (id)initWithPacket:(WCSyncMessagePkt *)packet AndResponseTimeNanos:(int64_t)response_time;
Swift
init!(packet: UnsafeMutablePointer
Parameters
packet
a WCSyncMessagePkt struct
response_time
response time
Return Value
initialised instance
-
set version of CSS-WC protocol
Declaration
Objective-C
- (id)setVersion:(uint8_t)version;
Swift
func setVersion(_ version: UInt8) -> Any!
Parameters
version
- protocol version
Return Value
WCSyncMessage instance with field set
-
Set message type: see DVB CSS specs
Declaration
Objective-C
- (id)setMessageType:(uint8_t)msg_type;
Swift
func setMessageType(_ msg_type: UInt8) -> Any!
Parameters
msg_type
- a message type e.g. WCMSG_REQ, WCMSG_RESP, WCMSG_RESP_WITH_FOLLOWUP, WCMSG_FOLLOWUP
Return Value
WCSyncMessage instance with field set
-
Set precision; value of this field only set for message type 1, 2 and 3. Value set as 2’s complement integer
Declaration
Objective-C
- (id)setPrecision:(uint8_t)precision;
Swift
func setPrecision(_ precision: UInt8) -> Any!
Parameters
precision
- clock precision set as 2’s complement integer
Return Value
WCSyncMessage instance with field set
-
Set reserved field in WCSyncMessage
Declaration
Objective-C
- (id)setReserved:(uint8_t)reserved;
Swift
func setReserved(_ reserved: UInt8) -> Any!
Parameters
reserved
- value for reserved field
Return Value
WCSyncMessage instance with field set
-
set max frequency error of Wall Clock
Declaration
Objective-C
- (id)setMaxFreqError:(uint32_t)max_freq_error;
Swift
func setMaxFreqError(_ max_freq_error: UInt32) -> Any!
Parameters
max_freq_error
- maximum frequency error of WallClock
Return Value
WCSyncMessage instance with field set
-
Set originate_timevalue field with given time value when a message type 0 is sent
Declaration
Objective-C
- (id)setOriginateTimeValueSeconds:(uint32_t)timevalue_secs AndNanoSecs:(uint32_t)timevalue_nanos;
Swift
func setOriginateTimeValueSeconds(_ timevalue_secs: UInt32, andNanoSecs timevalue_nanos: UInt32) -> Any!
Parameters
timevalue_secs
- time value in seconds
timevalue_nanos
- remaining time value in nanoseconds
Return Value
WCSyncMessage instance with field set
-
Set originate_timevalue field with given time value when a message type 0 is sent
Declaration
Objective-C
- (id)setOriginateTimeValue:(int64_t)clockNanos;
Swift
func setOriginateTimeValue(_ clockNanos: Int64) -> Any!
Parameters
clockNanos
- time value in nanoseconds
Return Value
WCSyncMessage instance with field set
-
set receive_timevalue field with given time value when a message_type 0 is received
Declaration
Objective-C
- (id)setReceiveTimeValueSeconds:(uint32_t)timevalue_secs AndNanoSecs:(uint32_t)timevalue_nanos;
Swift
func setReceiveTimeValueSeconds(_ timevalue_secs: UInt32, andNanoSecs timevalue_nanos: UInt32) -> Any!
Parameters
timevalue_secs
- time value in seconds
timevalue_nanos
- remaining time value in nanoseconds
Return Value
WCSyncMessage instance with field set
-
set transmit_timevalue field with given time value when message_type 1 is transmitted. Time value can be obtained from wallclock.
Declaration
Objective-C
- (id)setTransmitTimeValueSeconds:(uint32_t)timevalue_secs AndNanoSecs:(uint32_t)timevalue_nanos;
Swift
func setTransmitTimeValueSeconds(_ timevalue_secs: UInt32, andNanoSecs timevalue_nanos: UInt32) -> Any!
Parameters
timevalue_secs
- time value in seconds
timevalue_nanos
- remaining time value in nanoseconds
Return Value
WCSyncMessage instance with field set
-
Set originate_timevaluefield with current host time (system clock) when a message type 0 is sent
Declaration
Objective-C
- (id)setOriginateTimeValueCurrentTime;
Swift
func setOriginateTimeValueCurrentTime() -> Any!
Return Value
WCSyncMessage instance with field set
-
Set originate_timevalue field with time value of supplied clock when a message type 0 is sent
Declaration
Objective-C
- (id)setOriginateTimeValueCurrentTime:(id)clock;
Swift
func setOriginateTimeValueCurrentTime(_ clock: Any!) -> Any!
Parameters
clock
- a Clock instance (a subclassing ClockBase)
Return Value
WCSyncMessage instance with field set
-
set receive_timevalue field with current host time (system clock) when message_type 0 is received
Declaration
Objective-C
- (id)setReceiveTimeValueCurrentTime;
Swift
func setReceiveTimeValueCurrentTime() -> Any!
Return Value
WCSyncMessage instance with field set
-
set receive_timevalue field with supplied clock’s time when message_type 0 is received
Declaration
Objective-C
- (id)setReceiveTimeValueCurrentTime:(id)clock;
Swift
func setReceiveTimeValueCurrentTime(_ clock: Any!) -> Any!
Parameters
clock
a clock object (subclassing ClockBase)
Return Value
WCSyncMessage instance with field set
-
set transmitTime field with current host time (system clock) when message_type 1 is transmitted.
Declaration
Objective-C
- (id)setTransmitTimeValueCurrentTime;
Swift
func setTransmitTimeValueCurrentTime() -> Any!
Return Value
WCSyncMessage instance with field set
-
set transmitTime field with time value of supplied clock when message_type 1 is transmitted.
Declaration
Objective-C
- (id)setTransmitTimeValueCurrentTime:(id)clock;
Swift
func setTransmitTimeValueCurrentTime(_ clock: Any!) -> Any!
Parameters
clock
a clock object that subclasses ClockBase
Return Value
WCSyncMessage instance with field set
-
Undocumented
Declaration
Objective-C
@interface WCSyncMessage : NSObject
-
get version field value
Declaration
Objective-C
- (uint8_t)getVersion;
Swift
func getVersion() -> UInt8
Return Value
version of CSS-WC protocol
-
message-type field value getter
Declaration
Objective-C
- (uint8_t)getMessageType;
Swift
func getType() -> UInt8
Return Value
message-type field value
-
precision field value getter
Declaration
Objective-C
- (uint8_t)getPrecision;
Swift
func getPrecision() -> UInt8
Return Value
precision as a 2’s complement integer
-
reserved field value getter
Declaration
Objective-C
- (uint8_t)getReserved;
Swift
func getReserved() -> UInt8
Return Value
reserved field value
-
MaxFreqError field value getter
Declaration
Objective-C
- (uint32_t)getMaxFreqError;
Swift
func getMaxFreqError() -> UInt32
Return Value
MaxFreqError field value
-
originate_timevalue field value getter
Declaration
Objective-C
- (WCTimeValue)getOriginateTimeValueSeconds;
Swift
func getOriginateTimeValueSeconds() -> WCTimeValue
Return Value
originate_timevalue field value
-
originate_timevalue field value getter
Declaration
Objective-C
- (int64_t)getOriginateTimeNanos;
Swift
func getOriginateTimeNanos() -> Int64
Return Value
originate_timevalue field value in nanoseconds
-
receive_timevalue field value getter
Declaration
Objective-C
- (WCTimeValue)getReceiveTimeValueSeconds;
Swift
func getReceiveTimeValueSeconds() -> WCTimeValue
Return Value
receive_timevalue field value
-
transmit_timevalue field value getter
Declaration
Objective-C
- (WCTimeValue)getTransmitTimeValueSeconds;
Swift
func getTransmitTimeValueSeconds() -> WCTimeValue
Return Value
transmit_timevalue field value