summaryrefslogtreecommitdiffstats
path: root/heimdall/source/EndFileTransferPacket.h
diff options
context:
space:
mode:
authorBenjamin Dobell <benjamin.dobell+github@glassechidna.com.au>2012-03-28 16:34:31 +0200
committerBenjamin Dobell <benjamin.dobell+github@glassechidna.com.au>2012-03-29 01:17:05 +0200
commit713af23d0a8a65926e03ad2e50406aae2463e6e1 (patch)
treede05850788b7a16ffe881e856e51310b262d0cbf /heimdall/source/EndFileTransferPacket.h
parentMade the last parameter of EndFileTransferPacket partitionType (obtained (diff)
downloadHeimdall-713af23d0a8a65926e03ad2e50406aae2463e6e1.tar
Heimdall-713af23d0a8a65926e03ad2e50406aae2463e6e1.tar.gz
Heimdall-713af23d0a8a65926e03ad2e50406aae2463e6e1.tar.bz2
Heimdall-713af23d0a8a65926e03ad2e50406aae2463e6e1.tar.lz
Heimdall-713af23d0a8a65926e03ad2e50406aae2463e6e1.tar.xz
Heimdall-713af23d0a8a65926e03ad2e50406aae2463e6e1.tar.zst
Heimdall-713af23d0a8a65926e03ad2e50406aae2463e6e1.zip
Diffstat (limited to '')
-rw-r--r--heimdall/source/EndFileTransferPacket.h40
1 files changed, 9 insertions, 31 deletions
diff --git a/heimdall/source/EndFileTransferPacket.h b/heimdall/source/EndFileTransferPacket.h
index 73353d5..32eee60 100644
--- a/heimdall/source/EndFileTransferPacket.h
+++ b/heimdall/source/EndFileTransferPacket.h
@@ -46,30 +46,17 @@ namespace Heimdall
private:
unsigned int destination; // Chip identifier perhaps
- unsigned short partialPacketLength; // Length or (length - 65536) if lastFullPacket is odd.
- unsigned int lastFullPacketIndex;
- unsigned short unknown1;
+ unsigned int sequenceByteCount;
+ unsigned int unknown1;
unsigned int partitionType;
protected:
- EndFileTransferPacket(unsigned int destination, unsigned int partialPacketLength, unsigned int lastFullPacketIndex,
- unsigned short unknown1, unsigned int partitionType)
+ EndFileTransferPacket(unsigned int destination, unsigned int sequenceByteCount, unsigned int unknown1, unsigned int partitionType)
: FileTransferPacket(FileTransferPacket::kRequestEnd)
{
this->destination = destination;
-
- if (partialPacketLength > 65535)
- {
- this->partialPacketLength = (partialPacketLength - 65536);
- this->lastFullPacketIndex = lastFullPacketIndex + 1;
- }
- else
- {
- this->partialPacketLength = partialPacketLength;
- this->lastFullPacketIndex = lastFullPacketIndex;
- }
-
+ this->sequenceByteCount = sequenceByteCount;
this->unknown1 = unknown1;
this->partitionType = partitionType;
}
@@ -81,20 +68,12 @@ namespace Heimdall
return (destination);
}
- unsigned int GetPartialPacketLength(void) const
- {
- if (lastFullPacketIndex % 2 == 0)
- return (partialPacketLength);
- else
- return (partialPacketLength + 65536);
- }
-
- unsigned int GetLastFullPacketIndex(void) const
+ unsigned int GetSequenceByteCount(void) const
{
- return (lastFullPacketIndex - lastFullPacketIndex % 2);
+ return (sequenceByteCount);
}
- unsigned short GetUnknown1(void) const
+ unsigned int GetUnknown1(void) const
{
return (unknown1);
}
@@ -109,9 +88,8 @@ namespace Heimdall
FileTransferPacket::Pack();
PackInteger(FileTransferPacket::kDataSize, destination);
- PackShort(FileTransferPacket::kDataSize + 4, partialPacketLength);
- PackInteger(FileTransferPacket::kDataSize + 6, lastFullPacketIndex);
- PackShort(FileTransferPacket::kDataSize + 10, unknown1);
+ PackInteger(FileTransferPacket::kDataSize + 4, sequenceByteCount);
+ PackInteger(FileTransferPacket::kDataSize + 8, unknown1);
PackInteger(FileTransferPacket::kDataSize + 12, partitionType);
}
};