Reputation: 345
I am trying to update the Android BluetoothChat example's code to use Protobuf for more structured data exchange. I also need byte[] array fields to send arbitrary data like an image byte array but on trying to compile the .proto file, I get the below error.
protofiles/bluetoothmessage.proto:8:18: Expected field name.
Below is my .proto file.
package bluetoothmessage;
option java_package = "com.example.bluetoothexample";
option java_outer_classname = "ProtocolBuffers";
message BTMessage {
required int32 cmd = 1;
optional byte[] appData = 2;
}
A couple of other posts on stackoverflow mentioned that byte[] can be used as a filed and the below page also says the same thing.
https://developers.google.com/protocol-buffers/docs/proto#scalar
Any help is much appreciated! Thanks!!
Upvotes: 2
Views: 1613