11/*
2- * Copyright 2019, Digi International Inc.
2+ * Copyright 2019, 2020, Digi International Inc.
33 * Copyright 2014, 2015, Sébastien Rault.
44 *
55 * Permission to use, copy, modify, and/or distribute this software for any
@@ -2076,6 +2076,7 @@ protected void ForceDisassociate()
20762076 /// <param name="destinationInterface">Destination XBee local interface.</param>
20772077 /// <param name="data">Data to send.</param>
20782078 /// <exception cref="ArgumentException">If the destination interface is unknown.</exception>
2079+ /// <exception cref="ArgumentException">If data length is greater than 255 bytes.</exception>
20792080 /// <exception cref="XBeeException">If there is any XBee related error sending the User
20802081 /// Data Relay.</exception>
20812082 /// <seealso cref="XBeeLocalInterface"/>
@@ -2086,6 +2087,8 @@ protected void SendUserDataRelay(XBeeLocalInterface destinationInterface, byte[]
20862087 {
20872088 if ( destinationInterface == XBeeLocalInterface . UNKNOWN )
20882089 throw new ArgumentException ( "Destination interface cannot be unknown." ) ;
2090+ if ( data . Length > 255 )
2091+ throw new ArgumentException ( "Data length cannot be greater than 255 bytes." ) ;
20892092
20902093 // Check if device is remote.
20912094 if ( IsRemote )
@@ -2103,6 +2106,7 @@ protected void SendUserDataRelay(XBeeLocalInterface destinationInterface, byte[]
21032106 /// Sends the given data to the XBee Bluetooth interface in a User Data Relay frame.
21042107 /// </summary>
21052108 /// <param name="data">Data to send.</param>
2109+ /// <exception cref="ArgumentException">If data length is greater than 255 bytes.</exception>
21062110 /// <exception cref="XBeeException">If there is any XBee related error sending the Bluetooth
21072111 /// data.</exception>
21082112 /// <seealso cref="SendMicroPythonData(byte[])"/>
@@ -2117,6 +2121,7 @@ protected void SendBluetoothData(byte[] data)
21172121 /// Sends the given data to the XBee MicroPython interface in a User Data Relay frame.
21182122 /// </summary>
21192123 /// <param name="data">Data to send.</param>
2124+ /// <exception cref="ArgumentException">If data length is greater than 255 bytes.</exception>
21202125 /// <exception cref="XBeeException">If there is any XBee related error sending the
21212126 /// MicroPython data.</exception>
21222127 /// <seealso cref="SendBluetoothData(byte[])"/>
@@ -2131,6 +2136,7 @@ protected void SendMicroPythonData(byte[] data)
21312136 /// Sends the given data to the XBee serial interface in a User Data Relay frame.
21322137 /// </summary>
21332138 /// <param name="data">Data to send.</param>
2139+ /// <exception cref="ArgumentException">If data length is greater than 255 bytes.</exception>
21342140 /// <exception cref="XBeeException">If there is any XBee related error sending the serial
21352141 /// data.</exception>
21362142 /// <seealso cref="SendBluetoothData(byte[])"/>
0 commit comments