コード例 #1
0
        // GetNpadId(bytes<8, 4>) -> u32
        public ResultCode GetNpadId(ServiceCtx context)
        {
            uint deviceHandle = context.RequestData.ReadUInt32();

            for (int i = 0; i < context.Device.System.NfpDevices.Count; i++)
            {
                if ((uint)context.Device.System.NfpDevices[i].Handle == deviceHandle)
                {
                    context.ResponseData.Write((uint)HidUtils.GetNpadIdTypeFromIndex(context.Device.System.NfpDevices[i].Handle));

                    return(ResultCode.Success);
                }
            }

            return(ResultCode.DeviceNotFound);
        }
コード例 #2
0
        // GetNpadId(bytes<8, 4>) -> u32
        public long GetNpadId(ServiceCtx context)
        {
            uint deviceHandle = context.RequestData.ReadUInt32();

            for (int i = 0; i < _devices.Count; i++)
            {
                if ((uint)_devices[i].Handle == deviceHandle)
                {
                    context.ResponseData.Write((uint)HidUtils.GetNpadIdTypeFromIndex(_devices[i].Handle));

                    return(0);
                }
            }

            return(ErrorCode.MakeError(ErrorModule.Nfp, NfpError.DeviceNotFound));
        }