How to convert Empty protocol buffer message into data in swift?

291 views Asked by At

I am using Google Protocol buffer of type proto2 syntax.I have implemented SwiftProtobuf for this.Below is my library.

pod 'SwiftProtobuf'

Now I want to send one empty message request to BLE in Data format. When I convert my request to data it is of 0 bytes.

Below is my code

var  data = try  message().infoRequest.serializedData()
// Method 1 - Without partial

var  data = try  message().infoRequest.serializedData(partial:true/false)
// Method 2 - With partial

How can I send Empty message type to BLE ?

Kindly Help

0

There are 0 answers