Wirepas SDK
|
The global macros, types and functions available to applications can be found in the wms_app.h header.
Definition in file wms_app.h.
Go to the source code of this file.
Typedefs | |
typedef uint32_t(* | app_get_api_version_f) (void) |
typedef app_firmware_version_t(* | app_get_stack_firmware_version_f) (void) |
Get stack firmware version. More... | |
typedef uint32_t(* | get_api_version_compatible_f) (void) |
typedef uint32_t | app_addr_t |
Functions | |
intptr_t | App_entrypoint (const void *functions, size_t reserved1, const void **reserved2, void **ram_top) |
Application initial entrypoint. More... | |
static uint32_t | App_getApiVersion (const void *const global_cb) |
Data Structures | |
union | app_v2_tag_t |
struct | app_information_header_t |
Application information header. More... | |
union | app_firmware_version_t |
struct | app_global_functions_t |
List of global functions, passed to App_entrypoint() More... | |
struct | app_firmware_version_t.__unnamed__ |
Enumerations | |
enum | app_res_e { APP_RES_OK = 0, APP_RES_UNSPECIFIED_ERROR = 1, APP_RES_NOT_IMPLEMENTED = 2, APP_RES_INVALID_VALUE = 3, APP_RES_INVALID_NULL_POINTER = 4, APP_RES_INVALID_CONFIGURATION = 5, APP_RES_RESOURCE_UNAVAILABLE = 6, APP_RES_INVALID_STACK_STATE = 7, APP_RES_ACCESS_DENIED = 8 } |
enum | app_special_addr_e { APP_ADDR_ANYSINK = 0xfffffffeu, APP_ADDR_BROADCAST = 0xffffffffu, APP_ADDR_MULTICAST = 0x80000000u, APP_ADDR_MULTICAST_LAST = 0x80ffffffu } |
Special destination addresses for sending packets. More... | |
Macros | |
#define | __STATIC_INLINE static inline |
#define | APP_API_VERSION 0x200 |
#define | APP_V2_TAG |
#define | APP_V2_TAG_LENGTH 16 |
#define | APP_V2_TAG_OFFSET 48 |
#define | APP_V2_TAG_MIN_API_VERSION 0x200 |
#define | APP_API_V1_VERSION 0x100 |
Variables | |
const typedef void *(* | app_open_library_f )(uint32_t name, uint32_t version) |
Open a library. More... | |
typedef uint32_t app_addr_t |
Node address. Each node must have a unique address in the network. There are special addresses that can be used as destination addresses, see app_special_addr_e. For various addressing modes, see addressing.
typedef uint32_t(* app_get_api_version_f) (void) |
Get the global API version, which may be greater than the APP_API_VERSION macro if the stack firmware is newer than the SDK used to compile the application. It is up to the stack firmware to be backward compatible with any global API changes, or not run the application at all.
typedef app_firmware_version_t(* app_get_stack_firmware_version_f) (void) |
typedef uint32_t(* get_api_version_compatible_f) (void) |
intptr_t App_entrypoint | ( | const void * | functions, |
size_t | reserved1, | ||
const void ** | reserved2, | ||
void ** | ram_top | ||
) |
Application initial entrypoint.
functions | Pointer to a global function table, app_global_functions_t |
reserved1 | Reserved for future use |
reserved2 | Reserved for future use |
ram_top | Pointer to a pointer of first free RAM address. The application may reduce this value, if it does not need all the RAM provided to it |
|
inlinestatic |
union app_v2_tag_t |
Container for APP_V2_TAG, for pointer arithmetic
Data Fields | ||
---|---|---|
uint32_t | array[16/4] | |
uint8_t | bytes[16] |
struct app_information_header_t |
Application information header.
If an application is compiled to support application API v2, this header can found in the beginning of the application memory area. It is placed right after the APP_V2_TAG, which is at APP_V2_TAG_OFFSET.
union app_firmware_version_t |
Firmware version type, returned from app_global_functions_t::getStackFirmwareVersion(). The individual sub-fields can be accessed, or the whole 32-bit value can be read all at once, using the version field.
Data Fields | ||
---|---|---|
struct app_firmware_version_t | __unnamed__ | |
uint32_t | version |
struct app_global_functions_t |
List of global functions, passed to App_entrypoint()
Data Fields | ||
---|---|---|
app_get_api_version_f | getApiVersion | |
app_get_stack_firmware_version_f | getStackFirmwareVersion | |
app_open_library_f | openLibrary |
struct app_firmware_version_t.__unnamed__ |
enum app_res_e |
This is the most common return type from library functions. Functions use these return values, unless more specific return values are required.
Definition at line 201 of file wms_app.h.
enum app_special_addr_e |
Special destination addresses for sending packets.
Enumerator | |
---|---|
APP_ADDR_ANYSINK | Send packet to the best available sink |
APP_ADDR_BROADCAST | Send packet as broadcast to all nodes.
|
APP_ADDR_MULTICAST | This is a bitmask that should be ORed with group address to send data packet to the multicast group. For example: 0x80000002 address sends packet to the multicast group #2. |
APP_ADDR_MULTICAST_LAST | This is last valid multicast address. Addresses larger than this (until APP_ADDR_ANYSINK) are unicast addresses. |
Definition at line 233 of file wms_app.h.
#define APP_API_V1_VERSION 0x100 |
#define APP_API_VERSION 0x200 |
#define APP_V2_TAG |
#define APP_V2_TAG_LENGTH 16 |
Length of APP_V2_TAG, in bytes
#define APP_V2_TAG_MIN_API_VERSION 0x200 |
#define APP_V2_TAG_OFFSET 48 |
Byte offset of APP_V2_TAG from the start of application memory area
const typedef void*(* app_open_library_f) (uint32_t name, uint32_t version) |
Open a library.
This is the most important function of the Single-MCU API. All other functions are in libraries, opened using the this function. Parameters are the name and version of the library. The name is actually a 32-bit value, which is defined in each library header as a macro: APP_LIB_LIBRARY_NAME. The library version is also a macro defined in the same library header: APP_LIB_LIBRARY_VERSION.
Example of opening a library:
name | Symbolic name of library, a macro in library header file |
version | Requested library version, a macro in library header file |