mirror of
https://github.com/espressif/openthread.git
synced 2026-08-25 19:59:51 +00:00
fix compilation issues (#71)
This commit is contained in:
committed by
Jonathan Hui
parent
9cb7aad7bf
commit
f7a0ddc2f9
@@ -324,14 +324,14 @@ typedef enum otMleAttachFilter
|
||||
/**
|
||||
* Represents a Thread device role.
|
||||
*/
|
||||
enum otDeviceRole
|
||||
typedef enum
|
||||
{
|
||||
kDeviceRoleDisabled, ///< The Thread stack is disabled.
|
||||
kDeviceRoleDetached, ///< Not currently participating in a Thread network/partition.
|
||||
kDeviceRoleChild, ///< The Thread Child role.
|
||||
kDeviceRoleRouter, ///< The Thread Router role.
|
||||
kDeviceRoleLeader, ///< The Thread Leader role.
|
||||
};
|
||||
} otDeviceRole;
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
+16
-15
@@ -36,6 +36,7 @@
|
||||
#define OPENTHREAD_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <openthread-types.h>
|
||||
|
||||
@@ -367,7 +368,7 @@ ThreadError otSetPanId(otPanId aPanId);
|
||||
*
|
||||
* @returns A pointer to the first Network Inteface Address.
|
||||
*/
|
||||
const otNetifAddress *otGetUnicastAddresses();
|
||||
const otNetifAddress *otGetUnicastAddresses(void);
|
||||
|
||||
/**
|
||||
* Add a Network Interface Address to the Thread interface.
|
||||
@@ -651,7 +652,7 @@ void otRemoveMacWhitelist(const uint8_t *aExtAddr);
|
||||
* @sa otDisableMacWhitelist
|
||||
* @sa otEnableMacWhitelist
|
||||
*/
|
||||
void otClearMacWhitelist();
|
||||
void otClearMacWhitelist(void);
|
||||
|
||||
/**
|
||||
* Disable MAC whitelist filtering.
|
||||
@@ -663,7 +664,7 @@ void otClearMacWhitelist();
|
||||
* @sa otClearMacWhitelist
|
||||
* @sa otEnableMacWhitelist
|
||||
*/
|
||||
void otDisableMacWhitelist();
|
||||
void otDisableMacWhitelist(void);
|
||||
|
||||
/**
|
||||
* Enable MAC whitelist filtering.
|
||||
@@ -674,7 +675,7 @@ void otDisableMacWhitelist();
|
||||
* @sa otClearMacWhitelist
|
||||
* @sa otDisableMacWhitelist
|
||||
*/
|
||||
void otEnableMacWhitelist();
|
||||
void otEnableMacWhitelist(void);
|
||||
|
||||
/**
|
||||
* Detach from the Thread network.
|
||||
@@ -682,7 +683,7 @@ void otEnableMacWhitelist();
|
||||
* @retval kThreadErrorNone Successfully detached from the Thread network.
|
||||
* @retval kThreadErrorBusy Thread is disabled.
|
||||
*/
|
||||
ThreadError otBecomeDetached();
|
||||
ThreadError otBecomeDetached(void);
|
||||
|
||||
/**
|
||||
* Attempt to reattach as a child.
|
||||
@@ -700,14 +701,14 @@ ThreadError otBecomeChild(otMleAttachFilter aFilter);
|
||||
* @retval kThreadErrorNone Successfully begin attempt to become a router.
|
||||
* @retval kThreadErrorBusy Thread is disabled or already operating in a router or leader role.
|
||||
*/
|
||||
ThreadError otBecomeRouter();
|
||||
ThreadError otBecomeRouter(void);
|
||||
|
||||
/**
|
||||
* Become a leader and start a new partition.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully became a leader and started a new partition.
|
||||
*/
|
||||
ThreadError otBecomeLeader();
|
||||
ThreadError otBecomeLeader(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -738,35 +739,35 @@ ThreadError otBecomeLeader();
|
||||
* @retval ::kDeviceRoleRouter The device is currently operating as a Thread Router.
|
||||
* @retval ::kDeviceRoleLeader The device is currently operating as a Thread Leader.
|
||||
*/
|
||||
otDeviceRole otGetDeviceRole();
|
||||
otDeviceRole otGetDeviceRole(void);
|
||||
|
||||
/**
|
||||
* Get the Leader's Router ID.
|
||||
*
|
||||
* @returns The Leader's Router ID.
|
||||
*/
|
||||
uint8_t otGetLeaderRouterId();
|
||||
uint8_t otGetLeaderRouterId(void);
|
||||
|
||||
/**
|
||||
* Get the Leader's Weight.
|
||||
*
|
||||
* @returns The Leader's Weight.
|
||||
*/
|
||||
uint8_t otGetLeaderWeight();
|
||||
uint8_t otGetLeaderWeight(void);
|
||||
|
||||
/**
|
||||
* Get the Network Data Version.
|
||||
*
|
||||
* @returns The Network Data Version.
|
||||
*/
|
||||
uint8_t otGetNetworkDataVersion();
|
||||
uint8_t otGetNetworkDataVersion(void);
|
||||
|
||||
/**
|
||||
* Get the Partition ID.
|
||||
*
|
||||
* @returns The Partition ID.
|
||||
*/
|
||||
uint32_t otGetPartitionId();
|
||||
uint32_t otGetPartitionId(void);
|
||||
|
||||
/**
|
||||
* Get the RLOC16.
|
||||
@@ -780,14 +781,14 @@ uint16_t otGetRloc16(void);
|
||||
*
|
||||
* @returns The Router ID Sequence.
|
||||
*/
|
||||
uint8_t otGetRouterIdSequence();
|
||||
uint8_t otGetRouterIdSequence(void);
|
||||
|
||||
/**
|
||||
* Get the Stable Network Data Version.
|
||||
*
|
||||
* @returns The Stable Network Data Version.
|
||||
*/
|
||||
uint8_t otGetStableNetworkDataVersion();
|
||||
uint8_t otGetStableNetworkDataVersion(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -1010,7 +1011,7 @@ int otWriteMessage(otMessage aMessage, uint16_t aOffset, const void *aBuf, uint1
|
||||
*
|
||||
* @sa otFreeMessage
|
||||
*/
|
||||
otMessage otNewUdpMessage();
|
||||
otMessage otNewUdpMessage(void);
|
||||
|
||||
/**
|
||||
* Open a UDP/IPv6 socket.
|
||||
|
||||
+16
-16
@@ -62,7 +62,7 @@ static otDEFINE_ALIGNED_VAR(sThreadNetifRaw, sizeof(ThreadNetif), uint64_t);
|
||||
|
||||
static void HandleActiveScanResult(void *aContext, Mac::Frame *aFrame);
|
||||
|
||||
void otInit()
|
||||
void otInit(void)
|
||||
{
|
||||
otLogInfoApi("Init\n");
|
||||
Message::Init();
|
||||
@@ -341,22 +341,22 @@ void otRemoveMacWhitelist(const uint8_t *aExtAddr)
|
||||
sThreadNetif->GetMac().GetWhitelist().Remove(*reinterpret_cast<const Mac::ExtAddress *>(aExtAddr));
|
||||
}
|
||||
|
||||
void otClearMacWhitelist()
|
||||
void otClearMacWhitelist(void)
|
||||
{
|
||||
sThreadNetif->GetMac().GetWhitelist().Clear();
|
||||
}
|
||||
|
||||
void otDisableMacWhitelist()
|
||||
void otDisableMacWhitelist(void)
|
||||
{
|
||||
sThreadNetif->GetMac().GetWhitelist().Disable();
|
||||
}
|
||||
|
||||
void otEnableMacWhitelist()
|
||||
void otEnableMacWhitelist(void)
|
||||
{
|
||||
sThreadNetif->GetMac().GetWhitelist().Enable();
|
||||
}
|
||||
|
||||
ThreadError otBecomeDetached()
|
||||
ThreadError otBecomeDetached(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().BecomeDetached();
|
||||
}
|
||||
@@ -366,17 +366,17 @@ ThreadError otBecomeChild(otMleAttachFilter aFilter)
|
||||
return sThreadNetif->GetMle().BecomeChild(aFilter);
|
||||
}
|
||||
|
||||
ThreadError otBecomeRouter()
|
||||
ThreadError otBecomeRouter(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().BecomeRouter();
|
||||
}
|
||||
|
||||
ThreadError otBecomeLeader()
|
||||
ThreadError otBecomeLeader(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().BecomeLeader();
|
||||
}
|
||||
|
||||
otDeviceRole otGetDeviceRole()
|
||||
otDeviceRole otGetDeviceRole(void)
|
||||
{
|
||||
otDeviceRole rval = kDeviceRoleDisabled;
|
||||
|
||||
@@ -406,22 +406,22 @@ otDeviceRole otGetDeviceRole()
|
||||
return rval;
|
||||
}
|
||||
|
||||
uint8_t otGetLeaderRouterId()
|
||||
uint8_t otGetLeaderRouterId(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().GetLeaderDataTlv().GetLeaderRouterId();
|
||||
}
|
||||
|
||||
uint8_t otGetLeaderWeight()
|
||||
uint8_t otGetLeaderWeight(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().GetLeaderDataTlv().GetWeighting();
|
||||
}
|
||||
|
||||
uint8_t otGetNetworkDataVersion()
|
||||
uint8_t otGetNetworkDataVersion(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().GetLeaderDataTlv().GetDataVersion();
|
||||
}
|
||||
|
||||
uint32_t otGetPartitionId()
|
||||
uint32_t otGetPartitionId(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().GetLeaderDataTlv().GetPartitionId();
|
||||
}
|
||||
@@ -431,12 +431,12 @@ uint16_t otGetRloc16(void)
|
||||
return sThreadNetif->GetMle().GetRloc16();
|
||||
}
|
||||
|
||||
uint8_t otGetRouterIdSequence()
|
||||
uint8_t otGetRouterIdSequence(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().GetRouterIdSequence();
|
||||
}
|
||||
|
||||
uint8_t otGetStableNetworkDataVersion()
|
||||
uint8_t otGetStableNetworkDataVersion(void)
|
||||
{
|
||||
return sThreadNetif->GetMle().GetLeaderDataTlv().GetStableDataVersion();
|
||||
}
|
||||
@@ -451,7 +451,7 @@ ThreadError otIp6AddressFromString(const char *str, otIp6Address *address)
|
||||
return static_cast<Ip6::Address *>(address)->FromString(str);
|
||||
}
|
||||
|
||||
const otNetifAddress *otGetUnicastAddresses()
|
||||
const otNetifAddress *otGetUnicastAddresses(void)
|
||||
{
|
||||
return sThreadNetif->GetUnicastAddresses();
|
||||
}
|
||||
@@ -527,7 +527,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
otMessage otNewUdpMessage()
|
||||
otMessage otNewUdpMessage(void)
|
||||
{
|
||||
return Ip6::Udp::NewMessage(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user