NetBurner 3.5.8
PDF Version
Toggle main menu visibility
serial/SerialBurner/src/nvsettings.h
1
/*NB_REVISION*/
2
3
/*NB_COPYRIGHT*/
4
5
#ifndef _NVSETTINGS_H_
6
#define _NVSETTINGS_H_
7
8
#include <config_server.h>
9
10
#define SETTINGS_KEY (0x48666050)
// Flash memory configuration key code
11
12
#define DATA_SERIAL_PORT (1)
13
14
/* Debug Notes:
15
Debug/informational messages can be sent to the DATA_SERIAL_PORT or to
16
the DEBUG_SERIAL_PORT.
17
- To send debug messages out the debug serial port, set DEBUG_SERIAL_PORT
18
to 0 or 1; whatever port is not the data port.
19
- To send debug messages out the same port as the data port, set
20
DEBUG_SERIAL_PORT to -1.
21
- To send debug messages in either of the above cases, you must also set DEBUG to 1.
22
*/
23
#define DEBUG_SERIAL_PORT (0)
24
#define DEBUG (1)
// 1 = allocate a debug port, 0 = no debug port
25
26
#define DEF_DATA_BAUDRATE (115200)
27
#define STOP_BITS (1)
28
#define DATA_BITS (8)
29
30
#define SERIAL_FLOWCONTROL_NONE (0)
31
#define SERIAL_FLOWCONTROL_SOFTWARE (1)
32
#define SERIAL_FLOWCONTROL_HARDWARE (2)
33
34
#define TELNET_PORT (23)
35
#define DEF_SERVER_LISTEN_PORT (TELNET_PORT)
36
#define DEF_CLIENT_OVERRIDE_TIMEOUT (20)
37
38
/*
39
* The default number of seconds between receiving TCP chars before a timeout occurs.
40
* The system default timeout, TCP_WRITE_TIMEOUT, is 10 seconds, which is the minimum
41
* timeout value. A timeout value of 0 will disable the timeout feature.
42
* */
43
#define DEF_CLIENT_TIMEOUT (60)
// TCP inactivity timeout in seconds
44
45
/* If a new client TCP connection is attempted while one is active,
46
* one of the following three actions can be taken:
47
* a) Ignore the incoming connection. Leave current connection active.
48
* (set override timeout to 0xFFFFFFFF)
49
* b) Replace the existing connection if it has been idle for a specified number of seconds.
50
* (set override to the number of seconds to wait)
51
* c) Always replace the existing connection.
52
* (set override to 0 seconds)
53
*/
54
#define DEF_CLIENT_OVERRIDE_TIMEOUT (20)
// TCP connection override in seconds
55
56
/*
57
* The use of config objects should be done at a global scope. Config objects can contain any number of members,
58
* each of which should be given a default value and a name used as an identifier. The name value for each
59
* member variable should be unique, otherwise it can lead to issues inside the config tree.
60
*/
61
class
classSerialSettings :
public
config_obj
62
{
63
public
:
64
config_uint m_SettingsKey{SETTINGS_KEY,
"Flash record verify key"
};
65
config_uint m_ServerListenPort{DEF_SERVER_LISTEN_PORT,
"Server Listen Port"
};
66
config_uint m_ClientTimeout{DEF_CLIENT_TIMEOUT,
"Client inactivity TCP timeout"
};
67
config_uint m_ClientOverrideTimeout{DEF_CLIENT_OVERRIDE_TIMEOUT,
"Timeout to allow new TCP connections"
};
68
config_chooser m_DataBaudRate{
"BaudRate"
,
"115200"
,
"9600,19200,38400,57600,115200,23400"
};
69
70
ConfigEndMarker;
// No new data members below this line
71
72
classSerialSettings(
const
char
*name,
const
char
*desc =
nullptr
) : config_obj(name, desc){};
73
classSerialSettings(config_obj &owner,
const
char
*name,
const
char
*desc =
nullptr
) : config_obj(owner, name, desc){};
74
};
75
76
#endif
config_obj
Base class used to create configuration objects.
Definition
config_obj.h:323
examples
serial
SerialBurner
src
nvsettings.h
Generated by
1.18.0