1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 23:11:19 +01:00

Merge pull request #21587 from ML-PA-Consulting-GmbH/dl/riot/20250709__bump_nanopb

pkg/nanopb: support more recent google.protobuf versions
This commit is contained in:
crasbe 2025-07-10 11:18:17 +00:00 committed by GitHub
commit cfc66ee5b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 6 deletions

View File

@ -1,7 +1,6 @@
PKG_NAME=nanopb
PKG_URL=https://github.com/nanopb/nanopb
# 0.4.8
PKG_VERSION=6cfe48d6f1593f8fa5c0f90437f5e6522587745e
PKG_VERSION=nanopb-0.4.9.1
PKG_LICENSE=MIT
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -68,7 +68,7 @@ int main(void)
pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
/* Fill in the lucky number */
message.lucky_number = 13;
message.number = SimpleMessage_Enum_lucky;
/* Now we are ready to encode the message! */
status = pb_encode(&stream, SimpleMessage_fields, &message);
@ -106,7 +106,7 @@ int main(void)
}
/* Print the data contained in the message. */
printf("Your lucky number was %d!\n", (int)message.lucky_number);
printf("Your lucky number was %d!\n", (int)message.number);
}
return 0;

View File

@ -2,8 +2,11 @@
// one message.
syntax = "proto2";
import "nanopb.proto";
message SimpleMessage {
required int32 lucky_number = 1;
enum Enum {
lucky = 13;
};
optional Enum number = 1;
}