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

Commit 46b8a474 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "uwb(hal): Add HAL API for session initialization"

parents fdf44806 f2c2939b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ interface IUwbChip {
  void open(in android.hardware.uwb.IUwbClientCallback clientCallback);
  void close();
  void coreInit();
  void sessionInit(int sessionId);
  int getSupportedAndroidUciVersion();
  long getSupportedAndroidCapabilities();
  int sendUciMessage(in byte[] data);
+8 −0
Original line number Diff line number Diff line
@@ -49,6 +49,14 @@ interface IUwbChip {
     */
    void coreInit();

    /**
     * Perform any necessary UWB session initializations.
     * This must be invoked by the framework at the beginging of every new ranging session.
     *
     * @param sessionId Session identifier as defined in the UCI specification.
     */
    void sessionInit(int sessionId);

    /**
     * Supported version of vendor UCI specification.
     *
+4 −0
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@ UwbChip::~UwbChip() {}
    return ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus UwbChip::sessionInit(int /* sessionId */) {
    return ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus UwbChip::getSupportedAndroidUciVersion(int32_t* version) {
    *version = kAndroidUciVersion;
    return ndk::ScopedAStatus::ok();
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ class UwbChip : public BnUwbChip {
    ::ndk::ScopedAStatus open(const std::shared_ptr<IUwbClientCallback>& clientCallback) override;
    ::ndk::ScopedAStatus close() override;
    ::ndk::ScopedAStatus coreInit() override;
    ::ndk::ScopedAStatus sessionInit(int sesionId) override;
    ::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override;
    ::ndk::ScopedAStatus getSupportedAndroidCapabilities(int64_t* capabilities) override;
    ::ndk::ScopedAStatus sendUciMessage(const std::vector<uint8_t>& data,
+5 −0
Original line number Diff line number Diff line
@@ -166,6 +166,11 @@ TEST_P(UwbAidl, ChipCoreInit) {
    EXPECT_TRUE(iuwb_chip->coreInit().isOk());
}

TEST_P(UwbAidl, ChipSessionInit) {
    const auto iuwb_chip = getAnyChipAndOpen();
    EXPECT_TRUE(iuwb_chip->sessionInit(0).isOk());
}

TEST_P(UwbAidl, ChipGetSupportedAndroidUciVersion) {
    const auto iuwb_chip = getAnyChipAndOpen();
    EXPECT_TRUE(iuwb_chip->coreInit().isOk());