The generated Proxy/Skeleton API provides the abstract base classes to implement the service skeleton:
- Open the folder you defined as
SRC_GEN_DIR
. - Go to the relevant skeleton classes for your executable.
- Find the class your skeleton should inherit from.
- In your application create a class that inherits from the skeleton class.
Example Code
// class declaration in header file
class PPortExampleServiceProvider : public services::exampleservice::skeleton::ExampleServiceSkeleton {..}
// main cpp file
PPortExampleServiceProvider::PPortExampleServiceProvider(ara::core::InstanceSpecifier instance_specifier)
:services::exampleservice::skeleton::ExampleServiceSkeleton(instance_specifier) {…}
Offer/Stop a Service
The service must be instantiated with a corresponding InstanceSpecifier and then offered on the server side using OfferService(). To stop the service, StopOfferService() can be called.
Update Values
On the server side, a callback is defined to handle updates from clients (RegisterSetHandler()), and an update method (Update()) is called to publish new values to clients.