Add an identifier for the contexthub service endpoint.
Add a parameter that identifies the endpoint for the context hub service
end point. This represents a client at the Android API interface.
Test: Update makefiles.
Change-Id: Ib63c7b71dd70803c87f544643cf6a6f2666c7a31
diff --git a/contexthub/1.0/Android.mk b/contexthub/1.0/Android.mk
index 1286e66..c73c5c4 100644
--- a/contexthub/1.0/Android.mk
+++ b/contexthub/1.0/Android.mk
@@ -74,6 +74,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (HostEndPoint)
+#
+GEN := $(intermediates)/android/hardware/contexthub/V1_0/HostEndPoint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.contexthub@1.0::types.HostEndPoint
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (HubAppInfo)
#
GEN := $(intermediates)/android/hardware/contexthub/V1_0/HubAppInfo.java
@@ -381,6 +400,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (HostEndPoint)
+#
+GEN := $(intermediates)/android/hardware/contexthub/V1_0/HostEndPoint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.contexthub@1.0::types.HostEndPoint
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (HubAppInfo)
#
GEN := $(intermediates)/android/hardware/contexthub/V1_0/HubAppInfo.java
diff --git a/contexthub/1.0/types.hal b/contexthub/1.0/types.hal
index 2a58c0b..d7e5673 100644
--- a/contexthub/1.0/types.hal
+++ b/contexthub/1.0/types.hal
@@ -30,6 +30,20 @@
ENCRYPTED = (1<<1),// Encrypted nanoapp
};
+enum HostEndPoint : uint16_t {
+ BROADCAST = 0xFFFF, // The message endpoint is a broadcast end point.
+ // This value must never be used for a message from
+ // the host to the hub.
+ // If BROADCAST is specified as a destination for a
+ // message from the context hub to the ContextHub
+ // service, the message must be broadcast to all
+ // registered clients by the Context Hub service.
+ UNSPECIFIED = 0xFFFE, // The message endpoint is unspecified. This value
+ // must not be used for messages from the hub to host.
+ // This value may be used for messages from the host
+ // to the hub.
+};
+
struct NanoAppBinary {
uint32_t headerVersion; // 0x1 for this version
uint32_t magic; // "NANO"
@@ -117,9 +131,10 @@
};
struct ContextHubMsg {
- uint64_t appName; // Intended recipient (appId)
- uint32_t msgType; // Identifier for message
- vec<uint8_t> msg; // Message body
+ uint64_t appName; // Intended recipient (appId)
+ uint16_t hostEndPoint; // identifier for the endpoint. (also see enum HostEndPoint)
+ uint32_t msgType; // Identifier for message
+ vec<uint8_t> msg; // Message body
};
enum HubMemoryType : uint32_t {