mirror of
https://github.com/espressif/openthread.git
synced 2026-08-20 17:39:51 +00:00
[posix] add missing header guards, style fixes (#9892)
This commit contains smaller changes in the `posix` platform modules: - Adds missing header guard checks. - Use consistent names for header guard defines. - Fix/update comments.
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_CONFIG_FILE_HPP_
|
||||
#define POSIX_PLATFORM_CONFIG_FILE_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_CONFIG_FILE_HPP_
|
||||
#define OT_POSIX_PLATFORM_CONFIG_FILE_HPP_
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
@@ -125,4 +125,4 @@ private:
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
|
||||
#endif // POSIX_PLATFORM_CONFIG_FILE_HPP_
|
||||
#endif // OT_POSIX_PLATFORM_CONFIG_FILE_HPP_
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_CONFIGURATION_HPP_
|
||||
#define POSIX_PLATFORM_CONFIGURATION_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_CONFIGURATION_HPP_
|
||||
#define OT_POSIX_PLATFORM_CONFIGURATION_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
@@ -150,4 +150,4 @@ private:
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_POSIX_CONFIG_CONFIGURATION_FILE_ENABLE
|
||||
#endif // POSIX_PLATFORM_CONFIGURATION_HPP_
|
||||
#endif // OT_POSIX_PLATFORM_CONFIGURATION_HPP_
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
* This file includes definitions for the HDLC interface to radio (RCP).
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_HDLC_INTERFACE_HPP_
|
||||
#define POSIX_PLATFORM_HDLC_INTERFACE_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_HDLC_INTERFACE_HPP_
|
||||
#define OT_POSIX_PLATFORM_HDLC_INTERFACE_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
@@ -272,4 +272,5 @@ private:
|
||||
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
#endif // POSIX_PLATFORM_HDLC_INTERFACE_HPP_
|
||||
|
||||
#endif // OT_POSIX_PLATFORM_HDLC_INTERFACE_HPP_
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
* This file implements the infrastructure interface for posix.
|
||||
*/
|
||||
|
||||
#ifndef OT_POSIX_PLATFORM_INFRA_IF_HPP_
|
||||
#define OT_POSIX_PLATFORM_INFRA_IF_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
#include <net/if.h>
|
||||
@@ -248,3 +251,5 @@ private:
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
#endif // OPENTHREAD_POSIX_CONFIG_INFRA_IF_ENABLE
|
||||
|
||||
#endif // OT_POSIX_PLATFORM_INFRA_IF_HPP_
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef OT_POSIX_PLATFORM_IP6_UTILS_HPP_
|
||||
#define OT_POSIX_PLATFORM_IP6_UTILS_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
@@ -68,3 +71,5 @@ private:
|
||||
} // namespace Ip6Utils
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
|
||||
#endif // OT_POSIX_PLATFORM_IP6_UTILS_HPP_
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes definitions for the SPI interface to radio (RCP).
|
||||
* This file includes definitions for the mainloop events and manager.
|
||||
*/
|
||||
|
||||
#ifndef OT_POSIX_PLATFORM_MAINLOOP_HPP_
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef OPENTHREAD_PLATFORM_CONFIG_H_
|
||||
#define OPENTHREAD_PLATFORM_CONFIG_H_
|
||||
#ifndef OPENTHREAD_PLATFORM_POSIX_CONFIG_H_
|
||||
#define OPENTHREAD_PLATFORM_POSIX_CONFIG_H_
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
@@ -429,4 +429,4 @@
|
||||
#define OPENTHREAD_POSIX_CONFIG_TREL_TX_PACKET_POOL_SIZE 5
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_PLATFORM_CONFIG_H_
|
||||
#endif // OPENTHREAD_PLATFORM_POSIX_CONFIG_H_
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
* This file includes the platform-specific initializers.
|
||||
*/
|
||||
|
||||
#ifndef PLATFORM_POSIX_H_
|
||||
#define PLATFORM_POSIX_H_
|
||||
#ifndef OT_PLATFORM_POSIX_H_
|
||||
#define OT_PLATFORM_POSIX_H_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
@@ -424,4 +424,4 @@ void platformBacktraceInit(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // PLATFORM_POSIX_H_
|
||||
#endif // OT_PLATFORM_POSIX_H_
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_POWER_H
|
||||
#define POSIX_PLATFORM_POWER_H
|
||||
#ifndef OT_POSIX_PLATFORM_POWER_HPP_
|
||||
#define OT_POSIX_PLATFORM_POWER_HPP_
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
@@ -286,4 +286,4 @@ private:
|
||||
};
|
||||
} // namespace Power
|
||||
} // namespace ot
|
||||
#endif // POSIX_PLATFORM_POWER_H
|
||||
#endif // OT_POSIX_PLATFORM_POWER_HPP_
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_RADIO_HPP_
|
||||
#define POSIX_PLATFORM_RADIO_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_RADIO_HPP_
|
||||
#define OT_POSIX_PLATFORM_RADIO_HPP_
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
#include "lib/spinel/radio_spinel.hpp"
|
||||
@@ -123,4 +123,4 @@ private:
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
|
||||
#endif // POSIX_PLATFORM_RADIO_HPP_
|
||||
#endif // OT_POSIX_PLATFORM_RADIO_HPP_
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_RADIO_URL_HPP_
|
||||
#define POSIX_PLATFORM_RADIO_URL_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_RADIO_URL_HPP_
|
||||
#define OT_POSIX_PLATFORM_RADIO_URL_HPP_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -78,4 +78,4 @@ private:
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
|
||||
#endif // POSIX_PLATFORM_RADIO_URL_HPP_
|
||||
#endif // OT_POSIX_PLATFORM_RADIO_URL_HPP_
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_RESOLVER_HPP_
|
||||
#define POSIX_PLATFORM_RESOLVER_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_RESOLVER_HPP_
|
||||
#define OT_POSIX_PLATFORM_RESOLVER_HPP_
|
||||
|
||||
#include <openthread/openthread-system.h>
|
||||
#include <openthread/platform/dns.h>
|
||||
@@ -73,10 +73,7 @@ public:
|
||||
/**
|
||||
* Updates the file descriptor sets with file descriptors used by the radio driver.
|
||||
*
|
||||
* @param[in,out] aReadFdSet A reference to the read file descriptors.
|
||||
* @param[in,out] aErrorFdSet A reference to the error file descriptors.
|
||||
* @param[in,out] aMaxFd A reference to the max file descriptor.
|
||||
* @param[in,out] aTimeout A reference to the timeout.
|
||||
* @param[in,out] aContext The mainloop context.
|
||||
*
|
||||
*/
|
||||
void UpdateFdSet(otSysMainloopContext &aContext);
|
||||
@@ -84,8 +81,7 @@ public:
|
||||
/**
|
||||
* Handles the result of select.
|
||||
*
|
||||
* @param[in] aReadFdSet A reference to the read file descriptors.
|
||||
* @param[in] aErrorFdSet A reference to the error file descriptors.
|
||||
* @param[in] aContext The mainloop context.
|
||||
*
|
||||
*/
|
||||
void Process(const otSysMainloopContext &aContext);
|
||||
@@ -122,4 +118,4 @@ private:
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE
|
||||
|
||||
#endif // POSIX_PLATFORM_RESOLVER_HPP_
|
||||
#endif // OT_POSIX_PLATFORM_RESOLVER_HPP_
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_SETTINGS_HPP_
|
||||
#define POSIX_PLATFORM_SETTINGS_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_SETTINGS_HPP_
|
||||
#define OT_POSIX_PLATFORM_SETTINGS_HPP_
|
||||
|
||||
namespace ot {
|
||||
namespace Posix {
|
||||
@@ -100,4 +100,4 @@ void PlatformSettingsGetSensitiveKeys(otInstance *aInstance, const uint16_t **aK
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
|
||||
#endif // POSIX_PLATFORM_SETTINGS_HPP_
|
||||
#endif // OT_POSIX_PLATFORM_SETTINGS_HPP_
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
* This file includes definitions for the SPI interface to radio (RCP).
|
||||
*/
|
||||
|
||||
#ifndef POSIX_PLATFORM_SPI_INTERFACE_HPP_
|
||||
#define POSIX_PLATFORM_SPI_INTERFACE_HPP_
|
||||
#ifndef OT_POSIX_PLATFORM_SPI_INTERFACE_HPP_
|
||||
#define OT_POSIX_PLATFORM_SPI_INTERFACE_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
@@ -258,4 +258,4 @@ private:
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
|
||||
#endif // POSIX_PLATFORM_SPI_INTERFACE_HPP_
|
||||
#endif // OT_POSIX_PLATFORM_SPI_INTERFACE_HPP_
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
* This file includes definitions for the vendor interface to radio (RCP).
|
||||
*/
|
||||
|
||||
#ifndef POSIX_APP_VENDOR_INTERFACE_HPP_
|
||||
#define POSIX_APP_VENDOR_INTERFACE_HPP_
|
||||
#ifndef OT_POSIX_APP_VENDOR_INTERFACE_HPP_
|
||||
#define OT_POSIX_APP_VENDOR_INTERFACE_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
@@ -171,4 +171,4 @@ public:
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
|
||||
#endif // POSIX_APP_VENDOR_INTERFACE_HPP_
|
||||
#endif // OT_POSIX_APP_VENDOR_INTERFACE_HPP_
|
||||
|
||||
Reference in New Issue
Block a user