Unity: Fix hardcoded page size in ReceiveSerialData()
Remove the hardocded '128' that checked for a full page being received and replace it with the appropriate constant.
This commit is contained in:
parent
c939764989
commit
5736394e08
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ public class Arduino_Com : MonoBehaviour
|
|||
_readBytes += _serial.Read(_pageBuffer, _readBytes, PageSize - _readBytes);
|
||||
|
||||
// Full page received, check checksum and ACK/NAK, write received page.
|
||||
if (_readBytes >= 128)
|
||||
if (_readBytes >= PageSize)
|
||||
{
|
||||
Byte[] checksum = new byte[2];
|
||||
// There might be less than the two characters of the checksum available, loop until complete.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue