-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathT1SPlcaSettings.h
56 lines (43 loc) · 1.8 KB
/
T1SPlcaSettings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* This file is part of the Arduino_10BASE_T1S library.
*
* Copyright (c) 2024 Arduino SA
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <stdint.h>
#include <Print.h>
#include <Printable.h>
/**************************************************************************************
* CLASS DECLARATION
**************************************************************************************/
class T1SPlcaSettings : public arduino::Printable
{
private:
uint8_t _node_id;
uint8_t _node_count;
uint8_t _burst_count;
uint8_t _burst_timer;
public:
static uint8_t const DEFAULT_NODE_ID = 0;
static uint8_t const DEFAULT_NODE_COUNT = 8;
static uint8_t const DEFAULT_BURST_COUNT = 0;
static uint8_t const DEFAULT_BURST_TIMER = 128;
T1SPlcaSettings() : T1SPlcaSettings(DEFAULT_NODE_ID, DEFAULT_NODE_COUNT, DEFAULT_BURST_COUNT, DEFAULT_BURST_TIMER) { }
T1SPlcaSettings(uint8_t const node_id) : T1SPlcaSettings(node_id, DEFAULT_NODE_COUNT, DEFAULT_BURST_COUNT, DEFAULT_BURST_TIMER) { }
T1SPlcaSettings(uint8_t const node_id,
uint8_t const node_count,
uint8_t const burst_count,
uint8_t const burst_timer);
virtual size_t printTo(Print & p) const override;
uint8_t nodeId() const { return _node_id; }
uint8_t nodeCount() const { return _node_count; }
uint8_t burstCount() const { return _burst_count; }
uint8_t burstTimer() const { return _burst_timer; }
};