3

I studied the HIDL using Nfc code in AOSP .

As i know, when INfc.hal is compiled, INfc.h is autogenerated like following picture. enter image description here

In NxpService.cpp, there is code like following

#include <android/hardware/nfc/1.1/INfc.h>

But, I couldn't find that path. where is the real path of android/hardware/nfc/1.1/INfc.h?

In addition, I became curious how gcc compile works in NxpService.cpp that uses INfc.h. Could you explain how gcc compiler can find INfc.h and work without compile error?

INfc.hal Path: /hardware/interfaces/nfc/1.1/INfc.hal

Android.bp

hidl_interface {
name: "android.hardware.nfc@1.1",
root: "android.hardware",

NxpService.cpp Path: /hardware/nxp/nfc/1.1/NxpService.cpp

#include <android/hardware/nfc/1.1/INfc.h>  
...
int main(){
sp<INfc> nfc_service = new Nfc();
status_t status = nfc_service->registerAsService();
bongsu
  • 185
  • 2
  • 9
  • What are you actually trying to do here? Find the file to examine it? Just search for it. Or learn how to set compiler flags when building your project and accomplish the equivalent of this method of getting the compiler to output such information: https://stackoverflow.com/questions/11946294/dump-include-paths-from-g – Chris Stratton Jan 06 '19 at 08:00

2 Answers2

1

android.hardware.nfc@1.1 would be at hardware/interfaces/nfc/1.1/ here.

The mappings for Android provided interfaces to their actual location are shown here https://source.android.com/devices/architecture/hidl/interfaces.

Neel Mehta
  • 106
  • 2
0

The files you look for are all auto-generated by hidl-gen, and they usually locate in out directory, e.g.

$ANDROID_ROOT/out/soong/.intermediates/hardware/interfaces/nfc/1.1/android.hardware.nfc@1.1_genc++_headers/gen/android/hardware/nfc/1.1

tonykwok
  • 371
  • 2
  • 10