When I encode my request with nanopb, every byte is exactly the same apart from the last 2, in this case they are '4a' and '00'. I cannot see what they are meant to represent, or where they come from.
The code I use after generating my headers with nanopb's generators to make my request is as follows:
rustplus_AppRequest appRequest = rustplus_AppRequest_init_zero;
appRequest.seq = 0;
appRequest.playerId=76561197960831194;
appRequest.playerToken=-1482706676;
rustplus_AppEmpty appEmpty = rustplus_AppEmpty_init_zero;
appRequest.getTime =appEmpty;
appRequest.has_entityId = true;
uint8_t buffer[25];
/* Create a stream that will write to our buffer. */
pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
/* Now we are ready to encode the message! */
status = pb_encode(&stream, rustplus_AppRequest_fields, &appRequest);
message_length = stream.bytes_written;
/* Then just check for any errors.. */
if (!status)
{
Serial.printf("Encoding failed: %s\n", PB_GET_ERROR(&stream));
Serial.println();
}else{
Serial.printf("Encoding of %i bytes complete",message_length);
}
b.length = message_length;
b.memory = buffer;