hello_tutorial: Added RPC call to query session private _id.

This commit is contained in:
Michael Müller
2022-07-11 14:40:04 +02:00
parent b8f6e86fa3
commit 23b527ba85
4 changed files with 15 additions and 3 deletions

View File

@@ -37,6 +37,11 @@ struct Hello::Session_client : Genode::Rpc_client<Session>
{
return call<Rpc_add>(a, b);
}
unsigned short id() override
{
return call<Rpc_get_id>();
}
};
#endif /* _INCLUDE__HELLO_SESSION_H__CLIENT_H_ */

View File

@@ -28,7 +28,7 @@ struct Hello::Session : Genode::Session
virtual void say_hello() = 0;
virtual int add(int a, int b) = 0;
virtual unsigned short id() = 0;
/*******************
** RPC interface **
@@ -36,8 +36,9 @@ struct Hello::Session : Genode::Session
GENODE_RPC(Rpc_say_hello, void, say_hello);
GENODE_RPC(Rpc_add, int, add, int, int);
GENODE_RPC(Rpc_get_id, unsigned short, id);
GENODE_RPC_INTERFACE(Rpc_say_hello, Rpc_add);
GENODE_RPC_INTERFACE(Rpc_say_hello, Rpc_add, Rpc_get_id);
};
#endif /* _INCLUDE__HELLO_SESSION__HELLO_SESSION_H_ */