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

Commit 9dc48d4f authored by Ashutosh Joshi's avatar Ashutosh Joshi
Browse files

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
parent 2cfe8fcb
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
};