27 #ifndef Dynamic_LIBRARIES_INC_OC_Dynamic_CFG_H_ 28 #define Dynamic_LIBRARIES_INC_OC_Dynamic_CFG_H_ 32 #include <oc_errors.h> 42 #define _________________________________________DEFINITIONS_SECTION________________________________________________________________________ 50 #define oC_CONFIGURATIONS_MODULES_LIST(ADD,DONT_ADD) \ 52 ADD( ExcHan , "Exception Handler" )\ 53 ADD( Telnet , "Telnet" )\ 63 #define oC_CONFIGURATIONS_LIST(ADD,DONT_ADD) \ 64 ADD( Tcp , oC_MemorySize_t , StackSize , B(8096) , "Stack Size" , "Default size of the stack for TCP server threads " )\ 65 ADD( Tcp , uint16_t , WindowSize , B(1500) , "Window Size" , "Default size of the window for new TCP connections" )\ 66 ADD( Tcp , uint8_t , WindowScale , 0 , "Window Scale" , "Default scale of the window for new TCP connections" )\ 67 ADD( Tcp , oC_Time_t , ConfirmationTimeout , ms(500) , "Confirmation Timeout" , "Maximum time for the confirmation before retransmission of a packet" )\ 68 ADD( Tcp , oC_Time_t , WaitForConnectionTimeout , day(1) , "WfC Timeout" , "Maximum time to wait for new connection" )\ 69 ADD( Tcp , oC_Time_t , DeleteConnectionTimeout , day(1) , "Delete Connection Timeout" , "Maximum time for deleting connections" )\ 70 ADD( Tcp , oC_Time_t , DecisionTimeout , s(1) , "Decision Timeout" , "Maximum time for making decision about accepting connection" )\ 71 ADD( Tcp , oC_Time_t , AcceptConnectionTimeout , s(1) , "Accept Connection Timeout" , "Maximum time for accepting connections" )\ 72 ADD( Tcp , oC_Time_t , RejectConnectionTimeout , ms(500) , "Reject Connection Timeout" , "Maximum time for rejecting connections" )\ 73 ADD( Tcp , oC_Time_t , ExpirationTimeout , min(10) , "Expiration Timeout" , "Maximum time without receiving packets" )\ 74 ADD( Tcp , oC_Time_t , SendingAcknowledgeTimeout , ms(0) , "Sending ACK Timeout" , "Maximum time to wait for sending ACK message" )\ 75 ADD( Tcp , oC_Time_t , ReadSegmentTimeout , ms(500) , "Read Segment Timeout" , "Maximum time to wait for an app to read a received segment" )\ 76 ADD( Tcp , oC_Time_t , ReceiveTimeout , ms(500) , "Receive Timeout" , "Maximum time to wait for a packet before checking expiration timeout" )\ 77 ADD( Tcp , uint32_t , InitialSequenceNumber , 0 , "ISN" , "Initial Sequence Number for new connections" )\ 78 ADD( Tcp , oC_MemorySize_t , PacketSize , B(1024) , "Packet Size" , "Size of a packet used for sending data" )\ 79 ADD( ExcHan, oC_Time_t , MemoryEventsLoggingPeriod , min(1) , "Memory events logging period", "Minimum time to elapse before logging again an event" )\ 80 ADD( Telnet, uint32_t , MaxConnections , 5 , "Max Connections" , "Maximum number of connections over Telnet" )\ 81 ADD( Telnet, oC_Time_t , StartServerTimeout , s(3) , "Start Server Timeout" , "Maximum time for starting the Telnet server" )\ 82 ADD( Telnet, oC_Time_t , StopServerTimeout , s(3) , "Stop Server Timeout" , "Maximum time for stopping the Telnet server" )\ 83 ADD( Telnet, oC_Time_t , DisconnectTimeout , ms(500) , "Disconnect Timeout" , "Maximum time for disconnecting telnet connection" )\ 84 ADD( Telnet, oC_Time_t , NaglePeriod , ms(50) , "Nagle Period" , "Period of buffering according to the Nagle's Algorithm" )\ 85 ADD( Telnet, oC_Time_t , NagleMaximumInactiveTime , ms(500) , "Max Nagle Inactive Time" , "Maximum time to wait when Nagle's thread is inactive" )\ 86 ADD( Telnet, oC_Time_t , NagleSendingTimeout , ms(200) , "Nagle Sending Timeout" , "Maximum time for TCP transmission" )\ 87 ADD( Telnet, oC_MemorySize_t , NagleBufferSize , B(1024) , "Nagle Buffer Size" , "Size of the buffer allocated for the Nagle's Algorithm" )\ 88 ADD( Telnet, oC_MemorySize_t , NagleThreadStackSize , B(2048) , "Nagle Thread Stack Size" , "Size of the stack of the Nagle's Algorithm thread" )\ 90 #undef _________________________________________DEFINITIONS_SECTION________________________________________________________________________ 97 #define _________________________________________TYPES_SECTION______________________________________________________________________________ 104 #define oC_DynamicConfig_Module_( MODULE_NAME ) oC_1WORD_FROM_2( oC_DynamicConfig_Module_, MODULE_NAME ) 113 #define ADD( MODULE_NAME, FRIENDLY_STRING ) oC_DynamicConfig_Module_( MODULE_NAME ) , 114 #define DONT_ADD(...) 130 #define ADD( MODULE_NAME, TYPE , VARIABLE_NAME, DEFAULT_VALUE, FRIENDLY_NAME, BRIEF ) \ 131 oC_1WORD_FROM_4( oC_DynamicConfig_VariableId_, MODULE_NAME , _ , VARIABLE_NAME ) , 132 #define DONT_ADD(...) 136 oC_DynamicConfig_VariableId_NumberOfElements
160 #undef _________________________________________TYPES_SECTION______________________________________________________________________________ 167 #define _________________________________________VARIABLES_SECTION__________________________________________________________________________ 169 #define DYNAMIC_CONFIG_MAKE_VARIABLE_NAME(MODULE_NAME,VARIABLE_NAME) oC_1WORD_FROM_4(oC_DynamicConfig_, MODULE_NAME, _ , VARIABLE_NAME) 174 #define ADD( MODULE_NAME, TYPE , VARIABLE_NAME, DEFAULT_VALUE, FRIENDLY_NAME, BRIEF ) \ 175 extern TYPE DYNAMIC_CONFIG_MAKE_VARIABLE_NAME(MODULE_NAME, VARIABLE_NAME); 176 #define DONT_ADD(...) 189 #undef _________________________________________VARIABLES_SECTION__________________________________________________________________________ 196 #define _________________________________________INTERFACE_SECTION__________________________________________________________________________ 198 #define oC_DynamicConfig_SetValue( MODULE_NAME, VARIABLE_NAME, VALUE ) DYNAMIC_CONFIG_MAKE_VARIABLE_NAME( MODULE_NAME, VARIABLE_NAME ) = VALUE 199 #define oC_DynamicConfig_GetValue( MODULE_NAME, VARIABLE_NAME ) DYNAMIC_CONFIG_MAKE_VARIABLE_NAME( MODULE_NAME, VARIABLE_NAME ) 201 #undef _________________________________________INTERFACE_SECTION__________________________________________________________________________ Contains macros for creating one word from more words in macros.
const char * TypeName
Name of the type.
The file with interface for the GPIO driver.
stores configuration data
#define oC_CONFIGURATIONS_LIST(ADD, DONT_ADD)
The library with time definitions.
#define oC_CONFIGURATIONS_MODULES_LIST(ADD, DONT_ADD)
Helper macros for configurations files.
oC_DynamicConfig_Module_t Module
Module associated with the variable.
const char * FriendlyName
Friendly name of the variable.
oC_MemorySize_t TypeSize
Size of the type.
const char * Brief
Quick description of the variable.
oC_DynamicConfig_VariableId_t
stores ID of the configuration variable
const char * VariableName
Name of the variable that stores the configuration.
oC_DynamicConfig_VariableDetails_t oC_DynamicConfig_VariablesDetails[oC_DynamicConfig_VariableId_NumberOfElements]
array with definitions of variables details
void * ValueReference
Pointer to the variable that stores the configuration.
oC_DynamicConfig_Module_t
stores configuration module ID