Skip to content

Commit 11c365f

Browse files
committed
Provide default settings for T1SMacSettings.
1 parent 550c930 commit 11c365f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

examples/UDP_Server/UDP_Server.ino

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@
1818
* CONSTANTS
1919
**************************************************************************************/
2020

21-
static uint8_t const T1S_PLCA_NODE_ID = 1;
22-
static bool const MAC_PROMISCUOUS_MODE = false;
23-
static bool const MAC_TX_CUT_THROUGH = false;
24-
static bool const MAC_RX_CUT_THROUGH = false;
21+
static uint8_t const T1S_PLCA_NODE_ID = 1;
2522

2623
static IPAddress const ip_addr {192, 168, 42, 100 + T1S_PLCA_NODE_ID};
2724
static IPAddress const network_mask{255, 255, 255, 0};
2825
static IPAddress const gateway {192, 168, 42, 100};
2926

3027
static T1SPlcaSettings const t1s_plca_settings{T1S_PLCA_NODE_ID};
31-
static T1SMacSettings const t1s_mac_settings{MAC_PROMISCUOUS_MODE, MAC_TX_CUT_THROUGH, MAC_RX_CUT_THROUGH};
28+
static T1SMacSettings const t1s_default_mac_settings;
3229

3330
static uint16_t const UDP_SERVER_LOCAL_PORT = 8888;
3431
static uint8_t * udp_rx_msg_buf[256] = {0};
@@ -90,7 +87,7 @@ void setup()
9087
, gateway
9188
, mac_addr
9289
, t1s_plca_settings
93-
, t1s_mac_settings))
90+
, t1s_default_mac_settings))
9491
{
9592
Serial.println("'TC6::begin(...)' failed.");
9693
for (;;) { }
@@ -100,7 +97,7 @@ void setup()
10097
Serial.println(ip_addr);
10198
Serial.println(mac_addr);
10299
Serial.println(t1s_plca_settings);
103-
Serial.println(t1s_mac_settings);
100+
Serial.println(t1s_default_mac_settings);
104101

105102
// If Power Provider, turn on LOCAL_ENABLE and turn on T1S_DISABLE
106103
//tc6_inst->digitalWrite(1,1,0);

src/T1SMacSettings.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ class T1SMacSettings
4444
bool const _mac_rx_cut_through;
4545

4646
public:
47+
static bool const DEFAULT_MAC_PROMISCUOUS_MODE = false;
48+
static bool const DEFAULT_MAC_TX_CUT_THROUGH = false;
49+
static bool const DEFAULT_MAC_RX_CUT_THROUGH = false;
50+
51+
52+
T1SMacSettings() : T1SMacSettings(DEFAULT_MAC_PROMISCUOUS_MODE, DEFAULT_MAC_TX_CUT_THROUGH, DEFAULT_MAC_RX_CUT_THROUGH) { }
4753
T1SMacSettings(bool const mac_promiscuous_mode,
4854
bool const mac_tx_cut_through,
4955
bool const mac_rx_cut_through);

0 commit comments

Comments
 (0)