From ed0939c45a20187d7d50258f14077cce06b45efe Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 30 Aug 2019 09:01:08 -0700 Subject: [PATCH] [mac] move static variable definition into Mac class (#4132) Reasons for this the change: - Namespace/scope variables under Mac class only. - Allow us in future to potentially break mac.cpp into multiple files (e.g. mac_ftd?). --- src/core/mac/mac.cpp | 11 ++++++----- src/core/mac/mac.hpp | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index d451a0809..08d3e4ef1 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -55,17 +55,18 @@ namespace ot { namespace Mac { -static const uint8_t sMode2Key[] = {0x78, 0x58, 0x16, 0x86, 0xfd, 0xb4, 0x58, 0x0f, - 0xb0, 0x92, 0x54, 0x6a, 0xec, 0xbd, 0x15, 0x66}; +const uint8_t Mac::sMode2Key[] = {0x78, 0x58, 0x16, 0x86, 0xfd, 0xb4, 0x58, 0x0f, + 0xb0, 0x92, 0x54, 0x6a, 0xec, 0xbd, 0x15, 0x66}; -static const otExtAddress sMode2ExtAddress = { +const otExtAddress Mac::sMode2ExtAddress = { {0x35, 0x06, 0xfe, 0xb8, 0x23, 0xd4, 0x87, 0x12}, }; -static const otExtendedPanId sExtendedPanidInit = { +const otExtendedPanId Mac::sExtendedPanidInit = { {0xde, 0xad, 0x00, 0xbe, 0xef, 0x00, 0xca, 0xfe}, }; -static const char sNetworkNameInit[] = "OpenThread"; + +const char Mac::sNetworkNameInit[] = "OpenThread"; Mac::Mac(Instance &aInstance) : InstanceLocator(aInstance) diff --git a/src/core/mac/mac.hpp b/src/core/mac/mac.hpp index 11e8c2f5e..30fa6138a 100644 --- a/src/core/mac/mac.hpp +++ b/src/core/mac/mac.hpp @@ -678,6 +678,11 @@ private: static const char *OperationToString(Operation aOperation); + static const uint8_t sMode2Key[]; + static const otExtAddress sMode2ExtAddress; + static const otExtendedPanId sExtendedPanidInit; + static const char sNetworkNameInit[]; + bool mEnabled : 1; bool mPendingActiveScan : 1; bool mPendingEnergyScan : 1;