Ejemplo n.º 1
0
    // convert manual Command Parameters (ability id)
    public static ManualCmdparams convertBytes2ManualCmdparams(byte[] rawparms)
    {
        ManualCmdparams parms = new ManualCmdparams();

        parms.Command = (ushort)(rawparms[0] + rawparms[1] * 256);

        return(parms);
    }
Ejemplo n.º 2
0
    // convert Manual Command Paramaters to bytes
    public static byte[] convertManualCmdparams2Bytes(ManualCmdparams parms)
    {
        byte[] rawparms = new byte[2];
        //command low byte
        rawparms[0] = (byte)(parms.Command & 0x0FF);
        // command high byte
        rawparms[1] = (byte)((parms.Command >> 8) & 0x0FF);

        return(rawparms);
    }
    // convert Manual Command Paramaters to bytes
    public static byte[] convertManualCmdparams2Bytes(ManualCmdparams parms)
    {
        byte[] rawparms = new byte[2];
            //command low byte
            rawparms[0] = (byte)(parms.Command & 0x0FF);
            // command high byte
            rawparms[1] = (byte)((parms.Command >> 8) & 0x0FF);

            return rawparms;
    }
    // convert manual Command Parameters (ability id)
    public static ManualCmdparams convertBytes2ManualCmdparams(byte[] rawparms)
    {
        ManualCmdparams parms = new ManualCmdparams();
            parms.Command = (ushort)(rawparms[0] + rawparms[1] * 256);

            return parms;
    }