nl::Weave::System

Summary

Enumerations

@18{
  kTimerFactor_micro_per_milli = 1000,
  kTimerFactor_milli_per_unit = 1000,
  kTimerFactor_nano_per_milli = 1000000,
  kTimerFactor_micro_per_unit = 1000000
}
enum
@19{
  kEvent_ReleaseObj = _WEAVE_SYSTEM_CONFIG_LWIP_EVENT(0),
  kEvent_ScheduleWork = _WEAVE_SYSTEM_CONFIG_LWIP_EVENT(1)
}
enum
The Inet layer event type definitions.
LayerState{
  kLayerState_NotInitialized = 0,
  kLayerState_Initialized = 1
}
enum
The state of a Layer object.

Typedefs

Event nl::Weave::System::Event
The basic object for all InetLayer events.
EventType nl::Weave::System::EventType
The basic type for all InetLayer events.
LwIPEventHandlerFunction)(Object &aTarget, EventType aEventType, uintptr_t aArgument) typedef
Error(*

Functions

DescribeErrorLwIP(Error aError)
NL_DLL_EXPORT const char *
This implements a function to return an NULL-terminated LwIP-specific descriptive C string, associated with the specified, mapped LwIP error.
DescribeErrorPOSIX(Error aError)
NL_DLL_EXPORT const char *
This implements a function to return an NULL-terminated OS-specific descriptive C string, associated with the specified, mapped OS error.
FormatLwIPError(char *buf, uint16_t bufSize, int32_t err)
bool
Given an LwIP error, returns a human-readable NULL-terminated C string describing the error.
FormatPOSIXError(char *buf, uint16_t bufSize, int32_t err)
bool
Given a POSIX error, returns a human-readable NULL-terminated C string describing the error.
FormatSystemLayerError(char *buf, uint16_t bufSize, int32_t err)
bool
Given a System Layer error, returns a human-readable NULL-terminated C string describing the error.
IsErrorLwIP(Error aError)
NL_DLL_EXPORT bool
This implements an introspection function for Weave System Layer errors that allows the caller to determine whether the specified error is an internal, underlying LwIP error.
IsErrorPOSIX(Error aError)
NL_DLL_EXPORT bool
This implements an introspection function for Weave System Layer errors that allows the caller to determine whether the specified error is an internal, underlying OS error.
IsEventOfType(EventType aType)
bool
Check to verify if an EventType is a valid one.
MapErrorLwIP(err_t aError)
NL_DLL_EXPORT Error
This implements a mapping function for Weave System Layer errors that allows mapping underlying LwIP network stack errors into a platform- or system-specific range.
MapErrorPOSIX(int aError)
NL_DLL_EXPORT Error
This implements a mapping function for Weave System Layer errors that allows mapping integers in the number space of the underlying POSIX network and OS stack errors into a platform- or system-specific range.
RegisterLwIPErrorFormatter(void)
void
Register a text error formatter for LwIP errors.
RegisterPOSIXErrorFormatter(void)
void
Register a text error formatter for POSIX errors.
RegisterSystemLayerErrorFormatter(void)
void
Register a text error formatter for System Layer errors.

Classes

nl::Weave::System::Layer

This provides access to timers according to the configured event handling model.

nl::Weave::System::LwIPEventHandlerDelegate
nl::Weave::System::Mutex

This class represents a simple mutual exclusion lock used on platforms with preemptively scheduled multi-threaded
programming environments, for example, POSIX threads and FreeRTOS.

nl::Weave::System::Object

This represents a reference-counted object allocated from space contained in an ObjectPool object.

nl::Weave::System::PacketBuffer

The packet buffer class is the core structure used for manipulating packets of octet-serialized data, usually in the context of a data communications network, like Bluetooth or the Internet protocol.

nl::Weave::System::Timer

This is an internal class to Weave System Layer, used to represent an in-progress one-shot timer.

Structs

nl::Weave::System::LwIPEvent

Unions

nl::Weave::System::ObjectArena

A union template used for representing a well-aligned block of memory.

Namespaces

nl::Weave::System::Platform
nl::Weave::System::Stats

Enumerations

@18

 @18
Properties
kTimerFactor_micro_per_milli

Number of nanoseconds in a microsecond.

kTimerFactor_micro_per_unit

Number of nanoseconds in a millisecond.

kTimerFactor_milli_per_unit

Number of microseconds in a millisecond.

kTimerFactor_nano_per_milli

Number of milliseconds in a second.

@19

 @19

The Inet layer event type definitions.

Properties
kEvent_ReleaseObj

The event for the drop of a SystemLayer object.

kEvent_ScheduleWork

The event for scheduling work on the System Layer's thread.

LayerState

 LayerState

The state of a Layer object.

Properties
kLayerState_Initialized

Initialized state.

kLayerState_NotInitialized

Not initialized state.

Typedefs

Event

WEAVE_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE Event

The basic object for all InetLayer events.

This is defined to a platform- or system-specific type.

EventType

WEAVE_SYSTEM_CONFIG_LWIP_EVENT_TYPE EventType

The basic type for all InetLayer events.

This is defined to a platform- or system-specific type.

LwIPEventHandlerFunction

Error(* LwIPEventHandlerFunction)(Object &aTarget, EventType aEventType, uintptr_t aArgument)

Functions

DescribeErrorLwIP

NL_DLL_EXPORT const char * DescribeErrorLwIP(
  Error aError
)

This implements a function to return an NULL-terminated LwIP-specific descriptive C string, associated with the specified, mapped LwIP error.

Details
Parameters
[in] err
The mapped LwIP-specific error to describe.
Returns
A NULL-terminated, LwIP-specific descriptive C string describing the error.

DescribeErrorPOSIX

NL_DLL_EXPORT const char * DescribeErrorPOSIX(
  Error aError
)

This implements a function to return an NULL-terminated OS-specific descriptive C string, associated with the specified, mapped OS error.

Details
Parameters
[in] err
The mapped OS-specific error to describe.
Returns
A NULL-terminated, OS-specific descriptive C string describing the error.

FormatLwIPError

bool FormatLwIPError(
  char *buf,
  uint16_t bufSize,
  int32_t err
)

Given an LwIP error, returns a human-readable NULL-terminated C string describing the error.

Details
Parameters
[in] buf
Buffer into which the error string will be placed.
[in] bufSize
Size of the supplied buffer in bytes.
[in] err
The error to be described.
Returns
true If a description string was written into the supplied buffer.
Returns
false If the supplied error was not an LwIP error.

FormatPOSIXError

bool FormatPOSIXError(
  char *buf,
  uint16_t bufSize,
  int32_t err
)

Given a POSIX error, returns a human-readable NULL-terminated C string describing the error.

Details
Parameters
[in] buf
Buffer into which the error string will be placed.
[in] bufSize
Size of the supplied buffer in bytes.
[in] err
The error to be described.
Returns
true If a description string was written into the supplied buffer.
Returns
false If the supplied error was not a POSIX error.

FormatSystemLayerError

bool FormatSystemLayerError(
  char *buf,
  uint16_t bufSize,
  int32_t err
)

Given a System Layer error, returns a human-readable NULL-terminated C string describing the error.

Details
Parameters
[in] buf
Buffer into which the error string will be placed.
[in] bufSize
Size of the supplied buffer in bytes.
[in] err
The error to be described.
Returns
true If a description string was written into the supplied buffer.
Returns
false If the supplied error was not a System Layer error.

IsErrorLwIP

NL_DLL_EXPORT bool IsErrorLwIP(
  Error aError
)

This implements an introspection function for Weave System Layer errors that allows the caller to determine whether the specified error is an internal, underlying LwIP error.

Details
Parameters
[in] err
The mapped error to determine whether it is a LwIP error.
Returns
True if the specified error is a LwIP error; otherwise, false.

IsErrorPOSIX

NL_DLL_EXPORT bool IsErrorPOSIX(
  Error aError
)

This implements an introspection function for Weave System Layer errors that allows the caller to determine whether the specified error is an internal, underlying OS error.

Details
Parameters
[in] err
The mapped error to determine whether it is an OS error.
Returns
True if the specified error is an OS error; otherwise, false.

IsEventOfType

bool IsEventOfType(
  EventType aType
)

Check to verify if an EventType is a valid one.

Details
Parameters
[in] aEventType
Weave System Layer event type.
Returns
true if it falls within the enumerated range; otherwise, false.

MapErrorLwIP

NL_DLL_EXPORT Error MapErrorLwIP(
  err_t aError
)

This implements a mapping function for Weave System Layer errors that allows mapping underlying LwIP network stack errors into a platform- or system-specific range.

Details
Parameters
[in] e
The LwIP error to map.
Returns
The mapped LwIP network or OS error.

MapErrorPOSIX

NL_DLL_EXPORT Error MapErrorPOSIX(
  int aError
)

This implements a mapping function for Weave System Layer errors that allows mapping integers in the number space of the underlying POSIX network and OS stack errors into a platform- or system-specific range.

Error codes beyond those currently defined by POSIX or the ISO C/C++ standards are mapped similar to the standard ones.

Details
Parameters
[in] e
The POSIX network or OS error to map.
Returns
The mapped POSIX network or OS error.

RegisterLwIPErrorFormatter

void RegisterLwIPErrorFormatter(
  void
)

Register a text error formatter for LwIP errors.

RegisterPOSIXErrorFormatter

void RegisterPOSIXErrorFormatter(
  void
)

Register a text error formatter for POSIX errors.

RegisterSystemLayerErrorFormatter

void RegisterSystemLayerErrorFormatter(
  void
)

Register a text error formatter for System Layer errors.