예제 #1
0
        public int SendDataReportMode(InputDataType mode)
        {
            if (mode == InputDataType.STATUS_INFO || mode == InputDataType.READ_MEMORY_REGISTERS)
            {
                Debug.LogError("Passed " + mode.ToString() + " to SendDataReportMode!");
                return(-2);
            }

            return(SendWithType(OutputDataType.DATA_REPORT_MODE, new byte[] { 0x00, (byte)mode }));
        }
예제 #2
0
        /// \brief Sets the Data Reporting mode of the Wii Remote.
        /// \param mode The data reporting mode desired.  This can be any InputDataType except for
        ///         InputDataType::STATUS_INFO, InputDataType::READ_MEMORY_REGISTERS, or InputDataType::ACKNOWLEDGE_OUTPUT_REPORT.
        ///         Said data types are not data reporting modes so it doesn't make sense to use them here.
        /// \return On success, the total size of the data written (> 0), <= 0 on failure.
        /// \sa SendWithType(OutputDataType, byte[])
        public int SendDataReportMode(InputDataType mode)
        {
            if (mode == InputDataType.STATUS_INFO || mode == InputDataType.READ_MEMORY_REGISTERS || mode == InputDataType.ACKNOWLEDGE_OUTPUT_REPORT)
            {
                Debug.LogError("Passed " + mode.ToString() + " to SendDataReportMode!");
                return(-2);
            }

            last_report_type = mode;

            ExpectingSecondInterleavedPacket = false;

            return(SendWithType(OutputDataType.DATA_REPORT_MODE, new byte[] { 0x00, (byte)mode }));
        }
예제 #3
0
    /// \brief Sets the Data Reporting mode of the Wii Remote.
    /// \param mode The data reporting mode desired.  This can be any InputDataType except for
    ///         InputDataType::STATUS_INFO, InputDataType::READ_MEMORY_REGISTERS, or InputDataType::ACKNOWLEDGE_OUTPUT_REPORT.
    ///         Said data types are not data reporting modes so it doesn't make sense to use them here.
    /// \return On success, the total size of the data written (> 0), <= 0 on failure.
    /// \sa SendWithType(OutputDataType, byte[])
    public int SendDataReportMode(InputDataType mode)
    {
        if (mode == InputDataType.STATUS_INFO || mode == InputDataType.READ_MEMORY_REGISTERS || mode == InputDataType.ACKNOWLEDGE_OUTPUT_REPORT)
        {
            Debug.LogError("Passed " + mode.ToString() + " to SendDataReportMode!");
            return -2;
        }

        last_report_type = mode;

        ExpectingSecondInterleavedPacket = false;

        return SendWithType(OutputDataType.DATA_REPORT_MODE, new byte[] { 0x00, (byte)mode });
    }