@@ -63,11 +63,10 @@ public bool Transaction(byte[] dataToSend, int sendSize, byte[] dataRecieved, in
63
63
Array . Copy ( dataToSend , sendBuffer , Math . Min ( sendSize , dataToSend . Length ) ) ;
64
64
}
65
65
byte [ ] receiveBuffer = new byte [ receiveSize ] ;
66
- bool aborted = true ;
67
- aborted = HAL_TransactionI2C ( ( byte ) m_port , ( byte ) m_deviceAddress , sendBuffer , ( byte ) sendSize , receiveBuffer , ( byte ) receiveSize ) != 0 ;
66
+ int status = HAL_TransactionI2C ( ( byte ) m_port , ( byte ) m_deviceAddress , sendBuffer , ( byte ) sendSize , receiveBuffer , ( byte ) receiveSize ) ;
68
67
if ( receiveSize > 0 && dataRecieved != null )
69
68
Array . Copy ( receiveBuffer , dataRecieved , Math . Min ( receiveSize , dataRecieved . Length ) ) ;
70
- return aborted ;
69
+ return status < 0 ;
71
70
}
72
71
}
73
72
@@ -158,19 +157,6 @@ public bool ReadOnly(byte[] buffer, int count)
158
157
return retVal < 0 ;
159
158
}
160
159
161
- /// <summary>
162
- /// Sends a broadcast write to all devices on the I2C bus.
163
- /// </summary>
164
- /// <remarks>This is currently not implemented.</remarks>
165
- /// <param name="registerAddress">The register to write on all devices on the bus.</param>
166
- /// <param name="data">The value to write to the devices.</param>
167
- /// /// <returns>True if transfer was aborted, otherwise false.</returns>
168
- public bool Broadcast ( int registerAddress , int data )
169
- {
170
- //NOTE: Is also not implemented in the Java implementation of WPILib
171
- throw new NotImplementedException ( ) ;
172
- }
173
-
174
160
/// <summary>
175
161
/// Verify that a device's registers contain expected values.
176
162
/// </summary>
0 commit comments