nxtlib/src/Protocol.cs
/// <summary>
/// [Native] Open a file for writing continuously.
/// When finished writing, the handle MUST be closed with 
/// the Close() command.  If an error occurs, this handle will be closed automatically.
/// </summary>
/// <param name="filename">The name of the file to write, as a string.
///   The extension must be included.  The possible file extensions are: 
/// Firmware (.rfw), Program (.rxe), OnBrick Program (.rpg), TryMe Program (.rtm),
///  Sound (.rso), Graphic (.ric), and Text (.txt).</param>
/// <param name="filesize">The size of the file to be written.</param>
/// <returns>The handle used in the write session.  Use this handle with the Close() command.</returns>
[Native] Open a file for writing continuously.
When finished writing, the handle MUST be closed with
the Close() command.  If an error occurs, this handle will be closed automatically.
[ Native ] Open a file for writing continuously . When finished writing the handle MUST be closed with the Close () command . If an error occurs this handle will be closed automatically .
public byte OpenWriteLinear(string filename, UInt32 filesize)
        {
            ValidateFilename(filename);
            byte[] request = new byte[26];
            request[0] = 0x01;
            request[1] = (byte)MessageCommand.OpenWriteLinear;
            Encoding.ASCII.GetBytes(filename).CopyTo(request, 2);
            SetUInt32(filesize, request, 22);  
            byte[] reply = CompleteRequest(request);
            return reply[3];
        }
public byte OpenWriteLinear ( string filename , UInt32 filesize ) { ValidateFilename ( filename ) ; byte [ ] request = new byte [ 26 ] ; request [ 0 ] = 0x01 ; request [ 1 ] = ( byte ) MessageCommand . OpenWriteLinear ; Encoding . ASCII . GetBytes ( filename ) . CopyTo ( request , 2 ) ; SetUInt32 ( filesize , request , 22 ) ; byte [ ] reply = CompleteRequest ( request ) ; return reply [ 3 ] ; }
[Native] Open a file for writing continuously.
[ Native ] Open a file for writing continuously .
//correct here, since command does not allow space for the null terminator
The handle used in the write session.  Use this handle with the Close() command.
The handle used in the write session . Use this handle with the Close () command .
filename
string
The name of the file to write, as a string.
The extension must be included.  The possible file extensions are:
Firmware (.rfw), Program (.rxe), OnBrick Program (.rpg), TryMe Program (.rtm),
Sound (.rso), Graphic (.ric), and Text (.txt).
The name of the file to write as a string . The extension must be included . The possible file extensions are : Firmware ( . rfw ) Program ( . rxe ) OnBrick Program ( . rpg ) TryMe Program ( . rtm ) Sound ( . rso ) Graphic ( . ric ) and Text ( . txt ) .
filesize
UInt32
The size of the file to be written.
The size of the file to be written .