Skip to content

Commit 4a50390

Browse files
committed
fix lint errors
1 parent b7b3d48 commit 4a50390

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

src/viam/sdk/components/board.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ API API::traits<Board>::api() {
2323
Board::status Board::from_proto(const viam::component::board::v1::Status& proto) {
2424
Board::status status;
2525
for (const auto& analog : proto.analogs()) {
26-
Board::analog_value result;
27-
result.value = analog.second;
28-
// The status does not contain the extra data to describe the accuracy of the reader. We
29-
// fill those in with 0's instead.
30-
result.min_range = 0.0;
31-
result.max_range = 0.0;
32-
result.step_size = 0.0;
26+
Board::analog_value result;
27+
result.value = analog.second;
28+
// The status does not contain the extra data to describe the accuracy of the reader. We
29+
// fill those in with 0's instead.
30+
result.min_range = 0.0;
31+
result.max_range = 0.0;
32+
result.step_size = 0.0;
3333
status.analog_reader_values.emplace(analog.first, result);
3434
}
3535
for (const auto& digital : proto.digital_interrupts()) {
@@ -88,10 +88,8 @@ bool operator==(const Board::status& lhs, const Board::status& rhs) {
8888
}
8989

9090
bool operator==(const Board::analog_value& lhs, const Board::analog_value& rhs) {
91-
return (lhs.value == rhs.value &&
92-
lhs.min_range == rhs.min_range &&
93-
lhs.max_range == rhs.max_range &&
94-
lhs.step_size == rhs.step_size);
91+
return (lhs.value == rhs.value && lhs.min_range == rhs.min_range &&
92+
lhs.max_range == rhs.max_range && lhs.step_size == rhs.step_size);
9593
}
9694

9795
} // namespace sdk

src/viam/sdk/components/board.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class Board : public Component {
2727
public:
2828
/// @brief Represents the value received by the registered analog to digital converter (ADC).
2929
/// The range and conversion mechanism to voltage will vary depending on the specific ADC
30-
/// registered to the pin, though the min and max voltages and step_size can often help with
31-
/// this conversion. Consult your ADC's documentation and Viam's `Board` documentation for
30+
/// registered to the pin, though the min and max voltages and step_size can often help with
31+
/// this conversion. Consult your ADC's documentation and Viam's `Board` documentation for
3232
/// more details.
3333
struct analog_value {
34-
int32_t value;
35-
float min_range; // Minimum possible voltage read by the analog reader
36-
float max_range; // Maximum possible voltage read by the analog reader
37-
float step_size; // Volts represented in each step in the value
38-
};
34+
int32_t value;
35+
float min_range; // Minimum possible voltage read by the analog reader
36+
float max_range; // Maximum possible voltage read by the analog reader
37+
float step_size; // Volts represented in each step in the value
38+
};
3939

4040
/// @brief Depending on the type of digital interrupt, this can have different meanings. If a
4141
/// `basic` (default) interrupt is configured, then this is the total interrupt count. If a

src/viam/sdk/components/private/board_client.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ Board::analog_value BoardClient::read_analog(const std::string& analog_reader_na
9999
if (!status.ok()) {
100100
throw GRPCException(status);
101101
}
102-
Board::analog_value result = {};
103-
result.value = response.value();
104-
result.min_range = response.min_range();
105-
result.max_range = response.max_range();
106-
result.step_size = response.step_size();
102+
Board::analog_value result = {};
103+
result.value = response.value();
104+
result.min_range = response.min_range();
105+
result.max_range = response.max_range();
106+
result.step_size = response.step_size();
107107
return result;
108108
}
109109

src/viam/sdk/tests/test_board.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ BOOST_AUTO_TEST_CASE(test_do_command) {
107107
BOOST_AUTO_TEST_CASE(test_read_analog) {
108108
const auto mock = std::make_shared<MockBoard>("mock_board");
109109
client_to_mock_pipeline<Board>(mock, [&](Board& client) {
110-
sdk::Board::analog_value expected_result;
111-
expected_result.value = 5150;
112-
expected_result.min_range = 1.0;
113-
expected_result.max_range = 5.0;
114-
expected_result.step_size = 0.01;
110+
sdk::Board::analog_value expected_result;
111+
expected_result.value = 5150;
112+
expected_result.min_range = 1.0;
113+
expected_result.max_range = 5.0;
114+
expected_result.step_size = 0.01;
115115
mock->peek_read_analog_ret = expected_result;
116-
sdk::Board::analog_value result = client.read_analog("t1");
116+
sdk::Board::analog_value result = client.read_analog("t1");
117117
BOOST_CHECK_EQUAL(expected_result.value, result.value);
118118
BOOST_CHECK_EQUAL(expected_result.min_range, result.min_range);
119119
BOOST_CHECK_EQUAL(expected_result.max_range, result.max_range);

0 commit comments

Comments
 (0)