/// <summary>
 ///
 /// </summary>
 /// <param name="exerciceData"></param>
 /// <returns></returns>
 public static byte[] ConstructWriteExerciceDataFrame(FrameExerciceDataModel exerciceData)
 {
     byte[] decodedFrame = new byte[12] {
         (byte)FrameStart.Sart1, (byte)FrameStart.Start2, (byte)exerciceData.Address, 0x04, exerciceData.Data1, exerciceData.Data2, exerciceData.Data3, exerciceData.Data4, 0x00, 0x00, (byte)FrameStop.Stop1, (byte)FrameStop.Stop2
     };
     // TODO : ajouter dans la trame l'id et les datas
     decodedFrame = InsertChecksum(decodedFrame);
     return(FrameEncoding.EncodeFrame(decodedFrame));
 }
        public FrameExerciceDataModel MakeFrame()
        {
            FrameExerciceDataModel frame;
            byte erMSB, erLSB;

            erMSB = (byte)(this.error >> (ushort)8);
            erLSB = (byte)this.error;
            frame = new FrameExerciceDataModel(ConfigAddresses.StreamingError, erMSB, erLSB, 0, 0);

            return(frame);
        }
        public FrameExerciceDataModel MakeFrame()
        {
            FrameExerciceDataModel frame;
            byte   xMSB, xLSByMSB, yLSB;
            ushort temp = (ushort)((short)this.x >> 4);

            xMSB     = (byte)temp;
            xLSByMSB = (byte)((this.x) << 4 | this.y >> 8);
            yLSB     = (byte)this.y;
            frame    = new FrameExerciceDataModel(ConfigAddresses.modMazeGame, xMSB, xLSByMSB, yLSB, (byte)this.uniBi);

            return(frame);
        }
Beispiel #4
0
        public FrameExerciceDataModel MakeFrame()
        {
            FrameExerciceDataModel frame;
            byte   xMSB, xLSByMSB, yLSB;
            ushort temp = (ushort)((short)this.x >> 4);

            xMSB     = (byte)temp;
            xLSByMSB = (byte)((this.x) << 4 | this.y >> 8);
            yLSB     = (byte)this.y;
            frame    = new FrameExerciceDataModel(ConfigAddresses.StreamingPoint, xMSB, xLSByMSB, yLSB, this.nbrsPoint);

            return(frame);
        }
        public FrameExerciceDataModel MakeFrame()
        {
            FrameExerciceDataModel frame = new FrameExerciceDataModel(ConfigAddresses.StreamingInit, this.nbrsSeg, 0, 0, 0);

            return(frame);
        }