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

Commit 5cd73904 authored by Tanmay Patil's avatar Tanmay Patil Committed by Android (Google) Code Review
Browse files

Merge changes from topic "UltrasonicsEVS"

* changes:
  Add VTS for Ultrasonics to EVS 1.1
  Adds default implementation for ultrasonics HAL
  Adds HAL for ultrasonics to EVS 1.1
parents e69d9393 d91f1c3e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ hidl_interface {
        "IEvsCameraStream.hal",
        "IEvsDisplay.hal",
        "IEvsEnumerator.hal",
        "IEvsUltrasonicsArray.hal",
        "IEvsUltrasonicsArrayStream.hal",
    ],
    interfaces: [
        "android.frameworks.automotive.display@1.0",
+31 −1
Original line number Diff line number Diff line
@@ -18,12 +18,13 @@ package android.hardware.automotive.evs@1.1;

import IEvsCamera;
import IEvsDisplay;
import IEvsUltrasonicsArray;
import @1.0::IEvsEnumerator;
import @1.0::EvsResult;
import android.hardware.camera.device@3.2::Stream;

/**
 * Provides the mechanism for EVS camera discovery
 * Provides the mechanism for EVS camera and ultrasonics array discovery
 */
interface IEvsEnumerator extends @1.0::IEvsEnumerator {
    /**
@@ -76,4 +77,33 @@ interface IEvsEnumerator extends @1.0::IEvsEnumerator {
     * @return display EvsDisplay object to be used.
     */
    openDisplay_1_1(uint8_t id) generates (IEvsDisplay display);

    /**
     * Returns a list of all ultrasonics array available to the system.
     * Will return an empty vector if ultrasonics is not supported.
     *
     * @return ultrasonicsArrays A list of ultrasonics available for EVS service.
     */
    getUltrasonicsArrayList() generates (vec<UltrasonicsArrayDesc> ultrasonicsArrays);

    /**
     * Gets the IEvsUltrasonicsArray associated with a ultrasonicsArrayId from a
     * UltrasonicsDataDesc
     *
     * @param  ultrasonicsArrayId  A unique identifier of the ultrasonic array.
     * @return evsUltrasonicsArray IEvsUltrasonicsArray object associated with a
     *                             given ultrasonicsArrayId.
     */
    openUltrasonicsArray(string ultrasonicsArrayId) generates (
            IEvsUltrasonicsArray evsUltrasonicsArray);

    /**
     * Return the specified IEvsUltrasonicsArray interface as no longer in use
     *
     * When the IEvsUltrasonicsArray object is no longer required, it must be released.
     * NOTE: Data streaming must be cleanly stopped before making this call.
     *
     * @param  evsUltrasonicsArray EvsUltrasonics array object to be closed.
     */
    closeUltrasonicsArray(IEvsUltrasonicsArray evsUltrasonicsArray);
};
+81 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.automotive.evs@1.1;

import @1.0::EvsResult;
import UltrasonicsArrayDesc;
import UltrasonicsDataFrameDesc;
import IEvsUltrasonicsArrayStream;

/**
 * HAL interface for ultrasonics sensor array.
 */
interface IEvsUltrasonicsArray {
   /**
    * Returns the ultrasonic sensor array information.
    *
    * @return  info  The description of this ultrasonic array. This must be the
    *                same value as reported by IEvsEnumerator::getUltrasonicsArrayList().
    */
   getUltrasonicArrayInfo() generates (UltrasonicsArrayDesc info);

   /**
    * Specifies the depth of the buffer chain the ultrasonic sensors is
    * asked to support.
    *
    * Up to this many data frames may be held concurrently by the client of IEvsUltrasonicsArray.
    * If this many frames have been delivered to the receiver without being returned
    * by doneWithFrame, the stream must skip frames until a buffer is returned for reuse.
    * It is legal for this call to come at any time, even while streams are already running,
    * in which case buffers should be added or removed from the chain as appropriate.
    * If no call is made to this entry point, the IEvsUltrasonicsArray must support at least one
    * data frame by default. More is acceptable.
    *
    * @param  bufferCount Number of buffers the client of
    *                     IEvsUltrasonicsArray may hold concurrently.
    * @return result      EvsResult::OK is returned if this call is successful.
    *                     Will return EvsResult::INVALID_ARG on invalid bufferCount.
    */
   setMaxFramesInFlight(uint32_t bufferCount) generates (EvsResult result);

   /**
    * Requests to start the stream.
    *
    * @param  stream Implementation of IEvsUltrasonicsArrayStream.
    * @return result EvsResult::OK is returned if this call is successful. Returns
    *                EvsResult::STREAM_ALREADY_RUNNING if stream is already running.
    */
   startStream(IEvsUltrasonicsArrayStream stream) generates (EvsResult result);

   /**
    * Requests to stop the delivery of the ultrasonic array data frames.
    *
    * Because delivery is asynchronous, frames may continue to arrive for
    * some time after this call returns. Each must be returned until the
    * closure of the stream is signaled to the IEvsCameraStream.
    * This function cannot fail and is ignored if the stream isn't running.
    */
   stopStream();

   /**
    * Notifies the UltrasonicsDataDesc is consumed that was received from
    * IEvsUltrasonicsArrayStream.
    *
    * @param  dataFrameDesc Ultrasonics data descriptor.
    */
    doneWithDataFrame(UltrasonicsDataFrameDesc dataFrameDesc);
};
+40 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.automotive.evs@1.1;

import UltrasonicsDataFrameDesc;
import @1.1::EvsEventDesc;

/**
 * Implemented on client side to receive asynchronous ultrasonic data
 * deliveries.
 */
interface IEvsUltrasonicsArrayStream {
   /**
    * Receives calls from the HAL each time a data frame is ready.
    *
    * @param dataFrameDesc Ultrasonic array data frame descriptor.
    */
    oneway deliverDataFrame(UltrasonicsDataFrameDesc dataFrameDesc);

    /**
     * Receives calls from the HAL each time an event happens.
     *
     * @param event Event EVS event with possible event information.
     */
    oneway notify(EvsEventDesc event);
};
+4 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ cc_binary {
        "EvsDisplay.cpp",
        "ConfigManager.cpp",
        "ConfigManagerUtil.cpp",
        "EvsUltrasonicsArray.cpp",
    ],
    init_rc: ["android.hardware.automotive.evs@1.1-service.rc"],

@@ -17,11 +18,14 @@ cc_binary {
        "android.hardware.automotive.evs@1.0",
        "android.hardware.automotive.evs@1.1",
        "android.hardware.camera.device@3.3",
        "android.hidl.allocator@1.0",
        "android.hidl.memory@1.0",
        "libbase",
        "libbinder",
        "liblog",
        "libhardware",
        "libhidlbase",
        "libhidlmemory",
        "liblog",
        "libui",
        "libutils",
Loading