mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
uwb(hal): Add HAL API for session initialization
Bug: 209990508 Test: atest VtsHalUwbTargetTest Change-Id: I7d10062cb3854ab39717d93a6eadba9dde99330d
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user