mirror of
https://github.com/espressif/openthread.git
synced 2026-09-18 15:10:12 +00:00
Remove extern "C" from cpp files. (#1595)
This commit is contained in:
@@ -35,6 +35,12 @@
|
||||
#ifndef OPENTHREAD_DNS_H_
|
||||
#define OPENTHREAD_DNS_H_
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_FILE
|
||||
#include OPENTHREAD_CONFIG_FILE
|
||||
#else
|
||||
#include <openthread-config.h>
|
||||
#endif
|
||||
|
||||
#include <openthread/types.h>
|
||||
#include <openthread/message.h>
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
extern "C" {
|
||||
|
||||
void otCoapHeaderInit(otCoapHeader *aHeader, otCoapType aType, otCoapCode aCode)
|
||||
{
|
||||
Coap::Header *header = static_cast<Coap::Header *>(aHeader);
|
||||
@@ -170,5 +168,3 @@ ThreadError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const
|
||||
return aInstance->mApplicationCoapServer.SendMessage(
|
||||
*static_cast<Message *>(aMessage), *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_COMMISSIONER
|
||||
|
||||
ThreadError otCommissionerStart(otInstance *aInstance)
|
||||
@@ -122,7 +118,3 @@ ThreadError otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassP
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_COMMISSIONER
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
|
||||
using namespace Thread::Crypto;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void otCryptoHmacSha256(
|
||||
const uint8_t *aKey, uint16_t aKeyLength,
|
||||
const uint8_t *aBuf, uint16_t aBufLength,
|
||||
@@ -88,7 +84,3 @@ void otCryptoAesCcm(
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool otDatasetIsCommissioned(otInstance *aInstance)
|
||||
{
|
||||
otOperationalDataset dataset;
|
||||
@@ -137,7 +133,3 @@ ThreadError otDatasetSetDelayTimerMinimal(otInstance *aInstance, uint32_t aDelay
|
||||
{
|
||||
return aInstance->mThreadNetif.GetLeader().SetDelayTimerMinimal(aDelayTimerMinimal);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -38,10 +38,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_DHCP6_CLIENT
|
||||
void otDhcp6ClientUpdate(otInstance *aInstance, otDhcpAddress *aAddresses, uint32_t aNumAddresses, void *aContext)
|
||||
{
|
||||
@@ -55,7 +51,3 @@ void otDhcp6ServerUpdate(otInstance *aInstance)
|
||||
aInstance->mThreadNetif.GetDhcp6Server().UpdateService();
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_DHCP6_SERVER
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_DNS_CLIENT
|
||||
ThreadError otDnsClientQuery(otInstance *aInstance, const otDnsQuery *aQuery, otDnsResponseHandler aHandler,
|
||||
void *aContext)
|
||||
@@ -48,7 +44,3 @@ ThreadError otDnsClientQuery(otInstance *aInstance, const otDnsQuery *aQuery, ot
|
||||
return aInstance->mThreadNetif.GetDnsClient().Query(aQuery, aHandler, aContext);
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_DNS_CLIENT
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool otIcmp6IsEchoEnabled(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mIp6.mIcmp.IsEchoEnabled();
|
||||
@@ -63,7 +59,3 @@ ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage *aMessage,
|
||||
*static_cast<const Ip6::MessageInfo *>(aMessageInfo),
|
||||
aIdentifier);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -75,10 +75,6 @@ otInstance::otInstance(void) :
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void otInstancePostConstructor(otInstance *aInstance)
|
||||
{
|
||||
// restore datasets and network information
|
||||
@@ -251,7 +247,3 @@ ThreadError otSetDynamicLogLevel(otInstance *aInstance, otLogLevel aLogLevel)
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -41,10 +41,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ThreadError otIp6SetEnabled(otInstance *aInstance, bool aEnabled)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
@@ -220,7 +216,3 @@ uint8_t otIp6PrefixMatch(const otIp6Address *aFirst, const otIp6Address *aSecond
|
||||
exit:
|
||||
return rval;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_JAM_DETECTION
|
||||
|
||||
ThreadError otJamDetectionSetRssiThreshold(otInstance *aInstance, int8_t aRssiThreshold)
|
||||
@@ -99,7 +95,3 @@ uint64_t otJamDetectionGetHistoryBitmap(otInstance *aInstance)
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_JAM_DETECTION
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_JOINER
|
||||
|
||||
ThreadError otJoinerStart(otInstance *aInstance, const char *aPSKd, const char *aProvisioningUrl,
|
||||
@@ -59,7 +55,3 @@ ThreadError otJoinerStop(otInstance *aInstance)
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_JOINER
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static void HandleActiveScanResult(void *aContext, Mac::Frame *aFrame);
|
||||
static void HandleEnergyScanResult(void *aContext, otEnergyScanResult *aResult);
|
||||
|
||||
@@ -376,8 +372,3 @@ bool otLinkIsInTransmitState(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetMac().IsInTransmitState();
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
#include "openthread/platform/usec-alarm.h"
|
||||
#include "openthread-instance.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ThreadError otLinkRawSetEnable(otInstance *aInstance, bool aEnabled)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
@@ -259,10 +255,6 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace Thread {
|
||||
|
||||
LinkRaw::LinkRaw(otInstance &aInstance):
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ThreadError otMessageFree(otMessage *aMessage)
|
||||
{
|
||||
return static_cast<Message *>(aMessage)->Free();
|
||||
@@ -177,7 +173,3 @@ void otMessageGetBufferInfo(otInstance *aInstance, otBufferInfo *aBufferInfo)
|
||||
aInstance->mThreadNetif.GetCoapServer().GetCachedResponses().GetInfo(aBufferInfo->mCoapServerMessages,
|
||||
aBufferInfo->mCoapServerBuffers);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ThreadError otNetDataGetLeader(otInstance *aInstance, bool aStable, uint8_t *aData, uint8_t *aDataLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
@@ -156,7 +152,3 @@ uint8_t otNetDataGetStableVersion(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetMle().GetLeaderDataTlv().GetStableDataVersion();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void otTaskletsProcess(otInstance *aInstance)
|
||||
{
|
||||
otLogFuncEntry();
|
||||
@@ -55,7 +51,3 @@ bool otTaskletsArePending(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mIp6.mTaskletScheduler.AreTaskletsPending();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint8_t otThreadGetMaxAllowedChildren(otInstance *aInstance)
|
||||
{
|
||||
uint8_t aNumChildren;
|
||||
@@ -702,7 +698,3 @@ bool otThreadIsDiscoverInProgress(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetMle().IsDiscoverInProgress();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
|
||||
using namespace Thread;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
otMessage *otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled)
|
||||
{
|
||||
Message *message = aInstance->mIp6.mUdp.NewMessage(0);
|
||||
@@ -103,7 +99,3 @@ ThreadError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessage
|
||||
return socket->SendTo(*static_cast<Message *>(aMessage),
|
||||
*static_cast<const Ip6::MessageInfo *>(aMessageInfo));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -35,13 +35,6 @@
|
||||
#include <crypto/pbkdf2_cmac.h>
|
||||
#include <mbedtls/cmac.h>
|
||||
|
||||
namespace Thread {
|
||||
namespace Crypto {
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void otPbkdf2Cmac(
|
||||
const uint8_t *aPassword, uint16_t aPasswordLen,
|
||||
const uint8_t *aSalt, uint16_t aSaltLen,
|
||||
@@ -91,10 +84,3 @@ void otPbkdf2Cmac(
|
||||
keyLen -= useLen;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
} // namespace Crypto
|
||||
} // namespace Thread
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
|
||||
using namespace Thread::Diagnostics;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void otDiagInit(otInstance *aInstance)
|
||||
{
|
||||
Diag::Init(aInstance);
|
||||
@@ -83,7 +79,3 @@ bool otDiagIsEnabled()
|
||||
{
|
||||
return Diag::isEnabled();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user