nxtlib/src/Protocol.cs
/// <summary>
/// [Native] Poll the length of a command in a specific buffer.
/// </summary>
/// <param name="buffer">The buffer number.  Either 0x00 (Poll) or 0x01 (High Speed).</param>
/// <returns>The number of bytes for the command ready in the buffer (0 = no command ready).</returns>
[Native] Poll the length of a command in a specific buffer.
[ Native ] Poll the length of a command in a specific buffer .
public byte PollCommandLength(byte buffer)
        {
            byte[] request = new byte[] {
            0x01,
            (byte) MessageCommand.PollCommandLength,
            buffer
            };
            byte[] reply = CompleteRequest(request);
            byte bufferNoOut = reply[3];
            if (bufferNoOut != buffer)
                throw new NXTReplyIncorrect();
            byte bytesReady = reply[4];
            return bytesReady;
        }
public byte PollCommandLength ( byte buffer ) { byte [ ] request = new byte [ ] { 0x01 , ( byte ) MessageCommand . PollCommandLength , buffer } ; byte [ ] reply = CompleteRequest ( request ) ; byte bufferNoOut = reply [ 3 ] ; if ( bufferNoOut != buffer ) throw new NXTReplyIncorrect ( ) ; byte bytesReady = reply [ 4 ] ; return bytesReady ; }
[Native] Poll the length of a command in a specific buffer.
[ Native ] Poll the length of a command in a specific buffer .
The number of bytes for the command ready in the buffer (0 = no command ready).
The number of bytes for the command ready in the buffer ( 0 = no command ready ) .
buffer
byte
The buffer number.  Either 0x00 (Poll) or 0x01 (High Speed).
The buffer number . Either 0x00 ( Poll ) or 0x01 ( High Speed ) .