where is the interface header file of HIDL in AOSP?

Viewed 1526

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();
2 Answers

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

Related