Esempio n. 1
0
        // GetCurrentTime() -> nn::time::PosixTime
        public ResultCode GetCurrentTime(ServiceCtx context)
        {
            if (!_bypassUninitializedClock && !_clockCore.IsInitialized())
            {
                return(ResultCode.UninitializedClock);
            }

            ResultCode result = _clockCore.GetCurrentTime(context.Thread, out long posixTime);

            if (result == ResultCode.Success)
            {
                context.ResponseData.Write(posixTime);
            }

            return(result);
        }
Esempio n. 2
0
        // GetCurrentTime() -> nn::time::PosixTime
        public ResultCode GetCurrentTime(ServiceCtx context)
        {
            if (!_bypassUninitializedClock && !_clockCore.IsInitialized())
            {
                return(ResultCode.UninitializedClock);
            }

            ITickSource tickSource = context.Device.System.TickSource;

            ResultCode result = _clockCore.GetCurrentTime(tickSource, out long posixTime);

            if (result == ResultCode.Success)
            {
                context.ResponseData.Write(posixTime);
            }

            return(result);
        }