[ncp] fix spinel encrypter compilation errors after recent refactoring (#5341)

This commit is contained in:
Krzysztof Bogucki
2020-08-05 13:00:53 -07:00
committed by GitHub
parent 7183b24e65
commit 3c132d4620
2 changed files with 12 additions and 12 deletions
+8 -8
View File
@@ -133,7 +133,7 @@ void NcpUart::EncodeAndSendToUart(void)
uint16_t len;
bool prevHostPowerState;
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
Spinel::BufferEncrypterReader &txFrameBuffer = mTxFrameBufferEncrypterReader;
BufferEncrypterReader &txFrameBuffer = mTxFrameBufferEncrypterReader;
#else
Spinel::Buffer &txFrameBuffer = mTxFrameBuffer;
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
@@ -308,19 +308,19 @@ void NcpUart::HandleError(otError aError, uint8_t *aBuf, uint16_t aBufLength)
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
NcpUart::Spinel::BufferEncrypterReader::SpinelBufferEncrypterReader(Spinel::Buffer &aTxFrameBuffer)
NcpUart::BufferEncrypterReader::BufferEncrypterReader(Spinel::Buffer &aTxFrameBuffer)
: mTxFrameBuffer(aTxFrameBuffer)
, mDataBufferReadIndex(0)
, mOutputDataLength(0)
{
}
bool NcpUart::Spinel::BufferEncrypterReader::IsEmpty(void) const
bool NcpUart::BufferEncrypterReader::IsEmpty(void) const
{
return mTxFrameBuffer.IsEmpty() && !mOutputDataLength;
}
otError NcpUart::Spinel::BufferEncrypterReader::OutFrameBegin(void)
otError NcpUart::BufferEncrypterReader::OutFrameBegin(void)
{
otError status = OT_ERROR_FAILED;
@@ -350,22 +350,22 @@ otError NcpUart::Spinel::BufferEncrypterReader::OutFrameBegin(void)
return status;
}
bool NcpUart::Spinel::BufferEncrypterReader::OutFrameHasEnded(void)
bool NcpUart::BufferEncrypterReader::OutFrameHasEnded(void)
{
return (mDataBufferReadIndex >= mOutputDataLength);
}
uint8_t NcpUart::Spinel::BufferEncrypterReader::OutFrameReadByte(void)
uint8_t NcpUart::BufferEncrypterReader::OutFrameReadByte(void)
{
return mDataBuffer[mDataBufferReadIndex++];
}
otError NcpUart::Spinel::BufferEncrypterReader::OutFrameRemove(void)
otError NcpUart::BufferEncrypterReader::OutFrameRemove(void)
{
return mTxFrameBuffer.OutFrameRemove();
}
void NcpUart::Spinel::BufferEncrypterReader::Reset(void)
void NcpUart::BufferEncrypterReader::Reset(void)
{
mOutputDataLength = 0;
mDataBufferReadIndex = 0;
+4 -4
View File
@@ -39,7 +39,7 @@
#include "ncp/ncp_base.hpp"
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
#include "spinel_encrypter.hpp"
#include "lib/spinel/spinel_encrypter.hpp"
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
namespace ot {
@@ -90,14 +90,14 @@ private:
* Wraps Spinel::Buffer allowing to read data through spinel encrypter.
* Creates additional buffers to allow transforming of the whole spinel frames.
*/
class Spinel::BufferEncrypterReader
class BufferEncrypterReader
{
public:
/**
* C-tor.
* Takes a reference to Spinel::Buffer in order to read spinel frames.
*/
explicit Spinel::BufferEncrypterReader(Spinel::Buffer &aTxFrameBuffer);
explicit BufferEncrypterReader(Spinel::Buffer &aTxFrameBuffer);
bool IsEmpty(void) const;
otError OutFrameBegin(void);
bool OutFrameHasEnded(void);
@@ -137,7 +137,7 @@ private:
Tasklet mUartSendTask;
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
Spinel::BufferEncrypterReader mTxFrameBufferEncrypterReader;
BufferEncrypterReader mTxFrameBufferEncrypterReader;
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
};