Please help
I'm learning to use nanopb in stm32
I find some examples from website and complie them in keil
there are some error about pb_callback_t
for example
static bool courseScoreEncode(pb_ostream_t* stream, const pb_field_t* field, void* const* arg){
StudentInfo *studentInfo=(StudentInfo *)*arg;
CourseScore stuCourseScore;
for(int i=0;i<studentInfo->realCourseNum;i++){
//error:passing 'pb_callback_t'(aka 'struct pb_callback_s') to parameter of incompatible type 'char * '
strcpy(stuCourseScore.coursename,studentInfo->coursescores[i].coursename);
stuCourseScore.score=studentInfo->coursescores[i].score;
if (!pb_encode_tag_for_field(stream, field)) {
return false;
}
if (!pb_encode_submessage(stream, CourseScore_fields, &stuCourseScore)) {
return false;
}
}
return true;
}
proto:
syntax = "proto3";
//import "nanopb.proto";
message CourseScore{
string coursename = 1;
uint32 score = 2;
}
message Student
{
string name = 1;
uint32 studentid = 2;
string phonenum = 3;
repeated CourseScore coursescores = 4;
}
thank you for your help