mirror of
https://github.com/espressif/openthread.git
synced 2026-08-25 03:39:52 +00:00
[nrf52840] fix build with COAPS=1 and SNTP_CLIENT=1 (#3440)
This commit is contained in:
committed by
Jonathan Hui
parent
a2a9d6502e
commit
8c793427a3
@@ -347,10 +347,10 @@ void Client::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessag
|
||||
// Check the Kiss-o'-death packet.
|
||||
if (!responseHeader.GetStratum())
|
||||
{
|
||||
char kissCode[Header::GetKissCodeLength() + 1];
|
||||
char kissCode[Header::kKissCodeLength + 1];
|
||||
|
||||
memcpy(kissCode, responseHeader.GetKissCode(), Header::GetKissCodeLength());
|
||||
kissCode[Header::GetKissCodeLength()] = 0;
|
||||
memcpy(kissCode, responseHeader.GetKissCode(), Header::kKissCodeLength);
|
||||
kissCode[Header::kKissCodeLength] = 0;
|
||||
|
||||
otLogInfoIp6("SNTP response contains the Kiss-o'-death packet with %s code", kissCode);
|
||||
ExitNow(error = OT_ERROR_BUSY);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <openthread/sntp.h>
|
||||
|
||||
#include "common/message.hpp"
|
||||
@@ -76,6 +77,15 @@ public:
|
||||
kModeServer = 4,
|
||||
};
|
||||
|
||||
/**
|
||||
* Kiss code length.
|
||||
*
|
||||
*/
|
||||
enum
|
||||
{
|
||||
kKissCodeLength = 4, ///< Length of the kiss code in ASCII format
|
||||
};
|
||||
|
||||
/**
|
||||
* This method returns the flags field value.
|
||||
*
|
||||
@@ -204,14 +214,6 @@ public:
|
||||
*/
|
||||
char *GetKissCode(void) { return reinterpret_cast<char *>(&mReferenceId); }
|
||||
|
||||
/**
|
||||
* This method returns the length of the kiss code in ASCII format.
|
||||
*
|
||||
* @returns The length of the kiss code in ASCII format.
|
||||
*
|
||||
*/
|
||||
static uint16_t GetKissCodeLength(void) { return sizeof(uint32_t); };
|
||||
|
||||
/**
|
||||
* This method returns the reference timestamp seconds field.
|
||||
*
|
||||
|
||||
@@ -38,4 +38,5 @@
|
||||
|
||||
#if defined(__CC_ARM)
|
||||
_Pragma("diag_suppress=550")
|
||||
_Pragma("diag_suppress=68")
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user