Exemplo n.º 1
0
        protected bool Send(Byte[] tosend)
        {
            uint   sent       = 0;
            ushort writeCount = (ushort)tosend.GetLength(0);

            CheckOnline();
            if ((RSWrapper.WriteFile(hPort, tosend, writeCount, out sent, ptrUWO)) && (writeCount == sent))
            {
                incBytesTransferred(writeCount);
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Queues bytes for transmission.
        /// </summary>
        /// <param name="tosend">Array of bytes to be sent</param>
        /// <param name="dataLength">the length of data</param>
        protected bool Send(IntPtr tosend, ushort dataLength)
        {
            uint sent = 0;

            if (!CheckOnline())
            {
                return(false);
            }
            if ((RSWrapper.WriteFile(hPort, tosend, dataLength, out sent, ptrUWO)) && (dataLength == sent))
            {
                incBytesTransferred(dataLength);
                return(true);
            }
            else
            {
                return(false);
            }
        }