-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcan_network_configuration.cpp
70 lines (58 loc) · 2.14 KB
/
can_network_configuration.cpp
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//================================================================================================
/// @file can_network_configuration.cpp
///
/// @brief This is a class for changing stack settings.
/// @author Adrian Del Grosso
///
/// @copyright 2022 The Open-Agriculture Developers
//================================================================================================
#include "can_network_configuration.hpp"
namespace isobus
{
void CANNetworkConfiguration::set_max_number_transport_protocol_sessions(std::uint32_t value)
{
maxNumberTransportProtocolSessions = value;
}
std::uint32_t CANNetworkConfiguration::get_max_number_transport_protocol_sessions() const
{
return maxNumberTransportProtocolSessions;
}
void CANNetworkConfiguration::set_minimum_time_between_transport_protocol_bam_frames(std::uint32_t value)
{
constexpr std::uint32_t MAX_BAM_FRAME_DELAY_MS = 200;
constexpr std::uint32_t MIN_BAM_FRAME_DELAY_MS = 10;
if ((value <= MAX_BAM_FRAME_DELAY_MS) &&
(value >= MIN_BAM_FRAME_DELAY_MS))
{
minimumTimeBetweenTransportProtocolBAMFrames = value;
}
}
std::uint32_t CANNetworkConfiguration::get_minimum_time_between_transport_protocol_bam_frames() const
{
return minimumTimeBetweenTransportProtocolBAMFrames;
}
void CANNetworkConfiguration::set_number_of_packets_per_dpo_message(std::uint8_t numberFrames)
{
numberOfPacketsPerDPOMessage = numberFrames;
}
std::uint8_t CANNetworkConfiguration::get_number_of_packets_per_dpo_message() const
{
return numberOfPacketsPerDPOMessage;
}
void CANNetworkConfiguration::set_max_number_of_network_manager_protocol_frames_per_update(std::uint8_t numberFrames)
{
networkManagerMaxFramesToSendPerUpdate = numberFrames;
}
std::uint8_t CANNetworkConfiguration::get_max_number_of_network_manager_protocol_frames_per_update() const
{
return networkManagerMaxFramesToSendPerUpdate;
}
void CANNetworkConfiguration::set_number_of_packets_per_cts_message(std::uint8_t numberFrames)
{
numberOfPacketsPerCTSMessage = numberFrames;
}
std::uint8_t CANNetworkConfiguration::get_number_of_packets_per_cts_message() const
{
return numberOfPacketsPerCTSMessage;
}
}