Doxygen/Docbook Link Test
 All Data Structures Functions Variables Typedefs Modules Pages
config_app.h

Define application-specific configuration. More...

Data Structures

struct  CAppConfig
 

Macros

#define APP_HeapSize   65536
 
#define APP_HeapSize_   APP_HeapSize
 
#define INIT_DNS   1
 
#define INIT_DHCP   1
 
#define INIT_GATEWAY   1
 
#define STATIC_SERVER_IP_ADDRESS   IP_ADDRESS(192,168,0,2)
 
#define STATIC_SERVER_NETMASK   0xFFFFFF00UL
 
#define STATIC_DNS_SERVER_ADDRESS   IP_ADDRESS(8,8,8,8)
 
#define STATIC_IP_GATEWAY_ADDRESS   IP_ADDRESS(192,168,0,1)
 

Typedefs

typedef struct CAppConfig CAppConfig
 

Functions

CDataHubPoint * APP_CreateAndSetPoint (CTCPConnectionContainer *cc, CTCPClient *client, char *name, int flags, INT64 value)
 
void APP_SetPointInt (CDataHubPoint *point, INT64 value)
 
void APP_SetPointDouble (CDataHubPoint *point, double value)
 
void APP_SetPointString (CDataHubPoint *point, char *value)
 
void APP_ConfigureTimers (CAppConfig *config)
 
void APP_ConfigurePoints (CAppConfig *config)
 
void APP_ConfigureModbus (CAppConfig *config)
 
void APP_ConfigureUserThreads (CAppConfig *config)
 
void APP_InitializeConfig (CAppConfig *config)
 

Detailed Description

Define application-specific configuration.

This file contains a definition of the CAppConfig structure that is passed to the application-specific configuration functions during application start-up. You can modify the CAppConfig strucure to suit your application requirements.

Macro Definition Documentation

#define APP_HeapSize   65536

The APP_HeapSize is used to determine the amount of memory to reserve for user thread stacks, internal structures, inter-thread messages and #CDataHubPoint structures. You application will consume memory from this heap depending on the number of connections, threads, points and timers that are configured. During development you can look at the performance of the heap by examining the global variables #ME_Total, #ME_Hiwater, #ME_Nallocs, #ME_Nfrees, #ME_Nreallocs and #ME_Hiaddress.

Each user thread requires a stack whose size is defined by #ETK_THREAD_STACK_SIZE.

Each data point requires approximately 500 bytes. This varies with the length of the point name.

Each #CTimer requires approximately 80 bytes.

Each inter-thread message in flight requires 56 bytes, plus the length of a string if the message contains a point change notification for which the value is a string type.

We need to configure the heap size with a constant because we need to reserve heap early in the initialization process, before we have set the application configuration. This means that we cannot configure the application heap size dynamically from a configuration file.

With Renesas Synergy, you can override the default heap size in the properties list of the Skkynet ETK module.

#define APP_HeapSize_   APP_HeapSize

The number of bytes in the Skkynet ETK memory heap. See APP_HeapSize for more information.

#define INIT_DHCP   1

Allow the mainline to assign the IP address using DHCP

#define INIT_DNS   1

Allow the mainline to assign the DNS server

#define INIT_GATEWAY   1

Allow the mainline to assign the IP gateway

#define STATIC_DNS_SERVER_ADDRESS   IP_ADDRESS(8,8,8,8)

The DNS server address if DHCP is not enabled

#define STATIC_IP_GATEWAY_ADDRESS   IP_ADDRESS(192,168,0,1)

The gateway address if DHCP is not enabled

#define STATIC_SERVER_IP_ADDRESS   IP_ADDRESS(192,168,0,2)

The static IP address if DHCP is not enabled

#define STATIC_SERVER_NETMASK   0xFFFFFF00UL

The netmask if DHCP is not enabled

Typedef Documentation

typedef struct CAppConfig CAppConfig

Defines an application-specific structure containing information that is required during start-up. In the example code, this information is supplied in config_app.c. In other instances this information might be stored as persistent configuration in flash memory. An application developer should add or remove members in this structure to suit the application requirements.

Function Documentation

void APP_InitializeConfig ( CAppConfig config)

Initialize the application configuration object. This object must be allocated before entry to this function, and is typically created as a global static variable in the mainline_c mainline. You can modify this structure to suit your application requirements.

In the example code the contents of this object are hard-coded. In a production system you may prefer to store this information in persistent storage and then read it into the CAppConfig object here.

Parameters
config