Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47ab7e0f authored by Ashutosh Joshi's avatar Ashutosh Joshi Committed by Android (Google) Code Review
Browse files

Merge "Add an identifier for the contexthub service endpoint."

parents 3881d936 9dc48d4f
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -73,6 +73,25 @@ $(GEN): $(LOCAL_PATH)/types.hal
	$(transform-generated-source)
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)
#
@@ -380,6 +399,25 @@ $(GEN): $(LOCAL_PATH)/types.hal
	$(transform-generated-source)
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)
#
+18 −3
Original line number Diff line number Diff line
@@ -30,6 +30,20 @@ enum NanoAppFlags : uint32_t {
    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"
@@ -118,6 +132,7 @@ struct ContextHub {

struct ContextHubMsg {
    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
};