pw_protobuf: Fix function name typo
The WritePackedFixed64 function was incorrectly named (copypasta error).
Change-Id: Ia45f58389d1d0b01cbaadd7e1c5ed2fb6005e7ce
diff --git a/pw_protobuf/encoder_test.cc b/pw_protobuf/encoder_test.cc
index 259fd09..e812dca 100644
--- a/pw_protobuf/encoder_test.cc
+++ b/pw_protobuf/encoder_test.cc
@@ -317,9 +317,14 @@
constexpr uint32_t values[] = {0, 50, 100, 150, 200};
encoder.WritePackedFixed32(1, values);
+ // repeated fixed64 values64 = 2;
+ constexpr uint64_t values64[] = {0x0102030405060708};
+ encoder.WritePackedFixed64(2, values64);
+
constexpr uint8_t encoded_proto[] = {
0x0a, 0x14, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x64,
- 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00};
+ 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00,
+ 0x12, 0x08, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};
span<const std::byte> encoded;
EXPECT_EQ(encoder.Encode(&encoded), Status::OK);
diff --git a/pw_protobuf/public/pw_protobuf/encoder.h b/pw_protobuf/public/pw_protobuf/encoder.h
index 00020a5..84e8ee1 100644
--- a/pw_protobuf/public/pw_protobuf/encoder.h
+++ b/pw_protobuf/public/pw_protobuf/encoder.h
@@ -153,7 +153,7 @@
}
// Writes a repeated fixed64 field using packed encoding.
- Status WritePackedFixed32(uint32_t field_number,
+ Status WritePackedFixed64(uint32_t field_number,
span<const uint64_t> values) {
return WriteBytes(field_number, as_bytes(values));
}