You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Initializes a new instance of the <see cref="SerialPort"/> class using the
@@ -101,6 +102,7 @@ public SerialPort(
101
102
/// <exception cref="InvalidOperationException">The specified port on the current instance of the <see cref="SerialPort"/>.
102
103
/// is already open.</exception>
103
104
/// <exception cref="ArgumentException">One (or more) of the properties set to configure this <see cref="SerialPort"/> are invalid.</exception>
105
+
/// <exception cref="OutOfMemoryException">Failed to allocate the request amount of memory for the work buffer.</exception>
104
106
publicvoidOpen()
105
107
{
106
108
if(!_opened)
@@ -484,6 +486,86 @@ public extern bool InvertSignalLevels
484
486
set;
485
487
}
486
488
489
+
/// <summary>
490
+
/// Gets or sets the size of the SerialPort input buffer.
491
+
/// </summary>
492
+
/// <value>The size of the input buffer. The default is 256.</value>
493
+
/// <exception cref="ArgumentOutOfRangeException">The <see cref="ReadBufferSize"/> value is less than or equal to zero.</exception>
494
+
/// <exception cref="InvalidOperationException">The <see cref="ReadBufferSize"/> property was set while the stream was open.</exception>
495
+
/// <remarks>
496
+
/// <para>
497
+
/// Implementation of this property for .NET nanoFramework it's slightly different from .NET.
498
+
/// </para>
499
+
/// <para>
500
+
/// - There is only one work buffer which is used for transmission and reception.
501
+
/// </para>
502
+
/// <para>
503
+
/// - When the <see cref="SerialPort"/> is <see cref="Open"/> the driver will try to allocate the requested memory for the buffer. On failure to do so, an <see cref="OutOfMemoryException"/> exception will be throw and the <see cref="Open"/> operation will fail.
504
+
/// </para>
505
+
/// </remarks>
506
+
publicintReadBufferSize
507
+
{
508
+
set
509
+
{
510
+
if(value<=0)
511
+
{
512
+
thrownewArgumentOutOfRangeException();
513
+
}
514
+
515
+
if(_opened)
516
+
{
517
+
thrownewInvalidOperationException();
518
+
}
519
+
520
+
_bufferSize=value;
521
+
}
522
+
523
+
get
524
+
{
525
+
return_bufferSize;
526
+
}
527
+
}
528
+
529
+
/// <summary>
530
+
/// Gets or sets the size of the serial port output buffer.
531
+
/// </summary>
532
+
/// <value>The size of the output buffer. The default is 256.</value>
533
+
/// <exception cref="ArgumentOutOfRangeException">The <see cref="WriteBufferSize"/> value is less than or equal to zero.</exception>
534
+
/// <exception cref="InvalidOperationException">The <see cref="WriteBufferSize"/> property was set while the stream was open.</exception>
535
+
/// <remarks>
536
+
/// <para>
537
+
/// Implementation of this property for .NET nanoFramework it's slightly different from .NET.
538
+
/// </para>
539
+
/// <para>
540
+
/// - There is only one work buffer which is used for transmission and reception.
541
+
/// </para>
542
+
/// <para>
543
+
/// - When the <see cref="SerialPort"/> is <see cref="Open"/> the driver will try to allocate the requested memory for the buffer. On failure to do so, an <see cref="OutOfMemoryException"/> exception will be throw and the <see cref="Open"/> operation will fail.
0 commit comments