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

Commit 6165b42a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "remove the Thread Network HAL from the stage folder" into udc-dev-plus-aosp

parents 16a5725b 1f6989f5
Loading
Loading
Loading
Loading

staging/threadnetwork/OWNERS

deleted100644 → 0
+0 −5
Original line number Diff line number Diff line
# Bug component: 1203089

wgtdkp@google.com
xyk@google.com
zhanglongxia@google.com

staging/threadnetwork/README.md

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
# Staging threadnetwork HAL interface

The directory includes the unstable/unreleased version of `hardware/interfaces/threadnetwork`
code which should **NOT** be used in production. But vendors may start verifying their hardware
with the HAL interface.

This directory will be cleaned up when the stable Thread HAL interface is added in
`hardware/interfaces/threadnetwork` by version `V` or later.

More information about _Thread_:
- https://www.threadgroup.org
- https://openthread.io
+0 −26
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

aidl_interface {
    name: "android.hardware.threadnetwork",
    host_supported: true,
    vendor_available: true,

    srcs: [
        "android/hardware/threadnetwork/*.aidl",
    ],

    unstable: true,

    backend: {
        ndk: {
            enabled: true,
        },
    },
}
+0 −88
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.threadnetwork;

import android.hardware.threadnetwork.IThreadChipCallback;

/**
 * Controls a Thread radio chip on the device.
 */

interface IThreadChip {
    /**
     * The operation failed for the internal error.
     */
    const int ERROR_FAILED = 1;

    /**
     * Insufficient buffers available to send frames.
     */
    const int ERROR_NO_BUFS = 2;

    /**
     * Service is busy and could not service the operation.
     */
    const int ERROR_BUSY = 3;

    /**
     * This method initializes the Thread HAL instance. If open completes
     * successfully, then the Thread HAL instance is ready to accept spinel
     * messages through sendSpinelFrame() API.
     *
     * @param callback  A IThreadChipCallback callback instance. If multiple
     *                  callbacks are passed in, the open() will return ERROR_BUSY.
     *
     * @throws EX_ILLEGAL_ARGUMENT  if the callback handle is invalid (for example, it is null).
     * @throws ServiceSpecificException with one of the following values:
     *     - ERROR_FAILED        The interface cannot be opened due to an internal error.
     *     - ERROR_BUSY          This interface is in use.
     */
    void open(in IThreadChipCallback callback);

    /**
     * Close the Thread HAL instance. Must free all resources.
     *
     * @throws EX_ILLEGAL_STATE  if the Thread HAL instance is not opened.
     *
     */
    void close();

    /**
     * This method resets the Thread HAL internal state. The callback registered by
     * `open()` won’t be reset and the resource allocated by `open()` won’t be free.
     *
     */
    void reset();

    /**
     * This method sends a spinel frame to the Thread HAL.
     *
     * This method should block until the frame is sent out successfully or
     * the method throws errors immediately.
     *
     * Spinel Protocol:
     *     https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h
     *
     * @param frame  The spinel frame to be sent.
     *
     * @throws ServiceSpecificException with one of the following values:
     *         - ERROR_FAILED The Thread HAL failed to send the frame for an internal reason.
     *         - ERROR_NO_BUFS Insufficient buffer space to send the frame.
     *         - ERROR_BUSY The Thread HAL is busy.
     */
    void sendSpinelFrame(in byte[] frame);
}
+0 −30
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.threadnetwork;

interface IThreadChipCallback {
    /**
     * This method is called when a spinel frame is received. Thread network
     * will process the received spinel frame.
     *
     * Spinel Protocol:
     *     https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h
     *
     * @param frame  The received spinel frame.
     */
    oneway void onReceiveSpinelFrame(in byte[] frame);
}
Loading