Create a message descriptor type.

This replaces the sentinel at the end of the pb_field_t
array for each message type.

git-svn-id: https://svn.kapsi.fi/jpa/nanopb-dev@1007 e3a754e5-d11d-0410-8d38-ebb782a927b9
This commit is contained in:
Michael Poole
2011-11-13 18:10:11 +00:00
committed by Petteri Aimonen
parent dcf43a6416
commit 43b8e20744
17 changed files with 127 additions and 101 deletions

View File

@@ -53,7 +53,7 @@ void handle_connection(int connfd)
pb_ostream_t output = pb_ostream_from_socket(connfd);
DIR *directory;
if (!pb_decode(&input, ListFilesRequest_fields, &request))
if (!pb_decode(&input, ListFilesRequest_msg, &request))
{
printf("Decoding failed.\n");
return;
@@ -78,7 +78,7 @@ void handle_connection(int connfd)
response.file.arg = directory;
}
if (!pb_encode(&output, ListFilesResponse_fields, &response))
if (!pb_encode(&output, ListFilesResponse_msg, &response))
{
printf("Encoding failed.\n");
}