继承关系:

  纯C++binder服务和客户端实例

文件关系

纯C++binder服务和客户端实例

IHelloService.h

 1 /* 参考: frameworks\av\include\media\IMediaPlayerService.h */
 2 
 3 #ifndef ANDROID_IHELLOERVICE_H
 4 #define ANDROID_IHELLOERVICE_H
 5 
 6 #include <utils/Errors.h>  // for status_t
 7 #include <utils/KeyedVector.h>
 8 #include <utils/RefBase.h>
 9 #include <utils/String8.h>
10 #include <binder/IInterface.h>
11 #include <binder/Parcel.h>
12 
13 #define HELLO_SVR_CMD_SAYHELLO     0
14 #define HELLO_SVR_CMD_SAYHELLO_TO  1
15 
16 namespace android {
17 
18 class IHelloService: public IInterface
19 {
20 public:
21     DECLARE_META_INTERFACE(HelloService);
22     virtual void sayhello(void) = 0;
23     virtual int sayhello_to(const char *name) = 0;
24 };
25 
26 class BnHelloService: public BnInterface<IHelloService>
27 {
28 public:
29     virtual status_t    onTransact( uint32_t code,
30                                     const Parcel& data,
31                                     Parcel* reply,
32                                     uint32_t flags = 0);
33 
34     virtual void sayhello(void);
35     virtual int sayhello_to(const char *name);
36 };
37 }
38 
39 #endif
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
猜你喜欢
  • 2021-12-07
  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-21
相关资源
相似解决方案