Esempio n. 1
0
        /// <summary>Copies up to 'max_blocks' number of Blocks to the address pointed to by 'blocks'.</summary>
        /// <param name="MaxBlocks">Maximum number of Blocks to copy.</param>
        /// <returns></returns>
        public Block[] GetBlocks(int MaxBlocks)
        {
            Block[] tmpBlk  = new Block[MaxBlocks];
            int     results = pixy_get_blocks(Convert.ToUInt16(MaxBlocks), ref tmpBlk[0]);

            if (results >= 0)
            {
                Block[] tmpBlkReturn = new Block[results];
                if (results > 0)
                {
                    Array.Copy(tmpBlk, tmpBlkReturn, results);
                }
                return(tmpBlkReturn);
            }
            else
            {
                PixyError errResults = (PixyError)results;
                System.Diagnostics.Debug.WriteLine("Error reading blocks: " + errResults.ToString());
            }
            return(null);
        }
Esempio n. 2
0
 /// <summary>Send description of pixy error to stdout.</summary>
 /// <param name="error">Pixy error code</param>
 public void PrintError(PixyError error)
 {
     pixy_error((int)error);
 }
 /// <summary>Send description of pixy error to stdout.</summary>
 /// <param name="error">Pixy error code</param>
 public void PrintError(PixyError error)
 {
     pixy_error((int)error);
 }