About gRPC
gRPC is a Google defined protocol for remote procedure calls. It is the recommended RPC to use.
This project generates the server and client gRPC messaging protocols for other projects to use. Two protocol files are defined - ant_radio.proto and ant_channel.proto. These are compiled by the protobuf compiler into C# classes, yielding source files for clients and servers, which in turn are compiled into the AntGrpcShared class library.
Servers/services will derive from gRPCAntRadio.gRPCAntRadioBase and gRPCAntChannel.gRPCAntChannelBase. See the AntGrpcService project for an example of how to implement these services.
Clients will use the AntRadioService and AntChannelService classes to communicate with the server. These classes are defined in the AntGrpcShared.ClientServices namespace. These classes greatly simplify integration of ANT gRPC into client-side applications. Reference this project or copy the assembly into your client application to use these classes.
The AntRadioService implements IAntRadio and provides services for managing the ANT radio server. It extends IAntRadio with a method, FindAntRadioServerAsync, to find and connect to the server. It also exposes the server IP address property.
The AntRadioService class is currently configured to use the multicast address 239.55.43.6, port 55437 for server discovery. The server must be running on the same subnet as the client for discovery to work. The gRPC channel is created using the server IP address and port number 5073. This matches the gRPC server configuration implemented in the AntGrpcService project.
The AntChannelService implements IAntChannel and provides services for managing the ANT radio server channels. It extends IAntChannel with a method, HandleChannelResponseUpdates, which subscribes to and handles channel response updates.