Bug 1091577: Added |BluetoothDaemonPDU::GetHeader|, r=shawnjohnjr

The |GetHeader| method of |BluetoothDaemonPDU| returns the PDU's
header. This is helpful for debugging logs.
This commit is contained in:
Thomas Zimmermann 2014-11-05 15:43:06 +01:00
parent 1a908ed0a1
commit b1cb7387de
2 changed files with 12 additions and 0 deletions

View File

@ -58,6 +58,15 @@ BluetoothDaemonPDU::BluetoothDaemonPDU(size_t aPayloadSize)
, mUserData(nullptr)
{ }
void
BluetoothDaemonPDU::GetHeader(uint8_t& aService, uint8_t& aOpcode,
uint16_t& aPayloadSize)
{
memcpy(&aService, GetData(OFF_SERVICE), sizeof(aService));
memcpy(&aOpcode, GetData(OFF_OPCODE), sizeof(aOpcode));
memcpy(&aPayloadSize, GetData(OFF_LENGTH), sizeof(aPayloadSize));
}
ssize_t
BluetoothDaemonPDU::Send(int aFd)
{

View File

@ -64,6 +64,9 @@ public:
return mUserData;
}
void GetHeader(uint8_t& aService, uint8_t& aOpcode,
uint16_t& aPayloadSize);
ssize_t Send(int aFd);
ssize_t Receive(int aFd);