merge from upstream/master into main at 2023-05-29T19:32:05.771546Z

Change-Id: Ic3111b7e1371cbaf98a2e0329d1f89f09485cf52
diff --git a/.gitignore b/.gitignore
index eeea1db..ceb2dd7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
 # Ignore the artifacts generated by cargo.
 **/Cargo.lock
 **/target/
+
+# vscode
+.vscode/*
\ No newline at end of file
diff --git a/CleanSpec.mk b/CleanSpec.mk
deleted file mode 100755
index ffac166..0000000
--- a/CleanSpec.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2012 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.
-#
-
-# If you don't need to do a full clean build but would like to touch
-# a file or delete some intermediate files, add a clean step to the end
-# of the list.  These steps will only be run once, if they haven't been
-# run before.
-#
-# E.g.:
-#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
-#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
-#
-# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
-# files that are missing or have been moved.
-#
-# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
-# Use $(OUT_DIR) to refer to the "out" directory.
-#
-# If you need to re-do something that's already mentioned, just copy
-# the command and add it to the bottom of the list.  E.g., if a change
-# that you made last week required touching a file and a change you
-# made today requires touching the same file, just copy the old
-# touch step and add it to the end of the list.
-#
-# ************************************************
-# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
-# ************************************************
-
-# For example:
-#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
-#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
-#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
-#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libuwb-uci_intermediates)
-
-# ************************************************
-# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
-# ************************************************
diff --git a/src/TEST_MAPPING b/src/TEST_MAPPING
index 94263af..4676de2 100644
--- a/src/TEST_MAPPING
+++ b/src/TEST_MAPPING
@@ -1,10 +1,5 @@
 {
   "presubmit": [
-    // TODO(b/245028544): Disable the presubmit check temporarily.
-    // {
-    //   "name": "libuwb_core_cargo_test",
-    //   "host": true
-    // },
     {
       "name": "libuwb_uci_packet_tests"
     },
diff --git a/src/adaptation/UwbAdaptation.cc b/src/adaptation/UwbAdaptation.cc
deleted file mode 100755
index fa78e45..0000000
--- a/src/adaptation/UwbAdaptation.cc
+++ /dev/null
@@ -1,566 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-
-#include "UwbAdaptation.h"
-
-#include <aidl/android/hardware/uwb/BnUwb.h>
-#include <aidl/android/hardware/uwb/BnUwbClientCallback.h>
-#include <aidl/android/hardware/uwb/IUwb.h>
-#include <aidl/android/hardware/uwb/IUwbChip.h>
-#include <android-base/logging.h>
-#include <android/binder_ibinder.h>
-#include <android/binder_manager.h>
-#include <android/binder_process.h>
-#include <binder/IMemory.h>
-#include <binder/IServiceManager.h>
-#include <binder/MemoryDealer.h>
-#include <cutils/properties.h>
-#include <pthread.h>
-
-#include <algorithm>
-
-#include "uci_log.h"
-#include "uwa_api.h"
-#include "uwb_config.h"
-#include "uwb_hal_int.h"
-#include "uwb_int.h"
-#include "uwb_target.h"
-
-using IUwbV1_0 = aidl::android::hardware::uwb::IUwb;
-using IUwbChipV1_0 = aidl::android::hardware::uwb::IUwbChip;
-using UwbStatus = aidl::android::hardware::uwb::UwbStatus;
-using aidl::android::hardware::uwb::BnUwbClientCallback;
-using aidl::android::hardware::uwb::IUwbClientCallback;
-
-std::string UWB_HAL_SERVICE_NAME = "android.hardware.uwb.IUwb/default";
-extern bool uwb_debug_enabled;
-
-bool uwb_debug_enabled = false;
-bool IsdebugLogEnabled = false;
-
-extern void phUwb_GKI_shutdown();
-
-UwbAdaptation* UwbAdaptation::mpInstance = NULL;
-ThreadMutex UwbAdaptation::sLock;
-ThreadMutex UwbAdaptation::sIoctlLock;
-std::mutex sIoctlMutex;
-
-tHAL_UWB_CBACK* UwbAdaptation::mHalCallback = NULL;
-tHAL_UWB_DATA_CBACK* UwbAdaptation::mHalDataCallback = NULL;
-std::shared_ptr<IUwbChipV1_0> mHal = nullptr;
-
-namespace {
-void initializeGlobalDebugEnabledFlag() {
-  uwb_debug_enabled = true;
-
-  UCI_TRACE_I("%s: Debug log is enabled =%u", __func__, uwb_debug_enabled);
-}
-
-std::shared_ptr<IUwbChipV1_0> getHalService() {
-  ::ndk::SpAIBinder binder(AServiceManager_getService(UWB_HAL_SERVICE_NAME.c_str()));
-  std::shared_ptr<IUwbV1_0> iUwb = IUwbV1_0::fromBinder(binder);
-  if (iUwb == nullptr) {
-      ALOGE("Failed to connect to the AIDL HAL service.");
-      return nullptr;
-  }
-  std::vector<std::string> chipNames;
-  ndk::ScopedAStatus status = iUwb->getChips(&chipNames);
-  if (!status.isOk() || chipNames.empty()) {
-    ALOGE("Failed to retrieve the HAL chip names");
-    return nullptr;
-  }
-  // TODO (b/197638976): We pick the first chip here. Need to fix this
-  // for supporting multiple chips in the future.
-  std::shared_ptr<IUwbChipV1_0> iUwbChip;
-  status = iUwb->getChip(chipNames.front(), &iUwbChip);
-  if (!status.isOk() || iUwbChip == nullptr) {
-    ALOGE("Failed to retrieve the HAL chip");
-    return nullptr;
-  }
-  return iUwbChip;
-}
-
-}  // namespace
-
-class UwbClientCallback
-    : public aidl::android::hardware::uwb::BnUwbClientCallback {
- public:
-  UwbClientCallback(tHAL_UWB_CBACK* eventCallback,
-                    tHAL_UWB_DATA_CBACK dataCallback) {
-    mEventCallback = eventCallback;
-    mDataCallback = dataCallback;
-  };
-  virtual ~UwbClientCallback() = default;
-
-  ::ndk::ScopedAStatus onHalEvent(
-      aidl::android::hardware::uwb::UwbEvent event,
-      aidl::android::hardware::uwb::UwbStatus event_status) override {
-    mEventCallback((uint8_t)event, (uint16_t)event_status);
-    return ::ndk::ScopedAStatus::ok();
-  };
-
-  ::ndk::ScopedAStatus onUciMessage(const std::vector<uint8_t>& data) override {
-    std::vector<uint8_t> copy = data;
-    mDataCallback(copy.size(), &copy[0]);
-    return ::ndk::ScopedAStatus::ok();
-  };
-
- private:
-  tHAL_UWB_CBACK* mEventCallback;
-  tHAL_UWB_DATA_CBACK* mDataCallback;
-};
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::UwbAdaptation()
-**
-** Description: class constructor
-**
-** Returns:     none
-**
-*******************************************************************************/
-UwbAdaptation::UwbAdaptation() {
-  memset(&mHalEntryFuncs, 0, sizeof(mHalEntryFuncs));
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::~UwbAdaptation()
-**
-** Description: class destructor
-**
-** Returns:     none
-**
-*******************************************************************************/
-UwbAdaptation::~UwbAdaptation() { mpInstance = NULL; }
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::GetInstance()
-**
-** Description: access class singleton
-**
-** Returns:     pointer to the singleton object
-**
-*******************************************************************************/
-UwbAdaptation& UwbAdaptation::GetInstance() {
-  AutoThreadMutex a(sLock);
-
-  if (!mpInstance) mpInstance = new UwbAdaptation;
-  CHECK(mpInstance);
-  return *mpInstance;
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::Initialize()
-**
-** Description: class initializer
-**
-** Returns:     none
-**
-*******************************************************************************/
-void UwbAdaptation::Initialize() {
-  const char* func = "UwbAdaptation::Initialize";
-  UNUSED(func);
-  UCI_TRACE_I("%s: enter", func);
-  initializeGlobalDebugEnabledFlag();
-  phUwb_GKI_init();
-  phUwb_GKI_enable();
-  phUwb_GKI_create_task((TASKPTR)UWBA_TASK, BTU_TASK, (int8_t*)"UWBA_TASK", 0,
-                        0, (pthread_cond_t*)NULL, NULL);
-  {
-    AutoThreadMutex guard(mCondVar);
-    phUwb_GKI_create_task((TASKPTR)Thread, MMI_TASK, (int8_t*)"UWBA_THREAD", 0,
-                          0, (pthread_cond_t*)NULL, NULL);
-    mCondVar.wait();
-  }
-
-  mHalCallback = NULL;
-  memset(&mHalEntryFuncs, 0, sizeof(mHalEntryFuncs));
-  InitializeHalDeviceContext();
-  UCI_TRACE_I("%s: exit", func);
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::Finalize(bool exitStatus)
-**
-** Description: class finalizer
-**
-** Returns:     none
-**
-*******************************************************************************/
-void UwbAdaptation::Finalize(bool graceExit) {
-  const char* func = "UwbAdaptation::Finalize";
-  UNUSED(func);
-  AutoThreadMutex a(sLock);
-
-  UCI_TRACE_I("%s: enter, graceful: %d", func, graceExit);
-  phUwb_GKI_shutdown();
-
-  memset(&mHalEntryFuncs, 0, sizeof(mHalEntryFuncs));
-  if (graceExit) {
-    UwbConfig::clear();
-  }
-
-  UCI_TRACE_I("%s: exit", func);
-  delete this;
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::signal()
-**
-** Description: signal the CondVar to release the thread that is waiting
-**
-** Returns:     none
-**
-*******************************************************************************/
-void UwbAdaptation::signal() { mCondVar.signal(); }
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::UWBA_TASK()
-**
-** Description: UWBA_TASK runs the GKI main task
-**
-** Returns:     none
-**
-*******************************************************************************/
-uint32_t UwbAdaptation::UWBA_TASK(__attribute__((unused)) uint32_t arg) {
-  const char* func = "UwbAdaptation::UWBA_TASK";
-  UNUSED(func);
-  UCI_TRACE_I("%s: enter", func);
-  phUwb_GKI_run(0);
-  UCI_TRACE_I("%s: exit", func);
-  return 0;
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::Thread()
-**
-** Description: Creates work threads
-**
-** Returns:     none
-**
-*******************************************************************************/
-uint32_t UwbAdaptation::Thread(__attribute__((unused)) uint32_t arg) {
-  const char* func = "UwbAdaptation::Thread";
-  UNUSED(func);
-  UCI_TRACE_I("%s: enter", func);
-
-  {
-    ThreadCondVar CondVar;
-    AutoThreadMutex guard(CondVar);
-    phUwb_GKI_create_task((TASKPTR)uwb_task, UWB_TASK, (int8_t*)"UWB_TASK", 0,
-                          0, (pthread_cond_t*)CondVar,
-                          (pthread_mutex_t*)CondVar);
-    CondVar.wait();
-  }
-
-  UwbAdaptation::GetInstance().signal();
-
-  phUwb_GKI_exit_task(phUwb_GKI_get_taskid());
-  UCI_TRACE_I("%s: exit", func);
-  return 0;
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::GetHalEntryFuncs()
-**
-** Description: Get the set of HAL entry points.
-**
-** Returns:     Functions pointers for HAL entry points.
-**
-*******************************************************************************/
-tHAL_UWB_ENTRY* UwbAdaptation::GetHalEntryFuncs() { return &mHalEntryFuncs; }
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::InitializeHalDeviceContext
-**
-** Description: Ask the generic Android HAL to find the Broadcom-specific HAL.
-**
-** Returns:     None.
-**
-*******************************************************************************/
-void UwbAdaptation::InitializeHalDeviceContext() {
-  const char* func = "UwbAdaptation::InitializeHalDeviceContext";
-  UNUSED(func);
-  UCI_TRACE_I("%s: enter", func);
-
-  mHalEntryFuncs.open = HalOpen;
-  mHalEntryFuncs.close = HalClose;
-  mHalEntryFuncs.write = HalWrite;
-  mHalEntryFuncs.CoreInitialization = CoreInitialization;
-  mHalEntryFuncs.SessionInitialization = SessionInitialization;
-  mHal = getHalService();
-  if (mHal == nullptr) {
-    UCI_TRACE_I("%s: Failed to retrieve the UWB HAL!", func);
-  } else {
-    UCI_TRACE_I("%s: IUwb::getService() returned %p (%s)", func, mHal.get(),
-                (mHal->isRemote() ? "remote" : "local"));
-  }
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::HalOpen
-**
-** Description: Turn on controller, download firmware.
-**
-** Returns:     None.
-**
-*******************************************************************************/
-void UwbAdaptation::HalOpen(tHAL_UWB_CBACK* p_hal_cback,
-                            tHAL_UWB_DATA_CBACK* p_data_cback) {
-  const char* func = "UwbAdaptation::HalOpen";
-  UNUSED(func);
-  UCI_TRACE_I("%s", func);
-  ndk::ScopedAStatus status;
-  std::shared_ptr<IUwbClientCallback> mCallback;
-  mCallback =
-      ndk::SharedRefBase::make<UwbClientCallback>(p_hal_cback, p_data_cback);
-
-  if (mHal != nullptr) {
-    status = mHal->open(mCallback);
-  } else {
-    UCI_TRACE_E("%s mHal is NULL", func);
-  }
-}
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::HalClose
-**
-** Description: Turn off controller.
-**
-** Returns:     None.
-**
-*******************************************************************************/
-void UwbAdaptation::HalClose() {
-  const char* func = "UwbAdaptation::HalClose";
-  UNUSED(func);
-  ndk::ScopedAStatus status;
-  UCI_TRACE_I("%s HalClose Enter", func);
-  if (mHal != nullptr) status = mHal->close();
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::HalWrite
-**
-** Description: Write UCI message to the controller.
-**
-** Returns:     None.
-**
-*******************************************************************************/
-void UwbAdaptation::HalWrite(__attribute__((unused)) uint16_t data_len,
-                             __attribute__((unused)) uint8_t* p_data) {
-  const char* func = "UwbAdaptation::HalWrite";
-  UNUSED(func);
-  UCI_TRACE_I("%s: Enter", func);
-  std::vector<uint8_t> data;
-  if (p_data == NULL) {
-    UCI_TRACE_E("p_data is null");
-    return;
-  }
-  int ret;
-  copy(&p_data[0], &p_data[data_len], back_inserter(data));
-  if (mHal != nullptr) {
-    mHal->sendUciMessage(data, &ret);
-  } else {
-    UCI_TRACE_E("mHal is NULL");
-  }
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::CoreInitialization
-**
-** Description: Performs UWB CoreInitialization.
-**
-** Returns:     UwbStatus::OK on success and UwbStatus::FAILED on error.
-**
-*******************************************************************************/
-tUWB_STATUS UwbAdaptation::CoreInitialization() {
-  const char* func = "UwbAdaptation::CoreInitialization";
-  UNUSED(func);
-  UCI_TRACE_I("%s: enter", func);
-  if (mHal != nullptr) {
-    if (!mHal->coreInit().isOk()) return UWB_STATUS_FAILED;
-  } else {
-    UCI_TRACE_E("mHal is NULL");
-    return UWB_STATUS_FAILED;
-  }
-  return UWB_STATUS_OK;
-}
-
-/*******************************************************************************
-**
-** Function:    UwbAdaptation::SessionInitialization
-**
-** Description: Performs UWB SessionInitialization.
-**
-** Returns:     UwbStatus::OK on success and UwbStatus::FAILED on error.
-**
-*******************************************************************************/
-tUWB_STATUS UwbAdaptation::SessionInitialization(int sessionId) {
-  const char* func = "UwbAdaptation::SessionInitialization";
-  UNUSED(func);
-  UCI_TRACE_I("%s: enter", func);
-  if (mHal != nullptr) {
-    if (!mHal->sessionInit(sessionId).isOk()) return UWB_STATUS_FAILED;
-  } else {
-    UCI_TRACE_E("mHal is NULL");
-    return UWB_STATUS_FAILED;
-  }
-  return UWB_STATUS_OK;
-}
-
-/*******************************************************************************
-**
-** Function:    ThreadMutex::ThreadMutex()
-**
-** Description: class constructor
-**
-** Returns:     none
-**
-*******************************************************************************/
-ThreadMutex::ThreadMutex() {
-  pthread_mutexattr_t mutexAttr;
-
-  pthread_mutexattr_init(&mutexAttr);
-  pthread_mutex_init(&mMutex, &mutexAttr);
-  pthread_mutexattr_destroy(&mutexAttr);
-}
-
-/*******************************************************************************
-**
-** Function:    ThreadMutex::~ThreadMutex()
-**
-** Description: class destructor
-**
-** Returns:     none
-**
-*******************************************************************************/
-ThreadMutex::~ThreadMutex() { pthread_mutex_destroy(&mMutex); }
-
-/*******************************************************************************
-**
-** Function:    ThreadMutex::lock()
-**
-** Description: lock the mutex
-**
-** Returns:     none
-**
-*******************************************************************************/
-void ThreadMutex::lock() { pthread_mutex_lock(&mMutex); }
-
-/*******************************************************************************
-**
-** Function:    ThreadMutex::unblock()
-**
-** Description: unlock the mutex
-**
-** Returns:     none
-**
-*******************************************************************************/
-void ThreadMutex::unlock() { pthread_mutex_unlock(&mMutex); }
-
-/*******************************************************************************
-**
-** Function:    ThreadCondVar::ThreadCondVar()
-**
-** Description: class constructor
-**
-** Returns:     none
-**
-*******************************************************************************/
-ThreadCondVar::ThreadCondVar() {
-  pthread_condattr_t CondAttr;
-
-  pthread_condattr_init(&CondAttr);
-  pthread_cond_init(&mCondVar, &CondAttr);
-
-  pthread_condattr_destroy(&CondAttr);
-}
-
-/*******************************************************************************
-**
-** Function:    ThreadCondVar::~ThreadCondVar()
-**
-** Description: class destructor
-**
-** Returns:     none
-**
-*******************************************************************************/
-ThreadCondVar::~ThreadCondVar() { pthread_cond_destroy(&mCondVar); }
-
-/*******************************************************************************
-**
-** Function:    ThreadCondVar::wait()
-**
-** Description: wait on the mCondVar
-**
-** Returns:     none
-**
-*******************************************************************************/
-void ThreadCondVar::wait() {
-  pthread_cond_wait(&mCondVar, *this);
-  pthread_mutex_unlock(*this);
-}
-
-/*******************************************************************************
-**
-** Function:    ThreadCondVar::signal()
-**
-** Description: signal the mCondVar
-**
-** Returns:     none
-**
-*******************************************************************************/
-void ThreadCondVar::signal() {
-  AutoThreadMutex a(*this);
-  pthread_cond_signal(&mCondVar);
-}
-
-/*******************************************************************************
-**
-** Function:    AutoThreadMutex::AutoThreadMutex()
-**
-** Description: class constructor, automatically lock the mutex
-**
-** Returns:     none
-**
-*******************************************************************************/
-AutoThreadMutex::AutoThreadMutex(ThreadMutex& m) : mm(m) { mm.lock(); }
-
-/*******************************************************************************
-**
-** Function:    AutoThreadMutex::~AutoThreadMutex()
-**
-** Description: class destructor, automatically unlock the mutex
-**
-** Returns:     none
-**
-*******************************************************************************/
-AutoThreadMutex::~AutoThreadMutex() { mm.unlock(); }
diff --git a/src/adaptation/config.cc b/src/adaptation/config.cc
deleted file mode 100755
index 36e0d10..0000000
--- a/src/adaptation/config.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *  Copyright 2018-2019 NXP
- *
- * 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.
- */
-#include "config.h"
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/parseint.h>
-#include <android-base/strings.h>
-
-#include "uwb_config.h"
-
-using namespace ::std;
-using namespace ::android::base;
-
-namespace {
-
-bool parseBytesString(std::string in, std::vector<uint8_t>& out) {
-  vector<string> values = Split(in, ":");
-  if (values.size() == 0) return false;
-  for (string value : values) {
-    if (value.length() != 2) return false;
-    uint8_t tmp = 0;
-    string hexified = "0x";
-    hexified.append(value);
-    if (!ParseUint(hexified.c_str(), &tmp)) return false;
-    out.push_back(tmp);
-  }
-  return true;
-}
-
-}  // namespace
-
-ConfigValue::ConfigValue() {}
-
-ConfigValue::ConfigValue(std::string value) {
-  // Don't allow empty strings
-  CHECK(!(value.empty()));
-  type_ = STRING;
-  value_string_ = value;
-}
-
-ConfigValue::ConfigValue(unsigned value) {
-  type_ = UNSIGNED;
-  value_unsigned_ = value;
-}
-
-ConfigValue::ConfigValue(std::vector<uint8_t> value) {
-  CHECK(!(value.empty()));
-  type_ = BYTES;
-  value_bytes_ = value;
-}
-
-ConfigValue::Type ConfigValue::getType() const { return type_; }
-
-std::string ConfigValue::getString() const {
-  CHECK(type_ == STRING);
-  return value_string_;
-};
-
-unsigned ConfigValue::getUnsigned() const {
-  CHECK(type_ == UNSIGNED);
-  return value_unsigned_;
-};
-
-std::vector<uint8_t> ConfigValue::getBytes() const {
-  CHECK(type_ == BYTES);
-  return value_bytes_;
-};
-
-bool ConfigValue::parseFromString(std::string in) {
-  if (in.length() > 1 && in[0] == '"' && in[in.length() - 1] == '"') {
-    CHECK(in.length() > 2);  // Don't allow empty strings
-    type_ = STRING;
-    value_string_ = in.substr(1, in.length() - 2);
-    return true;
-  }
-
-  if (in.length() > 1 && in[0] == '{' && in[in.length() - 1] == '}') {
-    CHECK(in.length() >= 4);  // Needs at least one byte
-    type_ = BYTES;
-    return parseBytesString(in.substr(1, in.length() - 2), value_bytes_);
-  }
-
-  unsigned tmp = 0;
-  if (ParseUint(in.c_str(), &tmp)) {
-    type_ = UNSIGNED;
-    value_unsigned_ = tmp;
-    return true;
-  }
-
-  return false;
-}
-
-void ConfigFile::addConfig(const std::string& key, ConfigValue& value) {
-  CHECK(!hasKey(key));
-  values_.emplace(key, value);
-}
-
-void ConfigFile::parseFromFile(const std::string& file_name) {
-  string config;
-  bool config_read = ReadFileToString(file_name, &config);
-  CHECK(config_read);
-  LOG(INFO) << "ConfigFile - Parsing file '" << file_name << "'";
-  parseFromString(config);
-}
-
-void ConfigFile::parseFromString(const std::string& config) {
-  stringstream ss(config);
-  string line;
-  while (getline(ss, line)) {
-    line = Trim(line);
-    if (line.empty()) continue;
-    if (line.at(0) == '#') continue;
-    if (line.at(0) == 0) continue;
-
-    auto search = line.find('=');
-    CHECK(search != string::npos);
-
-    string key(Trim(line.substr(0, search)));
-    string value_string(Trim(line.substr(search + 1, string::npos)));
-
-    ConfigValue value;
-    bool value_parsed = value.parseFromString(value_string);
-    CHECK(value_parsed);
-    addConfig(key, value);
-
-    LOG(INFO) << "ConfigFile - [" << key << "] = " << value_string;
-  }
-}
-
-bool ConfigFile::hasKey(const std::string& key) {
-  return values_.count(key) != 0;
-}
-
-ConfigValue& ConfigFile::getValue(const std::string& key) {
-  CHECK(values_.find(key) != values_.end());
-  auto search = values_.find(key);
-  return search->second;
-}
-
-std::string ConfigFile::getString(const std::string& key) {
-  return getValue(key).getString();
-}
-
-unsigned ConfigFile::getUnsigned(const std::string& key) {
-  return getValue(key).getUnsigned();
-}
-
-std::vector<uint8_t> ConfigFile::getBytes(const std::string& key) {
-  return getValue(key).getBytes();
-}
-
-bool ConfigFile::isEmpty() { return values_.empty(); }
-void ConfigFile::clear() { values_.clear(); }
diff --git a/src/adaptation/uwb_config.cc b/src/adaptation/uwb_config.cc
deleted file mode 100755
index 3707cc6..0000000
--- a/src/adaptation/uwb_config.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *  Copyright 2018-2019 NXP
- *
- * 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.
- */
-#include "uwb_config.h"
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/parseint.h>
-#include <android-base/strings.h>
-#include <config.h>
-
-#include "UwbAdaptation.h"
-
-using namespace ::std;
-using namespace ::android::base;
-
-namespace {
-
-std::string findConfigPath() {
-  const vector<string> search_path = {"/odm/etc/", "/vendor/etc/",
-                                      "/product/etc/", "/etc/"};
-  const string file_name = "libuwb-uci.conf";
-
-  for (string path : search_path) {
-    path.append(file_name);
-    struct stat file_stat;
-    if (stat(path.c_str(), &file_stat) != 0) continue;
-    if (S_ISREG(file_stat.st_mode)) return path;
-  }
-  return "";
-}
-
-}  // namespace
-
-void UwbConfig::loadConfig() {
-  string config_path = findConfigPath();
-  CHECK(config_path != "");
-  config_.parseFromFile(config_path);
-}
-
-UwbConfig::UwbConfig() { loadConfig(); }
-
-UwbConfig& UwbConfig::getInstance() {
-  static UwbConfig theInstance;
-  if (theInstance.config_.isEmpty()) {
-    theInstance.loadConfig();
-  }
-  return theInstance;
-}
-
-bool UwbConfig::hasKey(const std::string& key) {
-  return getInstance().config_.hasKey(key);
-}
-
-std::string UwbConfig::getString(const std::string& key) {
-  return getInstance().config_.getString(key);
-}
-
-std::string UwbConfig::getString(const std::string& key,
-                                 std::string default_value) {
-  if (hasKey(key)) return getString(key);
-  return default_value;
-}
-
-unsigned UwbConfig::getUnsigned(const std::string& key) {
-  return getInstance().config_.getUnsigned(key);
-}
-
-unsigned UwbConfig::getUnsigned(const std::string& key,
-                                unsigned default_value) {
-  if (hasKey(key)) return getUnsigned(key);
-  return default_value;
-}
-
-std::vector<uint8_t> UwbConfig::getBytes(const std::string& key) {
-  return getInstance().config_.getBytes(key);
-}
-
-void UwbConfig::clear() { getInstance().config_.clear(); }
diff --git a/src/gki/common/uwb_gki.h b/src/gki/common/uwb_gki.h
deleted file mode 100755
index 3451093..0000000
--- a/src/gki/common/uwb_gki.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef UWB_GKI_H
-#define UWB_GKI_H
-
-#include <string>
-
-#include "uwb_gki_target.h"
-#include "uwb_target.h"
-
-/* Error codes */
-#define GKI_SUCCESS 0x00
-#define GKI_FAILURE 0x01
-#define GKI_INVALID_TASK 0xF0
-#define GKI_INVALID_POOL 0xFF
-
-/************************************************************************
-** Mailbox definitions. Each task has 4 mailboxes that are used to
-** send buffers to the task.
-*/
-#define TASK_MBOX_0 0
-#define TASK_MBOX_2 2
-
-#define NUM_TASK_MBOX 4
-
-/************************************************************************
-** Event definitions.
-**
-** There are 4 reserved events used to signal messages rcvd in task mailboxes.
-** There are 4 reserved events used to signal timeout events.
-** There are 8 general purpose events available for applications.
-*/
-
-#define TASK_MBOX_0_EVT_MASK 0x0001
-#define TASK_MBOX_1_EVT_MASK 0x0002
-#define TASK_MBOX_2_EVT_MASK 0x0004
-#define TASK_MBOX_3_EVT_MASK 0x0008
-
-#define TIMER_0 0
-#define TIMER_1 1
-#define TIMER_2 2
-#define TIMER_3 3
-
-#define TIMER_0_EVT_MASK 0x0010
-#define TIMER_1_EVT_MASK 0x0020
-#define TIMER_2_EVT_MASK 0x0040
-#define TIMER_3_EVT_MASK 0x0080
-
-#define APPL_EVT_0 8
-#define APPL_EVT_7 15
-
-#define EVENT_MASK(evt) ((uint16_t)(0x0001 << (evt)))
-
-/************************************************************************
-**  Max Time Queue
-**/
-#ifndef GKI_MAX_TIMER_QUEUES
-#define GKI_MAX_TIMER_QUEUES 3
-#endif
-
-/************************************************************************
-**  Utility macros for timer conversion
-**/
-#ifdef TICKS_PER_SEC
-#define GKI_MS_TO_TICKS(x) ((x) / (1000 / TICKS_PER_SEC))
-#define GKI_SECS_TO_TICKS(x) ((x) * (TICKS_PER_SEC))
-#define GKI_TICKS_TO_MS(x) ((x) * (1000 / TICKS_PER_SEC))
-#define GKI_TICKS_TO_SECS(x) ((x) * (1 / TICKS_PER_SEC))
-#endif
-
-#ifndef GKI_SHUTDOWN_EVT
-#define GKI_SHUTDOWN_EVT APPL_EVT_7
-#endif
-
-/* Timer list entry callback type
- */
-struct TIMER_LIST_ENT;
-typedef void(TIMER_CBACK)(TIMER_LIST_ENT* p_tle);
-
-/* Define a timer list entry
- */
-struct TIMER_LIST_ENT {
-  TIMER_LIST_ENT* p_next;
-  TIMER_LIST_ENT* p_prev;
-  TIMER_CBACK* p_cback;
-  int32_t ticks;
-  uintptr_t param;
-  uint16_t event;
-  uint8_t in_use;
-};
-
-/* Define a timer list queue
- */
-typedef struct {
-  TIMER_LIST_ENT* p_first;
-  TIMER_LIST_ENT* p_last;
-  int32_t last_ticks;
-} TIMER_LIST_Q;
-
-/***********************************************************************
-** This queue is a general purpose buffer queue, for application use.
-*/
-typedef struct {
-  void* p_first;
-  void* p_last;
-  uint16_t count;
-} BUFFER_Q;
-
-typedef struct {
-  BUFFER_Q tx_data_pkt_q;
-  uint32_t session_id;
-  uint8_t credit_available;
-} DATA_BUFFER_Q;
-
-/* Task constants
- */
-#ifndef TASKPTR
-typedef uint32_t (*TASKPTR)(uint32_t);
-#endif
-
-/* General pool accessible to GKI_getbuf() */
-#define GKI_RESTRICTED_POOL 1 /* Inaccessible pool to GKI_getbuf() */
-
-/***********************************************************************
-** Function prototypes
-*/
-
-/* Task management
- */
-extern uint8_t phUwb_GKI_create_task(TASKPTR, uint8_t, int8_t*, uint16_t*,
-                                     uint16_t, void*, void*);
-extern void phUwb_GKI_exit_task(uint8_t);
-extern uint8_t phUwb_GKI_get_taskid(void);
-extern void phUwb_GKI_init(void);
-extern void phUwb_GKI_run(void*);
-
-/* To send buffers and events between tasks
- */
-extern uint8_t phUwb_GKI_isend_event(uint8_t, uint16_t);
-extern void* phUwb_GKI_read_mbox(uint8_t);
-extern void phUwb_GKI_send_msg(uint8_t, uint8_t, void*);
-extern uint8_t phUwb_GKI_send_event(uint8_t, uint16_t);
-
-/* To get and release buffers, change owner and get size
- */
-extern void phUwb_GKI_freebuf(void*);
-extern void* phUwb_GKI_getbuf(uint16_t);
-extern uint16_t phUwb_GKI_get_buf_size(void*);
-extern void* phUwb_GKI_getpoolbuf(uint8_t);
-
-/* User buffer queue management
- */
-extern void* phUwb_GKI_dequeue(BUFFER_Q*);
-extern void phUwb_GKI_enqueue(BUFFER_Q*, void*);
-extern void phUwb_GKI_init_q(BUFFER_Q*);
-
-/* Timer management
- */
-extern void phUwb_GKI_add_to_timer_list(TIMER_LIST_Q*, TIMER_LIST_ENT*);
-extern uint32_t phUwb_GKI_get_tick_count(void);
-extern void phUwb_GKI_init_timer_list(TIMER_LIST_Q*);
-extern void phUwb_GKI_remove_from_timer_list(TIMER_LIST_Q*, TIMER_LIST_ENT*);
-extern void phUwb_GKI_start_timer(uint8_t, int32_t, bool);
-extern void phUwb_GKI_stop_timer(uint8_t, int);
-extern void phUwb_GKI_timer_update(uint32_t);
-extern uint16_t phUwb_GKI_update_timer_list(TIMER_LIST_Q*, uint32_t);
-extern uint32_t phUwb_GKI_get_remaining_ticks(TIMER_LIST_Q*, TIMER_LIST_ENT*);
-extern uint16_t phUwb_GKI_wait(uint16_t, uint32_t);
-
-/* Start and Stop system time tick callback
- * true for start system tick if time queue is not empty
- * false to stop system tick if time queue is empty
- */
-typedef void(SYSTEM_TICK_CBACK)(bool);
-
-/* Time queue management for system ticks
- */
-extern void phUwb_GKI_timer_queue_register_callback(SYSTEM_TICK_CBACK*);
-
-/* Disable Interrupts, Enable Interrupts
- */
-extern void phUwb_GKI_enable(void);
-extern void phUwb_GKI_disable(void);
-
-/* Allocate (Free) memory from an OS
- */
-extern void* phUwb_GKI_os_malloc(uint32_t);
-extern void phUwb_GKI_os_free(void*);
-
-/* Exception handling
- */
-extern void phUwb_GKI_exception(uint16_t, std::string);
-
-#endif
diff --git a/src/gki/common/uwb_gki_buffer.cc b/src/gki/common/uwb_gki_buffer.cc
deleted file mode 100755
index 566b31d..0000000
--- a/src/gki/common/uwb_gki_buffer.cc
+++ /dev/null
@@ -1,643 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#include "uwb_gki.h"
-#include "uwb_gki_common.h"
-#include "uwb_gki_int.h"
-
-#if (GKI_NUM_TOTAL_BUF_POOLS > 16)
-#error Number of pools out of range (16 Max)!
-#endif
-
-#include "uci_log.h"
-
-/*******************************************************************************
-**
-** Function         phUwb_phUwb_gki_init_free_queue
-**
-** Description      Internal function called at startup to initialize a free
-**                  queue. It is called once for each free queue.
-**
-** Returns          void
-**
-*******************************************************************************/
-static void phUwb_gki_init_free_queue(uint8_t id, uint16_t size, uint16_t total,
-                                      void* p_mem) {
-  uint16_t i;
-  uint16_t act_size;
-  BUFFER_HDR_T* hdr;
-  BUFFER_HDR_T* hdr1 = NULL;
-  uint32_t* magic;
-  int32_t tempsize = size;
-  tGKI_COM_CB* p_cb = &gki_cb.com;
-
-  /* Ensure an even number of longwords */
-  tempsize = (int32_t)ALIGN_POOL(size);
-  act_size = (uint16_t)(tempsize + BUFFER_PADDING_SIZE);
-
-  /* Remember pool start and end addresses */
-  if (p_mem) {
-    p_cb->pool_start[id] = (uint8_t*)p_mem;
-    p_cb->pool_end[id] = (uint8_t*)p_mem + (act_size * total);
-  }
-
-  p_cb->pool_size[id] = act_size;
-
-  p_cb->freeq[id].size = (uint16_t)tempsize;
-  p_cb->freeq[id].total = total;
-  p_cb->freeq[id].cur_cnt = 0;
-  p_cb->freeq[id].max_cnt = 0;
-
-  /* Initialize  index table */
-  if (p_mem) {
-    hdr = (BUFFER_HDR_T*)p_mem;
-    p_cb->freeq[id].p_first = hdr;
-    for (i = 0; i < total; i++) {
-      hdr->task_id = GKI_INVALID_TASK;
-      hdr->q_id = id;
-      hdr->status = BUF_STATUS_FREE;
-      magic = (uint32_t*)((uint8_t*)hdr + BUFFER_HDR_SIZE + tempsize);
-      *magic = MAGIC_NO;
-      hdr1 = hdr;
-      hdr = (BUFFER_HDR_T*)((uint8_t*)hdr + act_size);
-      hdr1->p_next = hdr;
-    }
-    if (hdr1 != NULL) hdr = hdr1;
-    hdr->p_next = NULL;
-    p_cb->freeq[id].p_last = hdr;
-  }
-  return;
-}
-
-static bool phUwb_gki_alloc_free_queue(uint8_t id) {
-  FREE_QUEUE_T* Q;
-  tGKI_COM_CB* p_cb = &gki_cb.com;
-
-  Q = &p_cb->freeq[p_cb->pool_list[id]];
-
-  if (Q->p_first == 0) {
-    uint32_t requested_size;
-    bool overflow = __builtin_mul_overflow(Q->size + BUFFER_PADDING_SIZE,
-                                           Q->total, &requested_size);
-    if (overflow) {
-      phUwb_GKI_exception(GKI_ERROR_BUF_SIZE_TOOBIG,
-                         "gki_alloc_free_queue: Buffer overflow");
-      return false;
-    }
-    void* p_mem =
-        phUwb_GKI_os_malloc(requested_size);
-    if (p_mem) {
-      // re-initialize the queue with allocated memory
-      phUwb_gki_init_free_queue(id, Q->size, Q->total, p_mem);
-      return true;
-    }
-    phUwb_GKI_exception(GKI_ERROR_BUF_SIZE_TOOBIG,
-                        "gki_alloc_free_queue: Not enough memory");
-  }
-  return false;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_gki_buffer_init
-**
-** Description      Called once internally by GKI at startup to initialize all
-**                  buffers and free buffer pools.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_gki_buffer_init(void) {
-  uint8_t i, tt, mb;
-  tGKI_COM_CB* p_cb = &gki_cb.com;
-
-  /* Initialize mailboxes */
-  for (tt = 0; tt < GKI_MAX_TASKS; tt++) {
-    for (mb = 0; mb < NUM_TASK_MBOX; mb++) {
-      p_cb->OSTaskQFirst[tt][mb] = NULL;
-      p_cb->OSTaskQLast[tt][mb] = NULL;
-    }
-  }
-
-  for (tt = 0; tt < GKI_NUM_TOTAL_BUF_POOLS; tt++) {
-    p_cb->pool_start[tt] = NULL;
-    p_cb->pool_end[tt] = NULL;
-    p_cb->pool_size[tt] = 0;
-
-    p_cb->freeq[tt].p_first = 0;
-    p_cb->freeq[tt].p_last = 0;
-    p_cb->freeq[tt].size = 0;
-    p_cb->freeq[tt].total = 0;
-    p_cb->freeq[tt].cur_cnt = 0;
-    p_cb->freeq[tt].max_cnt = 0;
-  }
-
-  /* Use default from target.h */
-  p_cb->pool_access_mask = GKI_DEF_BUFPOOL_PERM_MASK;
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 0)
-  phUwb_gki_init_free_queue(0, GKI_BUF0_SIZE, GKI_BUF0_MAX, p_cb->bufpool0);
-#endif
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 1)
-  phUwb_gki_init_free_queue(1, GKI_BUF1_SIZE, GKI_BUF1_MAX, p_cb->bufpool1);
-#endif
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 2)
-  phUwb_gki_init_free_queue(2, GKI_BUF2_SIZE, GKI_BUF2_MAX, p_cb->bufpool2);
-#endif
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 3)
-  phUwb_gki_init_free_queue(3, GKI_BUF3_SIZE, GKI_BUF3_MAX, p_cb->bufpool3);
-#endif
-
-  /* add pools to the pool_list which is arranged in the order of size */
-  for (i = 0; i < GKI_NUM_FIXED_BUF_POOLS; i++) {
-    p_cb->pool_list[i] = i;
-  }
-
-  p_cb->curr_total_no_of_pools = GKI_NUM_FIXED_BUF_POOLS;
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_init_q
-**
-** Description      Called by an application to initialize a buffer queue.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_init_q(BUFFER_Q* p_q) {
-  p_q->p_first = p_q->p_last = NULL;
-  p_q->count = 0;
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_getbuf
-**
-** Description      Called by an application to get a free buffer which
-**                  is of size greater or equal to the requested size.
-**
-**                  Note: This routine only takes buffers from public pools.
-**                        It will not use any buffers from pools
-**                        marked GKI_RESTRICTED_POOL.
-**
-** Parameters       size - (input) number of bytes needed.
-**
-** Returns          A pointer to the buffer, or NULL if none available
-**
-*******************************************************************************/
-void* phUwb_GKI_getbuf(uint16_t size) {
-  uint8_t i;
-  FREE_QUEUE_T* Q;
-  BUFFER_HDR_T* p_hdr;
-  tGKI_COM_CB* p_cb = &gki_cb.com;
-
-  if (size == 0) {
-    phUwb_GKI_exception(GKI_ERROR_BUF_SIZE_ZERO, "getbuf: Size is zero");
-    return (NULL);
-  }
-
-  /* Find the first buffer pool that is public that can hold the desired size */
-  for (i = 0; i < p_cb->curr_total_no_of_pools; i++) {
-    if (size <= p_cb->freeq[p_cb->pool_list[i]].size) break;
-  }
-
-  if (i == p_cb->curr_total_no_of_pools) {
-    phUwb_GKI_exception(GKI_ERROR_BUF_SIZE_TOOBIG, "getbuf: Size is too big");
-    return (NULL);
-  }
-
-  /* Make sure the buffers aren't disturbed til finished with allocation */
-  phUwb_GKI_disable();
-
-  /* search the public buffer pools that are big enough to hold the size
-   * until a free buffer is found */
-  for (; i < p_cb->curr_total_no_of_pools; i++) {
-    /* Only look at PUBLIC buffer pools (bypass RESTRICTED pools) */
-    if (((uint16_t)1 << p_cb->pool_list[i]) & p_cb->pool_access_mask) continue;
-
-    Q = &p_cb->freeq[p_cb->pool_list[i]];
-    if (Q->cur_cnt < Q->total) {
-      if (Q->p_first == 0 && phUwb_gki_alloc_free_queue(i) != true) {
-        UCI_TRACE_E("out of buffer");
-        phUwb_GKI_enable();
-        return NULL;
-      }
-
-      if (Q->p_first == 0) {
-        /* phUwb_gki_alloc_free_queue() failed to alloc memory */
-        UCI_TRACE_E("fail alloc free queue");
-        phUwb_GKI_enable();
-        return NULL;
-      }
-
-      p_hdr = Q->p_first;
-      Q->p_first = p_hdr->p_next;
-
-      if (!Q->p_first) Q->p_last = NULL;
-
-      if (++Q->cur_cnt > Q->max_cnt) Q->max_cnt = Q->cur_cnt;
-
-      phUwb_GKI_enable();
-
-      p_hdr->task_id = phUwb_GKI_get_taskid();
-
-      p_hdr->status = BUF_STATUS_UNLINKED;
-      p_hdr->p_next = NULL;
-      p_hdr->Type = 0;
-      return ((void*)((uint8_t*)p_hdr + BUFFER_HDR_SIZE));
-    }
-  }
-
-  UCI_TRACE_E("unable to allocate buffer!!!!!");
-
-  phUwb_GKI_enable();
-
-  return (NULL);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_getpoolbuf
-**
-** Description      Called by an application to get a free buffer from
-**                  a specific buffer pool.
-**
-**                  Note: If there are no more buffers available from the pool,
-**                        the public buffers are searched for an available
-**                        buffer.
-**
-** Parameters       pool_id - (input) pool ID to get a buffer out of.
-**
-** Returns          A pointer to the buffer, or NULL if none available
-**
-*******************************************************************************/
-void* phUwb_GKI_getpoolbuf(uint8_t pool_id) {
-  FREE_QUEUE_T* Q;
-  BUFFER_HDR_T* p_hdr;
-  tGKI_COM_CB* p_cb = &gki_cb.com;
-
-  if (pool_id >= GKI_NUM_TOTAL_BUF_POOLS) return (NULL);
-
-  /* Make sure the buffers aren't disturbed til finished with allocation */
-  phUwb_GKI_disable();
-
-  Q = &p_cb->freeq[pool_id];
-  if (Q->cur_cnt < Q->total) {
-    if (Q->p_first == 0 && phUwb_gki_alloc_free_queue(pool_id) != true)
-      return NULL;
-
-    if (Q->p_first == 0) {
-      /* gki_alloc_free_queue() failed to alloc memory */
-      UCI_TRACE_E("fail alloc free queue");
-      return NULL;
-    }
-
-    p_hdr = Q->p_first;
-    Q->p_first = p_hdr->p_next;
-
-    if (!Q->p_first) Q->p_last = NULL;
-
-    if (++Q->cur_cnt > Q->max_cnt) Q->max_cnt = Q->cur_cnt;
-
-    phUwb_GKI_enable();
-
-    p_hdr->task_id = phUwb_GKI_get_taskid();
-
-    p_hdr->status = BUF_STATUS_UNLINKED;
-    p_hdr->p_next = NULL;
-    p_hdr->Type = 0;
-
-    return ((void*)((uint8_t*)p_hdr + BUFFER_HDR_SIZE));
-  }
-
-  /* If here, no buffers in the specified pool */
-  phUwb_GKI_enable();
-
-  /* try for free buffers in public pools */
-  return (phUwb_GKI_getbuf(p_cb->freeq[pool_id].size));
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_freebuf
-**
-** Description      Called by an application to return a buffer to the free
-**                  pool.
-**
-** Parameters       p_buf - (input) address of the beginning of a buffer.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_freebuf(void* p_buf) {
-  FREE_QUEUE_T* Q;
-  BUFFER_HDR_T* p_hdr;
-
-#if (GKI_ENABLE_BUF_CORRUPTION_CHECK == TRUE)
-  if (!p_buf || phUwb_gki_chk_buf_damage(p_buf)) {
-    phUwb_GKI_exception(GKI_ERROR_BUF_CORRUPTED, "Free - Buf Corrupted");
-    return;
-  }
-#endif
-
-  p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE);
-
-  if (p_hdr->status != BUF_STATUS_UNLINKED) {
-    phUwb_GKI_exception(GKI_ERROR_FREEBUF_BUF_LINKED, "Freeing Linked Buf");
-    return;
-  }
-
-  if (p_hdr->q_id >= GKI_NUM_TOTAL_BUF_POOLS) {
-    phUwb_GKI_exception(GKI_ERROR_FREEBUF_BAD_QID, "Bad Buf QId");
-    return;
-  }
-
-  phUwb_GKI_disable();
-
-  /*
-  ** Release the buffer
-  */
-  Q = &gki_cb.com.freeq[p_hdr->q_id];
-  if (Q->p_last)
-    Q->p_last->p_next = p_hdr;
-  else
-    Q->p_first = p_hdr;
-
-  Q->p_last = p_hdr;
-  p_hdr->p_next = NULL;
-  p_hdr->status = BUF_STATUS_FREE;
-  p_hdr->task_id = GKI_INVALID_TASK;
-  if (Q->cur_cnt > 0) Q->cur_cnt--;
-
-  phUwb_GKI_enable();
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_get_buf_size
-**
-** Description      Called by an application to get the size of a buffer.
-**
-** Parameters       p_buf - (input) address of the beginning of a buffer.
-**
-** Returns          the size of the buffer
-**
-*******************************************************************************/
-uint16_t phUwb_GKI_get_buf_size(void* p_buf) {
-  BUFFER_HDR_T* p_hdr;
-
-  p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE);
-
-  if ((uintptr_t)p_hdr & 1) return (0);
-
-  if (p_hdr->q_id < GKI_NUM_TOTAL_BUF_POOLS) {
-    return (gki_cb.com.freeq[p_hdr->q_id].size);
-  }
-
-  return (0);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_gki_chk_buf_damage
-**
-** Description      Called internally by OSS to check for buffer corruption.
-**
-** Returns          TRUE if there is a problem, else FALSE
-**
-*******************************************************************************/
-bool phUwb_gki_chk_buf_damage(void* p_buf) {
-#if (GKI_ENABLE_BUF_CORRUPTION_CHECK == TRUE)
-
-  uint32_t* magic;
-  magic = (uint32_t*)((uint8_t*)p_buf + phUwb_GKI_get_buf_size(p_buf));
-
-  if ((uintptr_t)magic & 1) return true;
-
-  if (*magic == MAGIC_NO) return false;
-
-  return true;
-
-#else
-
-  return false;
-
-#endif
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_send_msg
-**
-** Description      Called by applications to send a buffer to a task
-**
-** Returns          Nothing
-**
-*******************************************************************************/
-void phUwb_GKI_send_msg(uint8_t task_id, uint8_t mbox, void* msg) {
-  BUFFER_HDR_T* p_hdr;
-  tGKI_COM_CB* p_cb = &gki_cb.com;
-
-  /* If task non-existant or not started, drop buffer */
-  if ((task_id >= GKI_MAX_TASKS) || (mbox >= NUM_TASK_MBOX) ||
-      (p_cb->OSRdyTbl[task_id] == TASK_DEAD)) {
-    phUwb_GKI_exception(GKI_ERROR_SEND_MSG_BAD_DEST, "Sending to unknown dest");
-    phUwb_GKI_freebuf(msg);
-    return;
-  }
-
-#if (GKI_ENABLE_BUF_CORRUPTION_CHECK == TRUE)
-  if (phUwb_gki_chk_buf_damage(msg)) {
-    phUwb_GKI_exception(GKI_ERROR_BUF_CORRUPTED, "Send - Buffer corrupted");
-    return;
-  }
-#endif
-
-  p_hdr = (BUFFER_HDR_T*)((uint8_t*)msg - BUFFER_HDR_SIZE);
-
-  if (p_hdr->status != BUF_STATUS_UNLINKED) {
-    phUwb_GKI_exception(GKI_ERROR_SEND_MSG_BUF_LINKED, "Send - buffer linked");
-    return;
-  }
-
-  phUwb_GKI_disable();
-
-  if (p_cb->OSTaskQFirst[task_id][mbox])
-    p_cb->OSTaskQLast[task_id][mbox]->p_next = p_hdr;
-  else
-    p_cb->OSTaskQFirst[task_id][mbox] = p_hdr;
-
-  p_cb->OSTaskQLast[task_id][mbox] = p_hdr;
-
-  p_hdr->p_next = NULL;
-  p_hdr->status = BUF_STATUS_QUEUED;
-  p_hdr->task_id = task_id;
-
-  phUwb_GKI_enable();
-
-  phUwb_GKI_send_event(task_id, (uint16_t)EVENT_MASK(mbox));
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_read_mbox
-**
-** Description      Called by applications to read a buffer from one of
-**                  the task mailboxes.  A task can only read its own mailbox.
-**
-** Parameters:      mbox  - (input) mailbox ID to read (0, 1, 2, or 3)
-**
-** Returns          NULL if the mailbox was empty, else the address of a buffer
-**
-*******************************************************************************/
-void* phUwb_GKI_read_mbox(uint8_t mbox) {
-  uint8_t task_id = phUwb_GKI_get_taskid();
-  void* p_buf = NULL;
-  BUFFER_HDR_T* p_hdr;
-
-  if ((task_id >= GKI_MAX_TASKS) || (mbox >= NUM_TASK_MBOX)) return (NULL);
-
-  phUwb_GKI_disable();
-
-  if (gki_cb.com.OSTaskQFirst[task_id][mbox]) {
-    p_hdr = gki_cb.com.OSTaskQFirst[task_id][mbox];
-    gki_cb.com.OSTaskQFirst[task_id][mbox] = p_hdr->p_next;
-
-    p_hdr->p_next = NULL;
-    p_hdr->status = BUF_STATUS_UNLINKED;
-
-    p_buf = (uint8_t*)p_hdr + BUFFER_HDR_SIZE;
-  }
-
-  phUwb_GKI_enable();
-
-  return (p_buf);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_enqueue
-**
-** Description      Enqueue a buffer at the tail of the queue
-**
-** Parameters:      p_q  -  (input) pointer to a queue.
-**                  p_buf - (input) address of the buffer to enqueue
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_enqueue(BUFFER_Q* p_q, void* p_buf) {
-  BUFFER_HDR_T* p_hdr;
-
-#if (GKI_ENABLE_BUF_CORRUPTION_CHECK == TRUE)
-  if (phUwb_gki_chk_buf_damage(p_buf)) {
-    phUwb_GKI_exception(GKI_ERROR_BUF_CORRUPTED, "Enqueue - Buffer corrupted");
-    return;
-  }
-#endif
-
-  p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE);
-
-  if (p_hdr->status != BUF_STATUS_UNLINKED) {
-    phUwb_GKI_exception(GKI_ERROR_ENQUEUE_BUF_LINKED,
-                        "Eneueue - buf already linked");
-    return;
-  }
-
-  phUwb_GKI_disable();
-
-  /* Since the queue is exposed (C vs C++), keep the pointers in exposed format
-   */
-  if (p_q->p_first) {
-    BUFFER_HDR_T* p_last_hdr =
-        (BUFFER_HDR_T*)((uint8_t*)p_q->p_last - BUFFER_HDR_SIZE);
-    p_last_hdr->p_next = p_hdr;
-  } else
-    p_q->p_first = p_buf;
-
-  p_q->p_last = p_buf;
-  p_q->count++;
-
-  p_hdr->p_next = NULL;
-  p_hdr->status = BUF_STATUS_QUEUED;
-
-  phUwb_GKI_enable();
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_dequeue
-**
-** Description      Dequeues a buffer from the head of a queue
-**
-** Parameters:      p_q  - (input) pointer to a queue.
-**
-** Returns          NULL if queue is empty, else buffer
-**
-*******************************************************************************/
-void* phUwb_GKI_dequeue(BUFFER_Q* p_q) {
-  BUFFER_HDR_T* p_hdr;
-
-  phUwb_GKI_disable();
-
-  if (!p_q || !p_q->count) {
-    phUwb_GKI_enable();
-    return (NULL);
-  }
-
-  p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_q->p_first - BUFFER_HDR_SIZE);
-
-  /* Keep buffers such that GKI header is invisible
-   */
-  if (p_hdr->p_next)
-    p_q->p_first = ((uint8_t*)p_hdr->p_next + BUFFER_HDR_SIZE);
-  else {
-    p_q->p_first = NULL;
-    p_q->p_last = NULL;
-  }
-
-  p_q->count--;
-
-  p_hdr->p_next = NULL;
-  p_hdr->status = BUF_STATUS_UNLINKED;
-
-  phUwb_GKI_enable();
-
-  return ((uint8_t*)p_hdr + BUFFER_HDR_SIZE);
-}
-
-/********************************************************
- * The following functions are not needed for light stack
- *********************************************************/
-#ifndef BTU_STACK_LITE_ENABLED
-#define BTU_STACK_LITE_ENABLED FALSE
-#endif
diff --git a/src/gki/common/uwb_gki_common.h b/src/gki/common/uwb_gki_common.h
deleted file mode 100755
index 31621c6..0000000
--- a/src/gki/common/uwb_gki_common.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef UWB_GKI_COMMON_H
-#define UWB_GKI_COMMON_H
-
-#include "uwb_gki.h"
-
-/* Task States: (For OSRdyTbl) */
-#define TASK_DEAD 0  /* b0000 */
-#define TASK_READY 1 /* b0001 */
-
-/********************************************************************
-**  Internal Error codes
-*********************************************************************/
-#define GKI_ERROR_BUF_CORRUPTED 0xFFFF
-#define GKI_ERROR_NOT_BUF_OWNER 0xFFFE
-#define GKI_ERROR_FREEBUF_BAD_QID 0xFFFD
-#define GKI_ERROR_FREEBUF_BUF_LINKED 0xFFFC
-#define GKI_ERROR_SEND_MSG_BAD_DEST 0xFFFB
-#define GKI_ERROR_SEND_MSG_BUF_LINKED 0xFFFA
-#define GKI_ERROR_ENQUEUE_BUF_LINKED 0xFFF9
-#define GKI_ERROR_DELETE_POOL_BAD_QID 0xFFF8
-#define GKI_ERROR_BUF_SIZE_TOOBIG 0xFFF7
-#define GKI_ERROR_BUF_SIZE_ZERO 0xFFF6
-
-/********************************************************************
-**  Misc constants
-*********************************************************************/
-
-#define GKI_MAX_INT32 (0x7fffffffL)
-
-/********************************************************************
-**  Buffer Management Data Structures
-*********************************************************************/
-
-typedef struct _buffer_hdr {
-  struct _buffer_hdr* p_next; /* next buffer in the queue */
-  uint8_t q_id;               /* id of the queue */
-  uint8_t task_id;            /* task which allocated the buffer*/
-  uint8_t status;             /* FREE, UNLINKED or QUEUED */
-  uint8_t Type;
-} BUFFER_HDR_T;
-
-typedef struct _free_queue {
-  BUFFER_HDR_T* p_first; /* first buffer in the queue */
-  BUFFER_HDR_T* p_last;  /* last buffer in the queue */
-  uint16_t size;         /* size of the buffers in the pool */
-  uint16_t total;        /* toatal number of buffers */
-  uint16_t cur_cnt;      /* number of  buffers currently allocated */
-  uint16_t max_cnt;      /* maximum number of buffers allocated at any time */
-} FREE_QUEUE_T;
-
-/* Buffer related defines
- */
-#define ALIGN_POOL(pl_size) \
-  ((((pl_size) + 3) / sizeof(uint32_t)) * sizeof(uint32_t))
-/* Offset past header */
-#define BUFFER_HDR_SIZE (sizeof(BUFFER_HDR_T))
-/* Header + Magic Number */
-#define BUFFER_PADDING_SIZE (sizeof(BUFFER_HDR_T) + sizeof(uint32_t))
-/* pool size must allow for header */
-#define MAX_USER_BUF_SIZE ((uint16_t)0xffff - BUFFER_PADDING_SIZE)
-#define MAGIC_NO 0xDDBADDBA
-
-#define BUF_STATUS_FREE 0
-#define BUF_STATUS_UNLINKED 1
-#define BUF_STATUS_QUEUED 2
-
-/* Put all GKI variables into one control block
- */
-typedef struct {
-  /* Task management variables
-   */
-  /* The stack and stack size are not used on Windows
-   */
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 0)
-  uint8_t bufpool0[(ALIGN_POOL(GKI_BUF0_SIZE) + BUFFER_PADDING_SIZE) *
-                   GKI_BUF0_MAX];
-#endif
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 1)
-  uint8_t bufpool1[(ALIGN_POOL(GKI_BUF1_SIZE) + BUFFER_PADDING_SIZE) *
-                   GKI_BUF1_MAX];
-#endif
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 2)
-  uint8_t bufpool2[(ALIGN_POOL(GKI_BUF2_SIZE) + BUFFER_PADDING_SIZE) *
-                   GKI_BUF2_MAX];
-#endif
-
-#if (GKI_NUM_FIXED_BUF_POOLS > 3)
-  uint8_t bufpool3[(ALIGN_POOL(GKI_BUF3_SIZE) + BUFFER_PADDING_SIZE) *
-                   GKI_BUF3_MAX];
-#endif
-
-  uint8_t* OSStack[GKI_MAX_TASKS];     /* pointer to beginning of stack */
-  uint16_t OSStackSize[GKI_MAX_TASKS]; /* stack size available to each task */
-
-  int8_t* OSTName[GKI_MAX_TASKS]; /* name of the task */
-
-  uint8_t OSRdyTbl[GKI_MAX_TASKS];   /* current state of the task */
-  uint16_t OSWaitEvt[GKI_MAX_TASKS]; /* events that have to be processed by the
-                                        task */
-  uint16_t OSWaitForEvt[GKI_MAX_TASKS]; /* events the task is waiting for*/
-
-  uint32_t OSTicks;   /* system ticks from start */
-  uint32_t OSIdleCnt; /* idle counter */
-  int16_t
-      OSDisableNesting; /* counter to keep track of interrupt disable nesting */
-  int16_t OSLockNesting; /* counter to keep track of sched lock nesting */
-  int16_t OSIntNesting;  /* counter to keep track of interrupt nesting */
-
-  /* Timer related variables
-   */
-  int32_t OSTicksTilExp; /* Number of ticks till next timer expires */
-#if (GKI_DELAY_STOP_SYS_TICK > 0)
-  uint32_t OSTicksTilStop; /* inactivity delay timer; OS Ticks till stopping
-                              system tick */
-#endif
-  int32_t OSNumOrigTicks; /* Number of ticks between last timer expiration to
-                             the next one */
-
-  int32_t OSWaitTmr[GKI_MAX_TASKS]; /* ticks the task has to wait, for specific
-                                       events */
-
-/* Only take up space timers used in the system (GKI_NUM_TIMERS defined in
- * target.h) */
-#if (GKI_NUM_TIMERS > 0)
-  int32_t OSTaskTmr0[GKI_MAX_TASKS];
-  int32_t OSTaskTmr0R[GKI_MAX_TASKS];
-#endif
-
-#if (GKI_NUM_TIMERS > 1)
-  int32_t OSTaskTmr1[GKI_MAX_TASKS];
-  int32_t OSTaskTmr1R[GKI_MAX_TASKS];
-#endif
-
-#if (GKI_NUM_TIMERS > 2)
-  int32_t OSTaskTmr2[GKI_MAX_TASKS];
-  int32_t OSTaskTmr2R[GKI_MAX_TASKS];
-#endif
-
-#if (GKI_NUM_TIMERS > 3)
-  int32_t OSTaskTmr3[GKI_MAX_TASKS];
-  int32_t OSTaskTmr3R[GKI_MAX_TASKS];
-#endif
-
-  /* Buffer related variables
-   */
-  BUFFER_HDR_T* OSTaskQFirst[GKI_MAX_TASKS]
-                            [NUM_TASK_MBOX]; /* array of pointers to the first
-                                                event in the task mailbox */
-  BUFFER_HDR_T* OSTaskQLast[GKI_MAX_TASKS]
-                           [NUM_TASK_MBOX]; /* array of pointers to the last
-                                               event in the task mailbox */
-
-  /* Define the buffer pool management variables
-   */
-  FREE_QUEUE_T freeq[GKI_NUM_TOTAL_BUF_POOLS];
-
-  uint16_t pool_buf_size[GKI_NUM_TOTAL_BUF_POOLS];
-  uint16_t pool_max_count[GKI_NUM_TOTAL_BUF_POOLS];
-  uint16_t pool_additions[GKI_NUM_TOTAL_BUF_POOLS];
-
-  /* Define the buffer pool start addresses
-   */
-  uint8_t* pool_start[GKI_NUM_TOTAL_BUF_POOLS]; /* array of pointers to the
-                                                   start of each buffer pool */
-  uint8_t* pool_end[GKI_NUM_TOTAL_BUF_POOLS]; /* array of pointers to the end of
-                                                 each buffer pool */
-  uint16_t pool_size[GKI_NUM_TOTAL_BUF_POOLS]; /* actual size of the buffers in
-                                                  a pool */
-
-  /* Define the buffer pool access control variables */
-  void* p_user_mempool;      /* User O/S memory pool */
-  uint16_t pool_access_mask; /* Bits are set if the corresponding buffer pool is
-                                a restricted pool */
-  uint8_t pool_list[GKI_NUM_TOTAL_BUF_POOLS]; /* buffer pools arranged in the
-                                                 order of size */
-  uint8_t curr_total_no_of_pools; /* number of fixed buf pools + current number
-                                     of dynamic pools */
-
-  bool timer_nesting; /* flag to prevent timer interrupt nesting */
-
-  /* Time queue arrays */
-  TIMER_LIST_Q* timer_queues[GKI_MAX_TIMER_QUEUES];
-  /* System tick callback */
-  SYSTEM_TICK_CBACK* p_tick_cb;
-  bool system_tick_running; /* TRUE if system tick is running. Valid only if
-                               p_tick_cb is not NULL */
-
-} tGKI_COM_CB;
-
-/* Internal GKI function prototypes
- */
-extern bool phUwb_gki_chk_buf_damage(void*);
-extern void phUwb_gki_buffer_init(void);
-extern void phUwb_gki_timers_init(void);
-extern void phUwb_gki_adjust_timer_count(int32_t);
-
-#endif
diff --git a/src/gki/common/uwb_gki_time.cc b/src/gki/common/uwb_gki_time.cc
deleted file mode 100755
index ad314a0..0000000
--- a/src/gki/common/uwb_gki_time.cc
+++ /dev/null
@@ -1,873 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#include "uwb_gki.h"
-#include "uwb_gki_int.h"
-
-/* Make sure that this has been defined in target.h */
-#ifndef GKI_NUM_TIMERS
-#error NO TIMERS: Must define at least 1 timer in the system!
-#endif
-
-/* Largest signed positive timer count */
-#define GKI_NO_NEW_TMRS_STARTED (0x7fffffffL)
-/* Marks an unused timer list entry (initial value) */
-#define GKI_UNUSED_LIST_ENTRY (0x80000000L)
-#define GKI_MAX_INT32 (0x7fffffffL)
-
-#include "uci_log.h"
-
-/*******************************************************************************
-**
-** Function         phUwb_gki_timers_init
-**
-** Description      This internal function is called once at startup to
-**                  initialize all the timer structures.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_gki_timers_init(void) {
-  uint8_t tt;
-
-  gki_cb.com.OSTicksTilExp =
-      0; /* Remaining time (of OSTimeCurTimeout) before next timer expires */
-  gki_cb.com.OSNumOrigTicks = 0;
-#if (GKI_DELAY_STOP_SYS_TICK > 0)
-  gki_cb.com.OSTicksTilStop = 0; /* clear inactivity delay timer */
-#endif
-
-  for (tt = 0; tt < GKI_MAX_TASKS; tt++) {
-    gki_cb.com.OSWaitTmr[tt] = 0;
-
-#if (GKI_NUM_TIMERS > 0)
-    gki_cb.com.OSTaskTmr0[tt] = 0;
-    gki_cb.com.OSTaskTmr0R[tt] = 0;
-#endif
-
-#if (GKI_NUM_TIMERS > 1)
-    gki_cb.com.OSTaskTmr1[tt] = 0;
-    gki_cb.com.OSTaskTmr1R[tt] = 0;
-#endif
-
-#if (GKI_NUM_TIMERS > 2)
-    gki_cb.com.OSTaskTmr2[tt] = 0;
-    gki_cb.com.OSTaskTmr2R[tt] = 0;
-#endif
-
-#if (GKI_NUM_TIMERS > 3)
-    gki_cb.com.OSTaskTmr3[tt] = 0;
-    gki_cb.com.OSTaskTmr3R[tt] = 0;
-#endif
-  }
-
-  for (tt = 0; tt < GKI_MAX_TIMER_QUEUES; tt++) {
-    gki_cb.com.timer_queues[tt] = NULL;
-  }
-
-  gki_cb.com.p_tick_cb = NULL;
-  gki_cb.com.system_tick_running = false;
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_gki_timers_is_timer_running
-**
-** Description      This internal function is called to test if any gki timer
-**                  are running
-**
-**
-** Returns          TRUE if at least one time is running in the system, FALSE
-**                  else.
-**
-*******************************************************************************/
-bool phUwb_gki_timers_is_timer_running(void) {
-  uint8_t tt;
-  for (tt = 0; tt < GKI_MAX_TASKS; tt++) {
-#if (GKI_NUM_TIMERS > 0)
-    if (gki_cb.com.OSTaskTmr0[tt]) {
-      return true;
-    }
-#endif
-
-#if (GKI_NUM_TIMERS > 1)
-    if (gki_cb.com.OSTaskTmr1[tt]) {
-      return true;
-    }
-#endif
-
-#if (GKI_NUM_TIMERS > 2)
-    if (gki_cb.com.OSTaskTmr2[tt]) {
-      return true;
-    }
-#endif
-
-#if (GKI_NUM_TIMERS > 3)
-    if (gki_cb.com.OSTaskTmr3[tt]) {
-      return true;
-    }
-#endif
-  }
-
-  return false;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_get_tick_count
-**
-** Description      This function returns the current system ticks
-**
-** Returns          The current number of system ticks
-**
-*******************************************************************************/
-uint32_t phUwb_GKI_get_tick_count(void) { return gki_cb.com.OSTicks; }
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_start_timer
-**
-** Description      An application can call this function to start one of
-**                  it's four general purpose timers. Any of the four timers
-**                  can be 1-shot or continuous. If a timer is already running,
-**                  it will be reset to the new parameters.
-**
-** Parameters       tnum            - (input) timer number to be started
-**                                            (TIMER_0, TIMER_1, TIMER_2, or
-**                                            TIMER_3)
-**                  ticks           - (input) the number of system ticks til the
-**                                            timer expires.
-**                  is_continuous   - (input) TRUE if timer restarts
-**                                            automatically, else FALSE if it is
-**                                            a 'one-shot'.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_start_timer(uint8_t tnum, int32_t ticks, bool is_continuous) {
-  int32_t reload;
-  int32_t orig_ticks;
-  uint8_t task_id = phUwb_GKI_get_taskid();
-  bool bad_timer = false;
-
-  if (ticks <= 0) ticks = 1;
-
-  orig_ticks = ticks; /* save the ticks in case adjustment is necessary */
-
-  /* If continuous timer, set reload, else set it to 0 */
-  if (is_continuous)
-    reload = ticks;
-  else
-    reload = 0;
-
-  phUwb_GKI_disable();
-
-  if (phUwb_gki_timers_is_timer_running() == false) {
-#if (GKI_DELAY_STOP_SYS_TICK > 0)
-    /* if inactivity delay timer is not running, start system tick */
-    if (gki_cb.com.OSTicksTilStop == 0) {
-#endif
-      if (gki_cb.com.p_tick_cb) {
-        /* start system tick */
-        gki_cb.com.system_tick_running = true;
-        (gki_cb.com.p_tick_cb)(true);
-      }
-#if (GKI_DELAY_STOP_SYS_TICK > 0)
-    } else {
-      /* clear inactivity delay timer */
-      gki_cb.com.OSTicksTilStop = 0;
-    }
-#endif
-  }
-  /* Add the time since the last task timer update.
-  ** Note that this works when no timers are active since
-  ** both OSNumOrigTicks and OSTicksTilExp are 0.
-  */
-  if (GKI_MAX_INT32 - (gki_cb.com.OSNumOrigTicks - gki_cb.com.OSTicksTilExp) >
-      ticks) {
-    ticks += gki_cb.com.OSNumOrigTicks - gki_cb.com.OSTicksTilExp;
-  } else
-    ticks = GKI_MAX_INT32;
-
-  switch (tnum) {
-#if (GKI_NUM_TIMERS > 0)
-    case TIMER_0:
-      gki_cb.com.OSTaskTmr0R[task_id] = reload;
-      gki_cb.com.OSTaskTmr0[task_id] = ticks;
-      break;
-#endif
-
-#if (GKI_NUM_TIMERS > 1)
-    case TIMER_1:
-      gki_cb.com.OSTaskTmr1R[task_id] = reload;
-      gki_cb.com.OSTaskTmr1[task_id] = ticks;
-      break;
-#endif
-
-#if (GKI_NUM_TIMERS > 2)
-    case TIMER_2:
-      gki_cb.com.OSTaskTmr2R[task_id] = reload;
-      gki_cb.com.OSTaskTmr2[task_id] = ticks;
-      break;
-#endif
-
-#if (GKI_NUM_TIMERS > 3)
-    case TIMER_3:
-      gki_cb.com.OSTaskTmr3R[task_id] = reload;
-      gki_cb.com.OSTaskTmr3[task_id] = ticks;
-      break;
-#endif
-    default:
-      bad_timer = true; /* Timer number is bad, so do not use */
-  }
-
-  /* Update the expiration timeout if a legitimate timer */
-  if (!bad_timer) {
-    /* Only update the timeout value if it is less than any other newly started
-     * timers */
-    phUwb_gki_adjust_timer_count(orig_ticks);
-  }
-
-  phUwb_GKI_enable();
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_stop_timer
-**
-** Description      An application can call this function to stop one of
-**                  it's four general purpose timers. There is no harm in
-**                  stopping a timer that is already stopped.
-**
-** Parameters       tnum - (input) timer number to be started (TIMER_0,
-**                                 TIMER_1, TIMER_2, or TIMER_3)
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_stop_timer(uint8_t tnum, int value) {
-  uint8_t task_id = phUwb_GKI_get_taskid();
-  value = 0;
-  phUwb_GKI_disable();
-
-  switch (tnum) {
-#if (GKI_NUM_TIMERS > 0)
-    case TIMER_0:
-      gki_cb.com.OSTaskTmr0R[task_id] = 0;
-      gki_cb.com.OSTaskTmr0[task_id] = 0;
-      break;
-#endif
-
-#if (GKI_NUM_TIMERS > 1)
-    case TIMER_1:
-      gki_cb.com.OSTaskTmr1R[task_id] = 0;
-      gki_cb.com.OSTaskTmr1[task_id] = 0;
-      break;
-#endif
-
-#if (GKI_NUM_TIMERS > 2)
-    case TIMER_2:
-      gki_cb.com.OSTaskTmr2R[task_id] = 0;
-      gki_cb.com.OSTaskTmr2[task_id] = 0;
-      break;
-#endif
-
-#if (GKI_NUM_TIMERS > 3)
-    case TIMER_3:
-      gki_cb.com.OSTaskTmr3R[task_id] = 0;
-      gki_cb.com.OSTaskTmr3[task_id] = 0;
-      break;
-#endif
-  }
-
-  if (phUwb_gki_timers_is_timer_running() == false) {
-    if (gki_cb.com.p_tick_cb) {
-#if (GKI_DELAY_STOP_SYS_TICK > 0)
-      /* if inactivity delay timer is not running */
-      if ((gki_cb.com.system_tick_running) &&
-          (gki_cb.com.OSTicksTilStop == 0)) {
-        /* set inactivity delay timer */
-        /* when timer expires, system tick will be stopped */
-        gki_cb.com.OSTicksTilStop = GKI_DELAY_STOP_SYS_TICK;
-      }
-#else
-      gki_cb.com.system_tick_running = false;
-      (gki_cb.com.p_tick_cb)(false); /* stop system tick */
-#endif
-    }
-  }
-
-  phUwb_GKI_enable();
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_timer_update
-**
-** Description      This function is called by an OS to drive the GKI's timers.
-**                  It is typically called at every system tick to
-**                  update the timers for all tasks, and check for timeouts.
-**
-**                  Note: It has been designed to also allow for variable tick
-**                        updates so that systems with strict power savings
-**                        requirements can have the update occur at variable
-**                        intervals.
-**
-** Parameters:      ticks_since_last_update - (input) This is the number of
-**                  TICKS that have occurred since the last time
-**                  GKI_timer_update was called.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_timer_update(uint32_t ticks_since_last_update) {
-  uint8_t task_id;
-  int32_t next_expiration; /* Holds the next soonest expiration time after this
-                           update */
-
-  /* Increment the number of ticks used for time stamps */
-  gki_cb.com.OSTicks += ticks_since_last_update;
-
-  /* If any timers are running in any tasks, decrement the remaining time til
-   * the timer updates need to take place (next expiration occurs)
-   */
-  gki_cb.com.OSTicksTilExp -= ticks_since_last_update;
-
-  /* Don't allow timer interrupt nesting */
-  if (gki_cb.com.timer_nesting) return;
-
-  gki_cb.com.timer_nesting = 1;
-
-  phUwb_GKI_disable();
-
-#if (GKI_DELAY_STOP_SYS_TICK > 0)
-  /* if inactivity delay timer is set and expired */
-  if (gki_cb.com.OSTicksTilStop) {
-    if (gki_cb.com.OSTicksTilStop <= (uint32_t)ticks_since_last_update) {
-      if (gki_cb.com.p_tick_cb) {
-        gki_cb.com.system_tick_running = false;
-        (gki_cb.com.p_tick_cb)(false); /* stop system tick */
-      }
-      gki_cb.com.OSTicksTilStop = 0; /* clear inactivity delay timer */
-      gki_cb.com.timer_nesting = 0;
-      phUwb_GKI_enable();
-      return;
-    } else
-      gki_cb.com.OSTicksTilStop -= ticks_since_last_update;
-  }
-#endif
-
-  /* No need to update the ticks if no timeout has occurred */
-  if (gki_cb.com.OSTicksTilExp > 0) {
-    gki_cb.com.timer_nesting = 0;
-    phUwb_GKI_enable();
-    return;
-  }
-
-  next_expiration = GKI_NO_NEW_TMRS_STARTED;
-
-  /* If here then gki_cb.com.OSTicksTilExp <= 0. If negative, then increase
-     gki_cb.com.OSNumOrigTicks
-     to account for the difference so timer updates below are decremented by the
-     full number
-     of ticks. gki_cb.com.OSNumOrigTicks is reset at the bottom of this function
-     so changing this
-     value only affects the timer updates below
-   */
-  gki_cb.com.OSNumOrigTicks -= gki_cb.com.OSTicksTilExp;
-
-  /* Check for OS Task Timers */
-  for (task_id = 0; task_id < GKI_MAX_TASKS; task_id++) {
-    if (gki_cb.com.OSRdyTbl[task_id] == TASK_DEAD) {
-      // task is shutdown do not try to service timers
-      continue;
-    }
-
-    if (gki_cb.com.OSWaitTmr[task_id] > 0) /* If timer is running */
-    {
-      gki_cb.com.OSWaitTmr[task_id] -= gki_cb.com.OSNumOrigTicks;
-      if (gki_cb.com.OSWaitTmr[task_id] <= 0) {
-        /* Timer Expired */
-        gki_cb.com.OSRdyTbl[task_id] = TASK_READY;
-      }
-    }
-
-#if (GKI_NUM_TIMERS > 0)
-    /* If any timer is running, decrement */
-    if (gki_cb.com.OSTaskTmr0[task_id] > 0) {
-      gki_cb.com.OSTaskTmr0[task_id] -= gki_cb.com.OSNumOrigTicks;
-
-      if (gki_cb.com.OSTaskTmr0[task_id] <= 0) {
-/* Set Timer 0 Expired event mask and reload timer */
-#if (GKI_TIMER_UPDATES_FROM_ISR == TRUE)
-        phUwb_GKI_isend_event(task_id, TIMER_0_EVT_MASK);
-#else
-        phUwb_GKI_send_event(task_id, TIMER_0_EVT_MASK);
-#endif
-        gki_cb.com.OSTaskTmr0[task_id] = gki_cb.com.OSTaskTmr0R[task_id];
-      }
-    }
-
-    /* Check to see if this timer is the next one to expire */
-    if (gki_cb.com.OSTaskTmr0[task_id] > 0 &&
-        gki_cb.com.OSTaskTmr0[task_id] < next_expiration)
-      next_expiration = gki_cb.com.OSTaskTmr0[task_id];
-#endif
-
-#if (GKI_NUM_TIMERS > 1)
-    /* If any timer is running, decrement */
-    if (gki_cb.com.OSTaskTmr1[task_id] > 0) {
-      gki_cb.com.OSTaskTmr1[task_id] -= gki_cb.com.OSNumOrigTicks;
-
-      if (gki_cb.com.OSTaskTmr1[task_id] <= 0) {
-/* Set Timer 1 Expired event mask and reload timer */
-#if (GKI_TIMER_UPDATES_FROM_ISR == TRUE)
-        phUwb_GKI_isend_event(task_id, TIMER_1_EVT_MASK);
-#else
-        phUwb_GKI_send_event(task_id, TIMER_1_EVT_MASK);
-#endif
-        gki_cb.com.OSTaskTmr1[task_id] = gki_cb.com.OSTaskTmr1R[task_id];
-      }
-    }
-
-    /* Check to see if this timer is the next one to expire */
-    if (gki_cb.com.OSTaskTmr1[task_id] > 0 &&
-        gki_cb.com.OSTaskTmr1[task_id] < next_expiration)
-      next_expiration = gki_cb.com.OSTaskTmr1[task_id];
-#endif
-
-#if (GKI_NUM_TIMERS > 2)
-    /* If any timer is running, decrement */
-    if (gki_cb.com.OSTaskTmr2[task_id] > 0) {
-      gki_cb.com.OSTaskTmr2[task_id] -= gki_cb.com.OSNumOrigTicks;
-
-      if (gki_cb.com.OSTaskTmr2[task_id] <= 0) {
-/* Set Timer 2 Expired event mask and reload timer */
-#if (GKI_TIMER_UPDATES_FROM_ISR == TRUE)
-        phUwb_GKI_isend_event(task_id, TIMER_2_EVT_MASK);
-#else
-        phUwb_GKI_send_event(task_id, TIMER_2_EVT_MASK);
-#endif
-        gki_cb.com.OSTaskTmr2[task_id] = gki_cb.com.OSTaskTmr2R[task_id];
-      }
-    }
-
-    /* Check to see if this timer is the next one to expire */
-    if (gki_cb.com.OSTaskTmr2[task_id] > 0 &&
-        gki_cb.com.OSTaskTmr2[task_id] < next_expiration)
-      next_expiration = gki_cb.com.OSTaskTmr2[task_id];
-#endif
-
-#if (GKI_NUM_TIMERS > 3)
-    /* If any timer is running, decrement */
-    if (gki_cb.com.OSTaskTmr3[task_id] > 0) {
-      gki_cb.com.OSTaskTmr3[task_id] -= gki_cb.com.OSNumOrigTicks;
-
-      if (gki_cb.com.OSTaskTmr3[task_id] <= 0) {
-/* Set Timer 3 Expired event mask and reload timer */
-#if (GKI_TIMER_UPDATES_FROM_ISR == TRUE)
-        phUwb_GKI_isend_event(task_id, TIMER_3_EVT_MASK);
-#else
-        phUwb_GKI_send_event(task_id, TIMER_3_EVT_MASK);
-#endif
-        gki_cb.com.OSTaskTmr3[task_id] = gki_cb.com.OSTaskTmr3R[task_id];
-      }
-    }
-
-    /* Check to see if this timer is the next one to expire */
-    if (gki_cb.com.OSTaskTmr3[task_id] > 0 &&
-        gki_cb.com.OSTaskTmr3[task_id] < next_expiration)
-      next_expiration = gki_cb.com.OSTaskTmr3[task_id];
-#endif
-  }
-
-  /* Set the next timer experation value if there is one to start */
-  if (next_expiration < GKI_NO_NEW_TMRS_STARTED) {
-    gki_cb.com.OSTicksTilExp = gki_cb.com.OSNumOrigTicks = next_expiration;
-  } else {
-    gki_cb.com.OSTicksTilExp = gki_cb.com.OSNumOrigTicks = 0;
-  }
-
-  gki_cb.com.timer_nesting = 0;
-
-  phUwb_GKI_enable();
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_timer_queue_register_callback
-**
-** Description      This function is called by applications to register system
-**                  tick start/stop callback for time queues
-**
-**
-** Parameters       p_callback - (input) pointer to the system tick callback
-**
-** Returns          bool
-**
-*******************************************************************************/
-void phUwb_GKI_timer_queue_register_callback(SYSTEM_TICK_CBACK* p_callback) {
-  gki_cb.com.p_tick_cb = p_callback;
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_init_timer_list
-**
-** Description      This function is called by applications when they
-**                  want to initialize a timer list.
-**
-** Parameters       p_timer_listq - (input) pointer to the timer list queue
-**                                          object
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_init_timer_list(TIMER_LIST_Q* p_timer_listq) {
-  p_timer_listq->p_first = NULL;
-  p_timer_listq->p_last = NULL;
-  p_timer_listq->last_ticks = 0;
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_update_timer_list
-**
-** Description      This function is called by the applications when they
-**                  want to update a timer list. This should be at every
-**                  timer list unit tick, e.g. once per sec, once per minute
-**                  etc.
-**
-** Parameters       p_timer_listq - (input) pointer to the timer list queue
-**                  object
-**                  num_units_since_last_update - (input) number of units since
-**                  the last update (allows for variable unit update)
-**
-** NOTE: The following timer list update routines should not be used for exact
-**       time critical purposes.  The timer tasks should be used when exact
-**       timing is needed.
-**
-** Returns          the number of timers that have expired
-**
-*******************************************************************************/
-uint16_t phUwb_GKI_update_timer_list(TIMER_LIST_Q* p_timer_listq,
-                                     uint32_t num_units_since_last_update) {
-  TIMER_LIST_ENT* p_tle;
-  uint16_t num_time_out = 0;
-  uint32_t rem_ticks;
-  uint32_t temp_ticks;
-
-  p_tle = p_timer_listq->p_first;
-
-  /* First, get the guys who have previously timed out */
-  /* Note that the tick value of the timers should always be '0' */
-  while ((p_tle) && (p_tle->ticks <= 0)) {
-    num_time_out++;
-    p_tle = p_tle->p_next;
-  }
-
-  /* Timer entriy tick values are relative to the preceeding entry */
-  rem_ticks = num_units_since_last_update;
-
-  /* Now, adjust remaining timer entries */
-  while ((p_tle != NULL) && (rem_ticks > 0)) {
-    temp_ticks = p_tle->ticks;
-    p_tle->ticks -= rem_ticks;
-
-    /* See if this timer has just timed out */
-    if (p_tle->ticks <= 0) {
-      /* We set the number of ticks to '0' so that the legacy code
-       * that assumes a '0' or nonzero value will still work as coded. */
-      p_tle->ticks = 0;
-
-      num_time_out++;
-    }
-
-    rem_ticks -= temp_ticks; /* Decrement the remaining ticks to process */
-    p_tle = p_tle->p_next;
-  }
-
-  if (p_timer_listq->last_ticks > 0) {
-    p_timer_listq->last_ticks -= num_units_since_last_update;
-
-    /* If the last timer has expired set last_ticks to 0 so that other list
-     * update
-     * functions will calculate correctly
-     */
-    if (p_timer_listq->last_ticks < 0) p_timer_listq->last_ticks = 0;
-  }
-
-  return (num_time_out);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_get_remaining_ticks
-**
-** Description      This function is called by an application to get remaining
-**                  ticks to expire
-**
-** Parameters       p_timer_listq - (input) pointer to the timer list queue
-**                                          object
-**                  p_target_tle - (input) pointer to a timer list queue entry
-**
-** Returns          0 if timer is not used or timer is not in the list
-**                  remaining ticks if success
-**
-*******************************************************************************/
-uint32_t phUwb_GKI_get_remaining_ticks(TIMER_LIST_Q* p_timer_listq,
-                                       TIMER_LIST_ENT* p_target_tle) {
-  TIMER_LIST_ENT* p_tle;
-  uint32_t rem_ticks = 0;
-
-  if (p_target_tle->in_use) {
-    p_tle = p_timer_listq->p_first;
-
-    /* adding up all of ticks in previous entries */
-    while ((p_tle) && (p_tle != p_target_tle)) {
-      rem_ticks += p_tle->ticks;
-      p_tle = p_tle->p_next;
-    }
-
-    /* if found target entry */
-    if (p_tle == p_target_tle) {
-      rem_ticks += p_tle->ticks;
-    } else {
-      UCI_TRACE_E("GKI_get_remaining_ticks: No timer entry in the list");
-      return (0);
-    }
-  } else {
-    UCI_TRACE_E("GKI_get_remaining_ticks: timer entry is not active");
-  }
-
-  return (rem_ticks);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_add_to_timer_list
-**
-** Description      This function is called by an application to add a timer
-**                  entry to a timer list.
-**
-**                  Note: A timer value of '0' will effectively insert an
-**                        already expired event.  Negative tick values will be
-**                        ignored.
-**
-** Parameters       p_timer_listq - (input) pointer to the timer list queue
-**                                          object
-**                  p_tle - (input) pointer to a timer list queue entry
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_add_to_timer_list(TIMER_LIST_Q* p_timer_listq,
-                                 TIMER_LIST_ENT* p_tle) {
-  uint32_t nr_ticks_total;
-  uint8_t tt;
-  TIMER_LIST_ENT* p_temp;
-  if (p_tle == NULL || p_timer_listq == NULL) {
-    UCI_TRACE_I("%s: invalid argument %p, %p****************************<<",
-                __func__, p_timer_listq, p_tle);
-    return;
-  }
-
-  /* Only process valid tick values */
-  if (p_tle->ticks >= 0) {
-    /* If this entry is the last in the list */
-    if (p_tle->ticks >= p_timer_listq->last_ticks) {
-      /* If this entry is the only entry in the list */
-      if (p_timer_listq->p_first == NULL)
-        p_timer_listq->p_first = p_tle;
-      else {
-        /* Insert the entry onto the end of the list */
-        if (p_timer_listq->p_last != NULL)
-          p_timer_listq->p_last->p_next = p_tle;
-
-        p_tle->p_prev = p_timer_listq->p_last;
-      }
-
-      p_tle->p_next = NULL;
-      p_timer_listq->p_last = p_tle;
-      nr_ticks_total = p_tle->ticks;
-      p_tle->ticks -= p_timer_listq->last_ticks;
-
-      p_timer_listq->last_ticks = nr_ticks_total;
-    } else /* This entry needs to be inserted before the last entry */
-    {
-      /* Find the entry that the new one needs to be inserted in front of */
-      p_temp = p_timer_listq->p_first;
-      while (p_tle->ticks > p_temp->ticks) {
-        /* Update the tick value if looking at an unexpired entry */
-        if (p_temp->ticks > 0) p_tle->ticks -= p_temp->ticks;
-
-        p_temp = p_temp->p_next;
-      }
-
-      /* The new entry is the first in the list */
-      if (p_temp == p_timer_listq->p_first) {
-        p_tle->p_next = p_timer_listq->p_first;
-        p_timer_listq->p_first->p_prev = p_tle;
-        p_timer_listq->p_first = p_tle;
-      } else {
-        p_temp->p_prev->p_next = p_tle;
-        p_tle->p_prev = p_temp->p_prev;
-        p_temp->p_prev = p_tle;
-        p_tle->p_next = p_temp;
-      }
-      p_temp->ticks -= p_tle->ticks;
-    }
-
-    p_tle->in_use = true;
-
-    /* if we already add this timer queue to the array */
-    for (tt = 0; tt < GKI_MAX_TIMER_QUEUES; tt++) {
-      if (gki_cb.com.timer_queues[tt] == p_timer_listq) return;
-    }
-    /* add this timer queue to the array */
-    for (tt = 0; tt < GKI_MAX_TIMER_QUEUES; tt++) {
-      if (gki_cb.com.timer_queues[tt] == NULL) break;
-    }
-    if (tt < GKI_MAX_TIMER_QUEUES) {
-      gki_cb.com.timer_queues[tt] = p_timer_listq;
-    }
-  }
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_remove_from_timer_list
-**
-** Description      This function is called by an application to remove a timer
-**                  entry from a timer list.
-**
-** Parameters       p_timer_listq  - (input) pointer to the timer list queue
-**                                            object
-**                  p_tle - (input) pointer to a timer list queue entry
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_remove_from_timer_list(TIMER_LIST_Q* p_timer_listq,
-                                      TIMER_LIST_ENT* p_tle) {
-  uint8_t tt;
-
-  /* Verify that the entry is valid */
-  if (p_tle == NULL || p_tle->in_use == false ||
-      p_timer_listq->p_first == NULL) {
-    return;
-  }
-
-  /* Add the ticks remaining in this timer (if any) to the next guy in the list.
-  ** Note: Expired timers have a tick value of '0'.
-  */
-  if (p_tle->p_next != NULL) {
-    p_tle->p_next->ticks += p_tle->ticks;
-  } else {
-    p_timer_listq->last_ticks -= p_tle->ticks;
-  }
-
-  /* Unlink timer from the list.
-   */
-  if (p_timer_listq->p_first == p_tle) {
-    p_timer_listq->p_first = p_tle->p_next;
-
-    if (p_timer_listq->p_first != NULL) p_timer_listq->p_first->p_prev = NULL;
-
-    if (p_timer_listq->p_last == p_tle) p_timer_listq->p_last = NULL;
-  } else {
-    if (p_timer_listq->p_last == p_tle) {
-      p_timer_listq->p_last = p_tle->p_prev;
-
-      if (p_timer_listq->p_last != NULL) p_timer_listq->p_last->p_next = NULL;
-    } else {
-      if (p_tle->p_next != NULL && p_tle->p_next->p_prev == p_tle)
-        p_tle->p_next->p_prev = p_tle->p_prev;
-      else {
-        /* Error case - chain messed up ?? */
-        return;
-      }
-
-      if (p_tle->p_prev != NULL && p_tle->p_prev->p_next == p_tle)
-        p_tle->p_prev->p_next = p_tle->p_next;
-      else {
-        /* Error case - chain messed up ?? */
-        return;
-      }
-    }
-  }
-
-  p_tle->p_next = p_tle->p_prev = NULL;
-  p_tle->ticks = GKI_UNUSED_LIST_ENTRY;
-  p_tle->in_use = false;
-
-  /* if timer queue is empty */
-  if (p_timer_listq->p_first == NULL && p_timer_listq->p_last == NULL) {
-    for (tt = 0; tt < GKI_MAX_TIMER_QUEUES; tt++) {
-      if (gki_cb.com.timer_queues[tt] == p_timer_listq) {
-        gki_cb.com.timer_queues[tt] = NULL;
-        break;
-      }
-    }
-  }
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_gki_adjust_timer_count
-**
-** Description      This function is called whenever a new timer or GKI_wait
-**                  occurs to adjust (if necessary) the current time til the
-**                  first expiration. This only needs to make an adjustment if
-**                  the new timer (in ticks) is less than the number of ticks
-**                  remaining on the current timer.
-**
-** Parameters:      ticks - (input) number of system ticks of the new timer
-**                                  entry
-**
-**                  NOTE:  This routine MUST be called while interrupts are
-**                         disabled to avoid updates while adjusting the timer
-**                         variables.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_gki_adjust_timer_count(int32_t ticks) {
-  if (ticks > 0) {
-    /* See if the new timer expires before the current first expiration */
-    if (gki_cb.com.OSNumOrigTicks == 0 ||
-        (ticks < gki_cb.com.OSTicksTilExp && gki_cb.com.OSTicksTilExp > 0)) {
-      gki_cb.com.OSNumOrigTicks =
-          (gki_cb.com.OSNumOrigTicks - gki_cb.com.OSTicksTilExp) + ticks;
-      gki_cb.com.OSTicksTilExp = ticks;
-    }
-  }
-
-  return;
-}
diff --git a/src/gki/ulinux/data_types.h b/src/gki/ulinux/data_types.h
deleted file mode 100755
index bbc478f..0000000
--- a/src/gki/ulinux/data_types.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef DATA_TYPES_H
-#define DATA_TYPES_H
-
-#include <stdbool.h>
-#include <stdint.h>
-#ifndef false
-#define false 0
-#endif
-
-#ifndef true
-#define true (!false)
-#endif
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE (!FALSE)
-#endif
-
-#ifdef __arm
-#define PACKED __packed
-#define INLINE __inline
-#else
-#define PACKED
-#define INLINE
-#endif
-
-#ifndef BIG_ENDIAN
-#define BIG_ENDIAN FALSE
-#endif
-
-#endif
diff --git a/src/gki/ulinux/uwb_gki_int.h b/src/gki/ulinux/uwb_gki_int.h
deleted file mode 100755
index 9915ae0..0000000
--- a/src/gki/ulinux/uwb_gki_int.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef UWB_GKI_INT_H
-#define UWB_GKI_INT_H
-
-#include <pthread.h>
-
-#include "uwb_gki_common.h"
-
-/**********************************************************************
-** OS specific definitions
-*/
-#ifdef ANDROID
-#include <sys/times.h>
-#endif
-
-typedef struct {
-  pthread_mutex_t GKI_mutex;
-  pthread_t thread_id[GKI_MAX_TASKS];
-  pthread_mutex_t thread_evt_mutex[GKI_MAX_TASKS];
-  pthread_cond_t thread_evt_cond[GKI_MAX_TASKS];
-  pthread_mutex_t thread_timeout_mutex[GKI_MAX_TASKS];
-  pthread_cond_t thread_timeout_cond[GKI_MAX_TASKS];
-  int no_timer_suspend; /* 1: no suspend, 0 stop calling GKI_timer_update() */
-  pthread_mutex_t gki_timer_mutex;
-  pthread_cond_t gki_timer_cond;
-  int gki_timer_wake_lock_on;
-} tGKI_OS;
-
-/* condition to exit or continue GKI_run() timer loop */
-#define GKI_TIMER_TICK_RUN_COND 1
-#define GKI_TIMER_TICK_STOP_COND 0
-#define GKI_TIMER_TICK_EXIT_COND 2
-
-extern void phUwb_gki_system_tick_start_stop_cback(bool start);
-
-/* Contains common control block as well as OS specific variables */
-typedef struct {
-  tGKI_OS os;
-  tGKI_COM_CB com;
-} tGKI_CB;
-
-extern tGKI_CB gki_cb;
-
-#endif
diff --git a/src/gki/ulinux/uwb_gki_ulinux.cc b/src/gki/ulinux/uwb_gki_ulinux.cc
deleted file mode 100755
index 084ca07..0000000
--- a/src/gki/ulinux/uwb_gki_ulinux.cc
+++ /dev/null
@@ -1,759 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2019,2022 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#include <errno.h>
-#include <malloc.h>
-#include <pthread.h> /* must be 1st header defined  */
-
-#include "uci_log.h"
-#include "uwb_gki_int.h"
-
-/* Temp android logging...move to android tgt config file */
-
-#ifndef LINUX_NATIVE
-#else
-#define LOGV(format, ...) fprintf(stdout, LOG_TAG format, ##__VA_ARGS__)
-#define LOGE(format, ...) fprintf(stderr, LOG_TAG format, ##__VA_ARGS__)
-#define LOGI(format, ...) fprintf(stdout, LOG_TAG format, ##__VA_ARGS__)
-
-#define SCHED_NORMAL 0
-#define SCHED_FIFO 1
-#define SCHED_RR 2
-#define SCHED_BATCH 3
-
-#endif
-
-/* Define the structure that holds the GKI variables
- */
-tGKI_CB gki_cb;
-
-#define NANOSEC_PER_MILLISEC (1000000)
-#define NSEC_PER_SEC (1000 * NANOSEC_PER_MILLISEC)
-
-/* works only for 1ms to 1000ms heart beat ranges */
-#define LINUX_SEC (1000 / TICKS_PER_SEC)
-// #define GKI_TICK_TIMER_DEBUG
-
-/* this kind of mutex go into tGKI_OS control block!!!! */
-/* static pthread_mutex_t GKI_sched_mutex; */
-/*static pthread_mutex_t thread_delay_mutex;
-static pthread_cond_t thread_delay_cond;
-static pthread_mutex_t gki_timer_update_mutex;
-static pthread_cond_t   gki_timer_update_cond;
-*/
-
-typedef struct {
-  uint8_t task_id;         /* GKI task id */
-  TASKPTR task_entry;      /* Task entry function*/
-  uint32_t params;         /* Extra params to pass to task entry function */
-  pthread_cond_t* pCond;   /* for android*/
-  pthread_mutex_t* pMutex; /* for android*/
-} gki_pthread_info_t;
-gki_pthread_info_t gki_pthread_info[GKI_MAX_TASKS];
-
-/*******************************************************************************
-**
-** Function         phUwb_gki_task_entry
-**
-** Description      entry point of GKI created tasks
-**
-** Returns          void
-**
-*******************************************************************************/
-void* phUwb_gki_task_entry(void* params) {
-  pthread_t thread_id = pthread_self();
-  gki_pthread_info_t* p_pthread_info = (gki_pthread_info_t*)params;
-  UCI_TRACE_I(
-      "gki_task_entry task_id=%i, thread_id=%lx/%lx, pCond/pMutex=%p/%p",
-      p_pthread_info->task_id, gki_cb.os.thread_id[p_pthread_info->task_id],
-      pthread_self(), p_pthread_info->pCond, p_pthread_info->pMutex);
-
-  gki_cb.os.thread_id[p_pthread_info->task_id] = thread_id;
-  /* Call the actual thread entry point */
-  (p_pthread_info->task_entry)(p_pthread_info->params);
-
-  UCI_TRACE_E("gki_task task_id=%i terminating", p_pthread_info->task_id);
-  gki_cb.os.thread_id[p_pthread_info->task_id] = 0;
-
-  return NULL;
-}
-/* end android */
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_init
-**
-** Description      This function is called once at startup to initialize
-**                  all the timer structures.
-**
-** Returns          void
-**
-*******************************************************************************/
-
-void phUwb_GKI_init(void) {
-  pthread_mutexattr_t attr;
-  tGKI_OS* p_os;
-
-  memset(&gki_cb, 0, sizeof(gki_cb));
-
-  phUwb_gki_buffer_init();
-  phUwb_gki_timers_init();
-  gki_cb.com.OSTicks = (uint32_t)times(0);
-
-  pthread_mutexattr_init(&attr);
-  p_os = &gki_cb.os;
-  pthread_mutex_init(&p_os->GKI_mutex, &attr);
-  /* pthread_mutex_init(&GKI_sched_mutex, NULL); */
-  /* pthread_mutex_init(&thread_delay_mutex, NULL); */ /* used in GKI_delay */
-  /* pthread_cond_init (&thread_delay_cond, NULL); */
-
-  /* Initialiase GKI_timer_update suspend variables & mutexes to be in running
-   * state.
-   * this works too even if GKI_NO_TICK_STOP is defined in btld.txt */
-  p_os->no_timer_suspend = GKI_TIMER_TICK_RUN_COND;
-  pthread_mutex_init(&p_os->gki_timer_mutex, NULL);
-  pthread_cond_init(&p_os->gki_timer_cond, NULL);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_create_task
-**
-** Description      This function is called to create a new OSS task.
-**
-** Parameters:      task_entry  - (input) pointer to the entry function of the
-**                                        task
-**                  task_id     - (input) Task id is mapped to priority
-**                  taskname    - (input) name given to the task
-**                  stack       - (input) pointer to the top of the stack
-**                                        (highest memory location)
-**                  stacksize   - (input) size of the stack allocated for the
-**                                        task
-**
-** Returns          GKI_SUCCESS if all OK, GKI_FAILURE if any problem
-**
-** NOTE             This function take some parameters that may not be needed
-**                  by your particular OS. They are here for compatability
-**                  of the function prototype.
-**
-*******************************************************************************/
-uint8_t phUwb_GKI_create_task(TASKPTR task_entry, uint8_t task_id,
-                              int8_t* taskname, uint16_t* stack,
-                              uint16_t stacksize, void* pCondVar,
-                              void* pMutex) {
-  struct sched_param param;
-  int policy, ret = 0;
-  pthread_condattr_t attr;
-  pthread_attr_t attr1;
-
-  pthread_condattr_init(&attr);
-  pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
-  UCI_TRACE_I(
-      "GKI_create_task func=0x%p  id=%d  name=%s  stack=0x%p  stackSize=%d",
-      task_entry, task_id, taskname, stack, stacksize);
-
-  if (task_id >= GKI_MAX_TASKS) {
-    UCI_TRACE_I("Error! task ID > max task allowed");
-    return (GKI_FAILURE);
-  }
-
-  gki_cb.com.OSRdyTbl[task_id] = TASK_READY;
-  gki_cb.com.OSTName[task_id] = taskname;
-  gki_cb.com.OSWaitTmr[task_id] = 0;
-  gki_cb.com.OSWaitEvt[task_id] = 0;
-
-  /* Initialize mutex and condition variable objects for events and timeouts */
-  pthread_mutex_init(&gki_cb.os.thread_evt_mutex[task_id], NULL);
-  pthread_cond_init(&gki_cb.os.thread_evt_cond[task_id], &attr);
-  pthread_mutex_init(&gki_cb.os.thread_timeout_mutex[task_id], NULL);
-  pthread_cond_init(&gki_cb.os.thread_timeout_cond[task_id], &attr);
-
-  pthread_attr_init(&attr1);
-/* by default, pthread creates a joinable thread */
-#if (FALSE == GKI_PTHREAD_JOINABLE)
-  pthread_attr_setdetachstate(&attr1, PTHREAD_CREATE_DETACHED);
-
-  UCI_TRACE_I("GKI creating task %i, pCond/pMutex=%p/%p", task_id, pCondVar,
-              pMutex);
-#else
-  UCI_TRACE_I("GKI creating JOINABLE task %i", task_id);
-#endif
-
-  /* On Android, the new tasks starts running before
-   * 'gki_cb.os.thread_id[task_id]' is initialized */
-  /* Pass task_id to new task so it can initialize gki_cb.os.thread_id[task_id]
-   * for it calls GKI_wait */
-  gki_pthread_info[task_id].task_id = task_id;
-  gki_pthread_info[task_id].task_entry = task_entry;
-  gki_pthread_info[task_id].params = 0;
-  gki_pthread_info[task_id].pCond = (pthread_cond_t*)pCondVar;
-  gki_pthread_info[task_id].pMutex = (pthread_mutex_t*)pMutex;
-
-  ret = pthread_create(&gki_cb.os.thread_id[task_id], &attr1,
-                       phUwb_gki_task_entry, &gki_pthread_info[task_id]);
-
-  if (ret != 0) {
-    UCI_TRACE_I("pthread_create failed(%d), %s!", ret, taskname);
-    return GKI_FAILURE;
-  }
-
-  if (pthread_getschedparam(gki_cb.os.thread_id[task_id], &policy, &param) ==
-      0) {
-    {
-      policy = SCHED_RR;
-      param.sched_priority = 30 - task_id - 2;
-    }
-    pthread_setschedparam(gki_cb.os.thread_id[task_id], policy, &param);
-  }
-
-  UCI_TRACE_I("Leaving GKI_create_task %p %d %lx %s %p %d", task_entry, task_id,
-              gki_cb.os.thread_id[task_id], taskname, stack, stacksize);
-
-  return (GKI_SUCCESS);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_shutdown
-**
-** Description      shutdowns the GKI tasks/threads in from max task id to 0 and
-**                  frees pthread resources!
-**                  IMPORTANT: in case of join method, GKI_shutdown must be
-**                  called outside a GKI thread context!
-**
-** Returns          void
-**
-*******************************************************************************/
-#define WAKE_LOCK_ID "brcm_uwba"
-#define PARTIAL_WAKE_LOCK 1
-extern "C" int acquire_wake_lock(int lock, const char* id);
-extern "C" int release_wake_lock(const char* id);
-
-void phUwb_GKI_shutdown(void) {
-  uint8_t task_id;
-  volatile int* p_run_cond = &gki_cb.os.no_timer_suspend;
-  int oldCOnd = 0;
-#if (FALSE != GKI_PTHREAD_JOINABLE)
-  int result;
-#endif
-
-  /* release threads and set as TASK_DEAD. going from low to high priority fixes
-   * GKI_exception problem due to btu->hci sleep request events  */
-  for (task_id = GKI_MAX_TASKS; task_id > 0; task_id--) {
-    if (gki_cb.com.OSRdyTbl[task_id - 1] != TASK_DEAD) {
-      gki_cb.com.OSRdyTbl[task_id - 1] = TASK_DEAD;
-
-      /* paranoi settings, make sure that we do not execute any mailbox events
-       */
-      gki_cb.com.OSWaitEvt[task_id - 1] &=
-          ~(TASK_MBOX_0_EVT_MASK | TASK_MBOX_1_EVT_MASK | TASK_MBOX_2_EVT_MASK |
-            TASK_MBOX_3_EVT_MASK);
-      phUwb_GKI_send_event(task_id - 1, EVENT_MASK(GKI_SHUTDOWN_EVT));
-
-#if (FALSE == GKI_PTHREAD_JOINABLE)
-      int i = 0;
-      if((task_id - 1) != BTU_TASK) {
-        while ((gki_cb.com.OSWaitEvt[task_id - 1] != 0) && (++i < 10))
-          usleep(50 * 1000);
-      } else {
-        usleep(50 * 1000);
-        UCI_TRACE_D("%s: Wait not needed for UWBA_TASK with task id %d", __func__,(task_id - 1));
-      }
-#else
-      /* wait for proper Arnold Schwarzenegger task state */
-      result = pthread_join(gki_cb.os.thread_id[task_id - 1], NULL);
-      if (result < 0) {
-        UCI_TRACE_I("FAILED: result: %d", result);
-      }
-#endif
-      UCI_TRACE_I("task %s dead", gki_cb.com.OSTName[task_id - 1]);
-      phUwb_GKI_exit_task(task_id - 1);
-    }
-  }
-/*    pthread_mutex_destroy(&GKI_sched_mutex); */
-/*    pthread_mutex_destroy(&thread_delay_mutex);
- pthread_cond_destroy (&thread_delay_cond); */
-  if (gki_cb.os.gki_timer_wake_lock_on) {
-    UCI_TRACE_I("GKI_shutdown :  release_wake_lock(brcm_btld)");
-    release_wake_lock(WAKE_LOCK_ID);
-    gki_cb.os.gki_timer_wake_lock_on = 0;
-  }
-  oldCOnd = *p_run_cond;
-  *p_run_cond = GKI_TIMER_TICK_EXIT_COND;
-  if (oldCOnd == GKI_TIMER_TICK_STOP_COND)
-    pthread_cond_signal(&gki_cb.os.gki_timer_cond);
-  /* Destroy mutex and condition variable objects */
-  pthread_mutex_destroy(&gki_cb.os.GKI_mutex);
-}
-
-/*******************************************************************************
- **
- ** Function        phUwb_GKI_run
- **
- ** Description     This function runs a task
- **
- ** Parameters:     start: TRUE start system tick (again), FALSE stop
- **
- ** Returns         void
- **
- ******************************************************************************/
-void phUwb_gki_system_tick_start_stop_cback(bool start) {
-  tGKI_OS* p_os = &gki_cb.os;
-  volatile int* p_run_cond = &p_os->no_timer_suspend;
-#ifdef GKI_TICK_TIMER_DEBUG
-  static volatile int wake_lock_count;
-#endif
-  if (start == false) {
-    /* this can lead to a race condition. however as we only read this variable
-     * in the timer loop
-     * we should be fine with this approach. otherwise uncomment below mutexes.
-     */
-    /* GKI_disable(); */
-    *p_run_cond = GKI_TIMER_TICK_STOP_COND;
-/* GKI_enable(); */
-#ifdef GKI_TICK_TIMER_DEBUG
-    UCI_TRACE_I(">>> STOP wake_lock_count:%d", --wake_lock_count);
-#endif
-    release_wake_lock(WAKE_LOCK_ID);
-    gki_cb.os.gki_timer_wake_lock_on = 0;
-  } else {
-    /* restart GKI_timer_update() loop */
-    acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
-    gki_cb.os.gki_timer_wake_lock_on = 1;
-    *p_run_cond = GKI_TIMER_TICK_RUN_COND;
-    pthread_mutex_lock(&p_os->gki_timer_mutex);
-    pthread_cond_signal(&p_os->gki_timer_cond);
-    pthread_mutex_unlock(&p_os->gki_timer_mutex);
-
-#ifdef GKI_TICK_TIMER_DEBUG
-    UCI_TRACE_I(">>> START wake_lock_count:%d", ++wake_lock_count);
-#endif
-  }
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_run
-**
-** Description      This function runs a task
-**
-** Parameters:      p_task_id  - (input) pointer to task id
-**
-** Returns          void
-**
-** NOTE             This function is only needed for operating systems where
-**                  starting a task is a 2-step process. Most OS's do it in
-**                  one step, If your OS does it in one step, this function
-**                  should be empty.
-*******************************************************************************/
-void phUwb_GKI_run(__attribute__((unused)) void* p_task_id) {
-  UCI_TRACE_I("%s enter", __func__);
-  struct timespec delay;
-  int err = 0;
-  volatile int* p_run_cond = &gki_cb.os.no_timer_suspend;
-
-#ifndef GKI_NO_TICK_STOP
-  /* register start stop function which disable timer loop in GKI_run() when no
-   * timers are
-   * in any GKI/BTA/BTU this should save power when BTLD is idle! */
-  phUwb_GKI_timer_queue_register_callback(
-      phUwb_gki_system_tick_start_stop_cback);
-  UCI_TRACE_I("Start/Stop GKI_timer_update_registered!");
-#endif
-  UCI_TRACE_I("GKI_run, run_cond(%p)=%d ", p_run_cond, *p_run_cond);
-  for (; GKI_TIMER_TICK_EXIT_COND != *p_run_cond;) {
-    do {
-      /* adjust hear bit tick in btld by changning TICKS_PER_SEC!!!!! this
-       * formula works only for
-       * 1-1000ms heart beat units! */
-      delay.tv_sec = LINUX_SEC / 1000;
-      delay.tv_nsec = 1000 * 1000 * (LINUX_SEC % 1000);
-
-      /* [u]sleep can't be used because it uses SIGALRM */
-      do {
-        err = nanosleep(&delay, &delay);
-      } while (err < 0 && errno == EINTR);
-
-      if (GKI_TIMER_TICK_RUN_COND != *p_run_cond) break;  // GKI has shutdown
-
-      /* the unit should be alsways 1 (1 tick). only if you vary for some reason
-       * heart beat tick
-       * e.g. power saving you may want to provide more ticks
-       */
-      phUwb_GKI_timer_update(1);
-    } while (GKI_TIMER_TICK_RUN_COND == *p_run_cond);
-
-/* currently on reason to exit above loop is no_timer_suspend ==
- * GKI_TIMER_TICK_STOP_COND
- * block timer main thread till re-armed by  */
-#ifdef GKI_TICK_TIMER_DEBUG
-    UCI_TRACE_I(">>> SUSPENDED");
-#endif
-    if (GKI_TIMER_TICK_EXIT_COND != *p_run_cond) {
-      pthread_mutex_lock(&gki_cb.os.gki_timer_mutex);
-      pthread_cond_wait(&gki_cb.os.gki_timer_cond, &gki_cb.os.gki_timer_mutex);
-      pthread_mutex_unlock(&gki_cb.os.gki_timer_mutex);
-    }
-    /* potentially we need to adjust os gki_cb.com.OSTicks */
-
-#ifdef GKI_TICK_TIMER_DEBUG
-    UCI_TRACE_I(">>> RESTARTED run_cond: %d", *p_run_cond);
-#endif
-  } /* for */
-  UCI_TRACE_I("%s exit", __func__);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_wait
-**
-** Description      This function is called by tasks to wait for a specific
-**                  event or set of events. The task may specify the duration
-**                  that it wants to wait for, or 0 if infinite.
-**
-** Parameters:      flag -    (input) the event or set of events to wait for
-**                  timeout - (input) the duration that the task wants to wait
-**                                    for the specific events (in system ticks)
-**
-**
-** Returns          the event mask of received events or zero if timeout
-**
-*******************************************************************************/
-uint16_t phUwb_GKI_wait(uint16_t flag, uint32_t timeout) {
-  uint16_t evt;
-  uint8_t rtask;
-  struct timespec abstime = {0, 0};
-  int sec;
-  int nano_sec;
-
-  rtask = phUwb_GKI_get_taskid();
-  if (rtask >= GKI_MAX_TASKS) {
-    UCI_TRACE_E("%s() Exiting thread; rtask %d >= %d", __func__, rtask,
-                GKI_MAX_TASKS);
-    return EVENT_MASK(GKI_SHUTDOWN_EVT);
-  }
-
-  gki_pthread_info_t* p_pthread_info = &gki_pthread_info[rtask];
-  if (p_pthread_info->pCond != NULL && p_pthread_info->pMutex != NULL) {
-    int ret;
-    UCI_TRACE_I("GKI_wait task=%i, pCond/pMutex = %p/%p", rtask,
-                p_pthread_info->pCond, p_pthread_info->pMutex);
-    ret = pthread_mutex_lock(p_pthread_info->pMutex);
-    ret = pthread_cond_signal(p_pthread_info->pCond);
-    ret = pthread_mutex_unlock(p_pthread_info->pMutex);
-    p_pthread_info->pMutex = NULL;
-    p_pthread_info->pCond = NULL;
-  }
-  gki_cb.com.OSWaitForEvt[rtask] = flag;
-
-  /* protect OSWaitEvt[rtask] from modification from an other thread */
-  pthread_mutex_lock(&gki_cb.os.thread_evt_mutex[rtask]);
-
-  if (!(gki_cb.com.OSWaitEvt[rtask] & flag)) {
-    if (timeout) {
-      if (clock_gettime(CLOCK_MONOTONIC, &abstime) == -1) {
-        UCI_TRACE_E("phUwb_GKI_wait: fail get time");
-      } else {
-        /* add timeout */
-        sec = timeout / 1000;
-        nano_sec = (timeout % 1000) * NANOSEC_PER_MILLISEC;
-        abstime.tv_nsec += nano_sec;
-        if (abstime.tv_nsec > NSEC_PER_SEC) {
-          abstime.tv_sec += (abstime.tv_nsec / NSEC_PER_SEC);
-          abstime.tv_nsec = abstime.tv_nsec % NSEC_PER_SEC;
-        }
-        abstime.tv_sec += sec;
-      }
-
-      int waitResult =
-          pthread_cond_timedwait(&gki_cb.os.thread_evt_cond[rtask],
-                                 &gki_cb.os.thread_evt_mutex[rtask], &abstime);
-      if ((waitResult != 0) && (waitResult != ETIMEDOUT))
-        UCI_TRACE_E("phUwb_GKI_wait::wait: fail timed wait; error=0x%X",
-                    waitResult);
-
-    } else {
-      pthread_cond_wait(&gki_cb.os.thread_evt_cond[rtask],
-                        &gki_cb.os.thread_evt_mutex[rtask]);
-    }
-
-    /* TODO: check, this is probably neither not needed depending on
-     phtread_cond_wait() implmentation,
-     e.g. it looks like it is implemented as a counter in which case multiple
-     cond_signal
-     should NOT be lost! */
-    // we are waking up after waiting for some events, so refresh variables
-    // no need to call GKI_disable() here as we know that we will have some
-    // events as we've been waking up after condition pending or timeout
-    if (gki_cb.com.OSTaskQFirst[rtask][0])
-      gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_0_EVT_MASK;
-    if (gki_cb.com.OSTaskQFirst[rtask][1])
-      gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_1_EVT_MASK;
-    if (gki_cb.com.OSTaskQFirst[rtask][2])
-      gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_2_EVT_MASK;
-    if (gki_cb.com.OSTaskQFirst[rtask][3])
-      gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_3_EVT_MASK;
-
-    if (gki_cb.com.OSRdyTbl[rtask] == TASK_DEAD) {
-      gki_cb.com.OSWaitEvt[rtask] = 0;
-      /* unlock thread_evt_mutex as pthread_cond_wait() does auto lock when cond
-       * is met */
-      pthread_mutex_unlock(&gki_cb.os.thread_evt_mutex[rtask]);
-      UCI_TRACE_E("GKI TASK_DEAD received. exit thread %d...", rtask);
-
-      gki_cb.os.thread_id[rtask] = 0;
-      return (EVENT_MASK(GKI_SHUTDOWN_EVT));
-    }
-  }
-
-  /* Clear the wait for event mask */
-  gki_cb.com.OSWaitForEvt[rtask] = 0;
-
-  /* Return only those bits which user wants... */
-  evt = gki_cb.com.OSWaitEvt[rtask] & flag;
-
-  /* Clear only those bits which user wants... */
-  gki_cb.com.OSWaitEvt[rtask] &= ~flag;
-
-  /* unlock thread_evt_mutex as pthread_cond_wait() does auto lock mutex when
-   * cond is met */
-  pthread_mutex_unlock(&gki_cb.os.thread_evt_mutex[rtask]);
-  return (evt);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_send_event
-**
-** Description      This function is called by tasks to send events to other
-**                  tasks. Tasks can also send events to themselves.
-**
-** Parameters:      task_id -  (input) The id of the task to which the event has
-**                                     to be sent
-**                  event   -  (input) The event that has to be sent
-**
-**
-** Returns          GKI_SUCCESS if all OK, else GKI_FAILURE
-**
-*******************************************************************************/
-uint8_t phUwb_GKI_send_event(uint8_t task_id, uint16_t event) {
-  /* use efficient coding to avoid pipeline stalls */
-  if (task_id < GKI_MAX_TASKS) {
-    /* protect OSWaitEvt[task_id] from manipulation in GKI_wait() */
-    pthread_mutex_lock(&gki_cb.os.thread_evt_mutex[task_id]);
-
-    /* Set the event bit */
-    gki_cb.com.OSWaitEvt[task_id] |= event;
-
-    pthread_cond_signal(&gki_cb.os.thread_evt_cond[task_id]);
-
-    pthread_mutex_unlock(&gki_cb.os.thread_evt_mutex[task_id]);
-
-    return (GKI_SUCCESS);
-  }
-  return (GKI_FAILURE);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_isend_event
-**
-** Description      This function is called from ISRs to send events to other
-**                  tasks. The only difference between this function and
-**                  GKI_send_event is that this function assumes interrupts are
-**                  already disabled.
-**
-** Parameters:      task_id -  (input) The destination task Id for the event.
-**                  event   -  (input) The event flag
-**
-** Returns          GKI_SUCCESS if all OK, else GKI_FAILURE
-**
-** NOTE             This function is NOT called by the Widcomm stack and
-**                  profiles. If you want to use it in your own implementation,
-**                  put your code here, otherwise you can delete the entire
-**                  body of the function.
-**
-*******************************************************************************/
-uint8_t phUwb_GKI_isend_event(uint8_t task_id, uint16_t event) {
-  UCI_TRACE_I("GKI_isend_event %d %x", task_id, event);
-  UCI_TRACE_I("GKI_isend_event %d %x done", task_id, event);
-  return phUwb_GKI_send_event(task_id, event);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_get_taskid
-**
-** Description      This function gets the currently running task ID.
-**
-** Returns          task ID
-**
-** NOTE             The Widcomm upper stack and profiles may run as a single
-**                  task. If you only have one GKI task, then you can hard-code
-**                  this function to return a '1'. Otherwise, you should have
-**                  some OS-specific method to determine the current task.
-**
-*******************************************************************************/
-uint8_t phUwb_GKI_get_taskid(void) {
-  uint8_t i;
-  pthread_t thread_id = pthread_self();
-  for (i = 0; i < GKI_MAX_TASKS; i++) {
-    if (gki_cb.os.thread_id[i] == thread_id) {
-      return (i);
-    }
-  }
-  return (0xFF);
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_enable
-**
-** Description      This function enables interrupts.
-**
-** Returns          void
-**
-*******************************************************************************/
-void phUwb_GKI_enable(void) {
-  pthread_mutex_unlock(&gki_cb.os.GKI_mutex);
-  /*     pthread_mutex_xx is nesting save, no need for this: already_disabled =
-   * 0; */
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_disable
-**
-** Description      This function disables interrupts.
-**
-** Returns          void
-**
-*******************************************************************************/
-
-void phUwb_GKI_disable(void) {
-  pthread_mutex_lock(&gki_cb.os.GKI_mutex);
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_exception
-**
-** Description      This function throws an exception.
-**                  This is normally only called for a nonrecoverable error.
-**
-** Parameters:      code    -  (input) The code for the error
-**                  msg     -  (input) The message that has to be logged
-**
-** Returns          void
-**
-*******************************************************************************/
-
-void phUwb_GKI_exception(uint16_t code, std::string msg) {
-  uint8_t task_id;
-
-  UCI_TRACE_E("Task State Table");
-
-  for (task_id = 0; task_id < GKI_MAX_TASKS; task_id++) {
-    UCI_TRACE_E("TASK ID [%d] task name [%s] state [%d]", task_id,
-                gki_cb.com.OSTName[task_id], gki_cb.com.OSRdyTbl[task_id]);
-  }
-
-  UCI_TRACE_E("%d %s", code, msg.c_str());
-  UCI_TRACE_E(
-      "********************************************************************");
-  UCI_TRACE_E("* %d %s", code, msg.c_str());
-  UCI_TRACE_E(
-      "********************************************************************");
-
-  UCI_TRACE_E("%d %s done", code, msg.c_str());
-
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_os_malloc
-**
-** Description      This function allocates memory
-**
-** Parameters:      size -  (input) The size of the memory that has to be
-**                  allocated
-**
-** Returns          the address of the memory allocated, or NULL if failed
-**
-** NOTE             This function is called by the Widcomm stack when
-**                  dynamic memory allocation is used.
-**
-*******************************************************************************/
-void* phUwb_GKI_os_malloc(uint32_t size) { return (malloc(size)); }
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_os_free
-**
-** Description      This function frees memory
-**
-** Parameters:      size -  (input) The address of the memory that has to be
-**                  freed
-**
-** Returns          void
-**
-** NOTE             This function is NOT called by the Widcomm stack and
-**                  profiles. It is only called from within GKI if dynamic
-**
-*******************************************************************************/
-void phUwb_GKI_os_free(void* p_mem) {
-  if (p_mem != NULL) free(p_mem);
-  return;
-}
-
-/*******************************************************************************
-**
-** Function         phUwb_GKI_exit_task
-**
-** Description      This function is called to stop a GKI task.
-**
-** Parameters:      task_id  - (input) the id of the task that has to be stopped
-**
-** Returns          void
-**
-** NOTE             This function is NOT called by the Widcomm stack and
-**                  profiles. If you want to use it in your own implementation,
-**                  put specific code here to kill a task.
-**
-*******************************************************************************/
-void phUwb_GKI_exit_task(uint8_t task_id) {
-  if (task_id >= GKI_MAX_TASKS) {
-    return;
-  }
-  phUwb_GKI_disable();
-  gki_cb.com.OSRdyTbl[task_id] = TASK_DEAD;
-
-  /* Destroy mutex and condition variable objects */
-  pthread_mutex_destroy(&gki_cb.os.thread_evt_mutex[task_id]);
-  pthread_cond_destroy(&gki_cb.os.thread_evt_cond[task_id]);
-  pthread_mutex_destroy(&gki_cb.os.thread_timeout_mutex[task_id]);
-  pthread_cond_destroy(&gki_cb.os.thread_timeout_cond[task_id]);
-
-  phUwb_GKI_enable();
-
-  UCI_TRACE_I("GKI_exit_task %d done", task_id);
-  return;
-}
diff --git a/src/include/UwbAdaptation.h b/src/include/UwbAdaptation.h
deleted file mode 100755
index 0b65baf..0000000
--- a/src/include/UwbAdaptation.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#pragma once
-#include <pthread.h>
-#include <utils/RefBase.h>
-
-#include "config.h"
-#include "hal_uwb.h"
-#include "uwb_hal_api.h"
-#include "uwb_hal_int.h"
-#include "uwb_target.h"
-
-class ThreadMutex {
- public:
-  ThreadMutex();
-  virtual ~ThreadMutex();
-  void lock();
-  void unlock();
-  operator pthread_mutex_t*() { return &mMutex; }
-
- private:
-  pthread_mutex_t mMutex;
-};
-
-class ThreadCondVar : public ThreadMutex {
- public:
-  ThreadCondVar();
-  virtual ~ThreadCondVar();
-  void signal();
-  void wait();
-  operator pthread_cond_t*() { return &mCondVar; }
-  operator pthread_mutex_t*() {
-    return ThreadMutex::operator pthread_mutex_t*();
-  }
-
- private:
-  pthread_cond_t mCondVar;
-};
-
-class AutoThreadMutex {
- public:
-  AutoThreadMutex(ThreadMutex& m);
-  virtual ~AutoThreadMutex();
-  operator ThreadMutex&() { return mm; }
-  operator pthread_mutex_t*() { return (pthread_mutex_t*)mm; }
-
- private:
-  ThreadMutex& mm;
-};
-
-class UwbAdaptation {
- public:
-  virtual ~UwbAdaptation();
-  void Initialize();
-  void Finalize(bool graceExit);
-  static UwbAdaptation& GetInstance();
-  tHAL_UWB_ENTRY* GetHalEntryFuncs();
-  static tUWB_STATUS CoreInitialization();
-  static tUWB_STATUS SessionInitialization(int sessionId);
-
- private:
-  UwbAdaptation();
-  void signal();
-  static UwbAdaptation* mpInstance;
-  static ThreadMutex sLock;
-  static ThreadMutex sIoctlLock;
-  ThreadCondVar mCondVar;
-  tHAL_UWB_ENTRY mHalEntryFuncs;  // function pointers for HAL entry points
-
-  static tHAL_UWB_CBACK* mHalCallback;
-  static tHAL_UWB_DATA_CBACK* mHalDataCallback;
-
-  static uint32_t UWBA_TASK(uint32_t arg);
-  static uint32_t Thread(uint32_t arg);
-  void InitializeHalDeviceContext();
-  static void HalOpen(tHAL_UWB_CBACK* p_hal_cback,
-                      tHAL_UWB_DATA_CBACK* p_data_cback);
-  static void HalClose();
-  static void HalWrite(uint16_t data_len, uint8_t* p_data);
-};
diff --git a/src/include/config.h b/src/include/config.h
deleted file mode 100755
index 1c852f4..0000000
--- a/src/include/config.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *  Copyright 2018-2019 NXP
- *
- * 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.
- */
-#pragma once
-
-#include <map>
-#include <string>
-#include <vector>
-
-class ConfigValue {
- public:
-  enum Type { UNSIGNED, STRING, BYTES };
-
-  ConfigValue();
-  ConfigValue(std::string);
-  ConfigValue(unsigned);
-  ConfigValue(std::vector<uint8_t>);
-  Type getType() const;
-  std::string getString() const;
-  unsigned getUnsigned() const;
-  std::vector<uint8_t> getBytes() const;
-
-  bool parseFromString(std::string in);
-
- private:
-  Type type_;
-  std::string value_string_;
-  unsigned value_unsigned_;
-  std::vector<uint8_t> value_bytes_;
-};
-
-class ConfigFile {
- public:
-  void parseFromFile(const std::string& file_name);
-  void parseFromString(const std::string& config);
-  void addConfig(const std::string& config, ConfigValue& value);
-
-  bool hasKey(const std::string& key);
-  std::string getString(const std::string& key);
-  unsigned getUnsigned(const std::string& key);
-  std::vector<uint8_t> getBytes(const std::string& key);
-
-  bool isEmpty();
-  void clear();
-
- private:
-  ConfigValue& getValue(const std::string& key);
-
-  std::map<std::string, ConfigValue> values_;
-};
diff --git a/src/include/hal_uwb.h b/src/include/hal_uwb.h
deleted file mode 100755
index 5d098a5..0000000
--- a/src/include/hal_uwb.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/******************************************************************************
- *
- *  Copyright 2018-2020 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef ANDROID_HARDWARE_HAL_NXPUWB_V1_0_H
-#define ANDROID_HARDWARE_HAL_NXPUWB_V1_0_H
-#include <string>
-#include <vector>
-
-enum {
-  HAL_UWB_STATUS_OK = 0x00,
-  HAL_UWB_STATUS_ERR_TRANSPORT = 0x01,
-  HAL_UWB_STATUS_ERR_CMD_TIMEOUT = 0x02
-};
-
-enum NxpUwbHalStatus {
-  /** In case of an error, HCI network needs to be re-initialized */
-  HAL_STATUS_OK = 0x00,
-};
-
-#endif  // ANDROID_HARDWARE_HAL_NXPUWB_V1_0_H
diff --git a/src/include/uwb_config.h b/src/include/uwb_config.h
deleted file mode 100755
index bec8b9a..0000000
--- a/src/include/uwb_config.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *  Copyright 2018-2020 NXP
- *
- * 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.
- */
-
-#pragma once
-
-#include <config.h>
-
-#include <string>
-#include <vector>
-
-#define NAME_UWB_CORE_DEVICE_DEFAULT_CONFIG "UWB_CORE_DEVICE_DEFAULT_CONFIG"
-#define NAME_UWB_LOW_POWER_MODE "UWB_LOW_POWER_MODE"
-#define NAME_UWB_DPD_ENTRY_TIMEOUT "UWB_DPD_ENTRY_TIMEOUT"
-
-#define CHECK_RETURN(condition, str, ret) \
-  do {                                    \
-    if (condition) {                      \
-      return ret;                         \
-    }                                     \
-  } while (0)
-#define CHECK_RETURN_VOID(condition, str) \
-  do {                                    \
-    if (condition) {                      \
-      return;                             \
-    }                                     \
-  } while (0)
-class UwbConfig {
- public:
-  static bool hasKey(const std::string& key);
-  static std::string getString(const std::string& key);
-  static std::string getString(const std::string& key,
-                               std::string default_value);
-  static unsigned getUnsigned(const std::string& key);
-  static unsigned getUnsigned(const std::string& key, unsigned default_value);
-  static std::vector<uint8_t> getBytes(const std::string& key);
-  static void clear();
-
- private:
-  void loadConfig();
-  static UwbConfig& getInstance();
-  UwbConfig();
-
-  ConfigFile config_;
-};
diff --git a/src/include/uwb_gki_target.h b/src/include/uwb_gki_target.h
deleted file mode 100755
index 9b1b1c5..0000000
--- a/src/include/uwb_gki_target.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef UWB_GKI_TARGET_H
-#define UWB_GKI_TARGET_H
-
-#include "data_types.h"
-
-/******************************************************************************
-**
-** Task configuration
-**
-******************************************************************************/
-
-/* Definitions of task IDs for inter-task messaging */
-#ifndef MMI_TASK
-#define MMI_TASK 0
-#endif
-
-#ifndef HCISU_TASK
-#define HCISU_TASK 1
-#endif
-
-#ifndef UCIT_TASK
-#define UCIT_TASK 2
-#endif
-
-#ifndef UWB_TASK
-#define UWB_TASK 3
-#endif
-
-#ifndef BTU_TASK
-#define BTU_TASK 4
-#endif
-
-/* The number of GKI tasks in the software system. */
-#ifndef GKI_MAX_TASKS
-#define GKI_MAX_TASKS 5
-#endif
-
-/******************************************************************************
-**
-** Timer configuration
-**
-******************************************************************************/
-
-/* The number of GKI timers in the software system. */
-#ifndef GKI_NUM_TIMERS
-#define GKI_NUM_TIMERS 3
-#endif
-
-/* A conversion value for translating ticks to calculate GKI timer.  */
-#ifndef TICKS_PER_SEC
-#define TICKS_PER_SEC 100
-#endif
-
-/* delay in ticks before stopping system tick. */
-#ifndef GKI_DELAY_STOP_SYS_TICK
-#define GKI_DELAY_STOP_SYS_TICK 10
-#endif
-
-/******************************************************************************
-**
-** Buffer configuration
-**
-******************************************************************************/
-#define GKI_ENABLE_BUF_CORRUPTION_CHECK TRUE
-#define GKI_DEF_BUFPOOL_PERM_MASK 0xfff0
-#define GKI_NUM_TOTAL_BUF_POOLS 10
-#define GKI_NUM_FIXED_BUF_POOLS 4
-
-/* The size of the buffers in pool 0 */
-#define GKI_POOL_ID_0 0
-#define GKI_BUF0_SIZE 268
-#define GKI_BUF0_MAX 40
-
-/* The size of the buffers in pool 1 */
-#define GKI_POOL_ID_1
-#define GKI_BUF1_SIZE 428
-#define GKI_BUF1_MAX 26
-
-/* The size of the buffers in pool 2 */
-#define GKI_POOL_ID_2 2
-#define GKI_BUF2_SIZE 4200
-#define GKI_BUF2_MAX 50
-
-/* The size of the buffers in pool 3 */
-#define GKI_POOL_ID_3 3
-#define GKI_BUF3_SIZE 4200
-#define GKI_BUF3_MAX 30
-
-#endif /* UWB_GKI_TARGET_H */
diff --git a/src/include/uwb_hal_api.h b/src/include/uwb_hal_api.h
deleted file mode 100755
index 88ac1a5..0000000
--- a/src/include/uwb_hal_api.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2014 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  UWB Hardware Abstraction Layer API
- *
- ******************************************************************************/
-#ifndef UWB_HAL_API_H
-#define UWB_HAL_API_H
-#include "data_types.h"
-#include "hal_uwb.h"
-
-typedef uint8_t tUWB_STATUS;
-typedef void(tHAL_UWB_CBACK)(uint8_t event, tUWB_STATUS status);
-typedef void(tHAL_UWB_DATA_CBACK)(uint16_t data_len, uint8_t* p_data);
-
-/*******************************************************************************
-** tHAL_UWB_ENTRY HAL entry-point lookup table
-*******************************************************************************/
-typedef void(tHAL_API_OPEN)(tHAL_UWB_CBACK* p_hal_cback,
-                            tHAL_UWB_DATA_CBACK* p_data_cback);
-typedef void(tHAL_API_CLOSE)(void);
-typedef tUWB_STATUS(tHAL_API_CORE_INIT)();
-typedef tUWB_STATUS(tHAL_API_SESSION_INIT)(int);
-typedef void(tHAL_API_WRITE)(uint16_t data_len, uint8_t* p_data);
-typedef tUWB_STATUS(tHAL_API_IOCTL)(long arg, void* p_data);
-
-typedef struct {
-  tHAL_API_OPEN* open;
-  tHAL_API_CLOSE* close;
-  tHAL_API_WRITE* write;
-  tHAL_API_IOCTL* ioctl;
-  tHAL_API_CORE_INIT* CoreInitialization;
-  tHAL_API_SESSION_INIT* SessionInitialization;
-} tHAL_UWB_ENTRY;
-
-typedef struct {
-  tHAL_UWB_ENTRY* hal_entry_func;
-} tHAL_UWB_CONTEXT;
-
-#endif /* UWB_HAL_API_H  */
diff --git a/src/include/uwb_hal_int.h b/src/include/uwb_hal_int.h
deleted file mode 100755
index f328b9e..0000000
--- a/src/include/uwb_hal_int.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2014 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  this file contains the UCI transport internal definitions and functions.
- *
- ******************************************************************************/
-
-#ifndef UWB_HAL_INT_H
-#define UWB_HAL_INT_H
-
-#include "uci_defs.h"
-#include "uwb_gki.h"
-#include "uwb_hal_api.h"
-
-enum {
-  HAL_UWB_OPEN_CPLT_EVT = 0x00,
-  HAL_UWB_CLOSE_CPLT_EVT = 0x01,
-  HAL_UWB_INIT_CPLT_EVT = 0x02,
-  HAL_UWB_ERROR_EVT = 0x03,
-  HAL_UWB_HW_RESET = 0x04
-};
-
-typedef uint8_t uwb_event_t;
-typedef uint8_t uwb_status_t;
-
-/*`
- * The callback passed in from the UWB stack that the HAL
- * can use to pass events back to the stack.
- */
-typedef void(uwb_stack_callback_t)(uwb_event_t event,
-                                   uwb_status_t event_status);
-
-/*
- * The callback passed in from the UWB stack that the HAL
- * can use to pass incoming data to the stack.
- */
-typedef void(uwb_stack_data_callback_t)(uint16_t data_len, uint8_t* p_data);
-
-#endif /* UWB_HAL_INT_H */
diff --git a/src/include/uwb_osal_common.h b/src/include/uwb_osal_common.h
deleted file mode 100755
index 5f89831..0000000
--- a/src/include/uwb_osal_common.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021 NXP.
- *
- * 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.
- */
-
-#include <pthread.h>
-
-extern void phUwb_GKI_shutdown();
-/*Function call context*/
-#define ADAPTATION_INIT 1
diff --git a/src/include/uwb_target.h b/src/include/uwb_target.h
deleted file mode 100755
index bd7db51..0000000
--- a/src/include/uwb_target.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2020 NXP
- *
- *  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.
- *
- ******************************************************************************/
-
-#ifndef UWB_TARGET_H
-#define UWB_TARGET_H
-
-#include "data_types.h"
-
-#ifndef USERIAL_DEBUG
-#define USERIAL_DEBUG false
-#endif
-
-/* Include common GKI definitions used by this platform */
-#include "uwb_gki_target.h"
-
-/* UCI Command, Notification or Data*/
-#define BT_EVT_TO_UWB_UCI 0x4000
-/* messages between UWB and UCI task */
-#define BT_EVT_TO_UWB_MSGS 0x4300
-
-/* start timer */
-#define BT_EVT_TO_START_TIMER 0x3c00
-
-/* start quick timer */
-#define BT_EVT_TO_START_QUICK_TIMER 0x3e00
-
-/******************************************************************************
-**
-** GKI Mail Box and Timer
-**
-******************************************************************************/
-
-/* Mailbox event mask for UWB stack */
-#ifndef UWB_MBOX_EVT_MASK
-#define UWB_MBOX_EVT_MASK (TASK_MBOX_0_EVT_MASK)
-#endif
-
-/* Mailbox ID for UWB stack */
-#ifndef UWB_MBOX_ID
-#define UWB_MBOX_ID (TASK_MBOX_0)
-#endif
-
-/* Mailbox event mask for UWA */
-#ifndef UWA_MBOX_EVT_MASK
-#define UWA_MBOX_EVT_MASK (TASK_MBOX_2_EVT_MASK)
-#endif
-
-/* Mailbox ID for UWA */
-#ifndef UWA_MBOX_ID
-#define UWA_MBOX_ID (TASK_MBOX_2)
-#endif
-
-/* GKI timer id used for protocol timer in UWB stack */
-#ifndef UWB_TIMER_ID
-#define UWB_TIMER_ID (TIMER_0)
-#endif
-
-/* GKI timer event mask used for protocol timer in UWB stack */
-#ifndef UWB_TIMER_EVT_MASK
-#define UWB_TIMER_EVT_MASK (TIMER_0_EVT_MASK)
-#endif
-
-/* GKI timer id used for quick timer in UWB stack */
-#ifndef UWB_QUICK_TIMER_ID
-#define UWB_QUICK_TIMER_ID (TIMER_1)
-#endif
-
-/* GKI timer event mask used for quick timer in UWB stack */
-#ifndef UWB_QUICK_TIMER_EVT_MASK
-#define UWB_QUICK_TIMER_EVT_MASK (TIMER_1_EVT_MASK)
-#endif
-
-/* GKI timer id used for protocol timer in UWA */
-#ifndef UWA_TIMER_ID
-#define UWA_TIMER_ID (TIMER_2)
-#endif
-
-/* GKI timer event mask used for protocol timer in UWA */
-#ifndef UWA_TIMER_EVT_MASK
-#define UWA_TIMER_EVT_MASK (TIMER_2_EVT_MASK)
-#endif
-
-/* Quick Timer */
-#ifndef QUICK_TIMER_TICKS_PER_SEC
-#define QUICK_TIMER_TICKS_PER_SEC 100 /* 10ms timer */
-#endif
-
-/******************************************************************************
-**
-** GKI Buffer Pools
-**
-******************************************************************************/
-
-/* UCI command/notification/data */
-#ifndef UWB_UCI_POOL_ID
-#define UWB_UCI_POOL_ID GKI_POOL_ID_2
-#endif
-
-/******************************************************************************
-**
-** UCI Transport definitions
-**
-******************************************************************************/
-/* offset of the first UCI packet in buffer for outgoing */
-#ifndef UCI_MSG_OFFSET_SIZE
-#define UCI_MSG_OFFSET_SIZE 1
-#endif
-
-/******************************************************************************
-**
-** UWB
-**
-******************************************************************************/
-
-/* Timeout for receiving response to UCI command in case of retry */
-#ifndef UWB_CMD_RETRY_TIMEOUT
-#define UWB_CMD_RETRY_TIMEOUT 75  // 75ms
-#endif
-
-/* Timeout for receiving response to UCI command */
-#ifndef UWB_CMD_CMPL_TIMEOUT
-#define UWB_CMD_CMPL_TIMEOUT 100  // 100ms
-#endif
-
-/* Maximum number of UCI commands that the UWBC accepts without needing to wait
- * for response */
-#ifndef UCI_MAX_CMD_WINDOW
-#define UCI_MAX_CMD_WINDOW 1
-#endif
-
-#ifndef UCI_CMD_MAX_RETRY_COUNT
-#define UCI_CMD_MAX_RETRY_COUNT 10
-#endif
-
-/*****************************************************************************
-**  Define HAL_WRITE depending on whether HAL is using shared GKI resources
-**  as the UWB stack.
-*****************************************************************************/
-#ifndef HAL_WRITE
-#define HAL_WRITE(p)                                            \
-  {                                                             \
-    uwb_cb.p_hal->write(p->len, (uint8_t*)(p + 1) + p->offset); \
-    phUwb_GKI_freebuf(p);                                       \
-  }
-#define HAL_RE_WRITE(p) \
-  { uwb_cb.p_hal->write(p->len, (uint8_t*)(p + 1) + p->offset); }
-
-#define HAL_UCI_CMD_WRITE(len, buf) \
-  { uwb_cb.p_hal->write(len, (uint8_t*)buf); }
-/* Mem allocation with 8 byte alignment */
-#define HAL_MALLOC(x) malloc(((x - 1) | 7) + 1)
-#endif /* HAL_WRITE */
-
-#endif /* UWB_TARGET_H */
diff --git a/src/include/uwb_types.h b/src/include/uwb_types.h
deleted file mode 100755
index 5e141b2..0000000
--- a/src/include/uwb_types.h
+++ /dev/null
@@ -1,377 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2014 Broadcom Corporation
- *  Copyright 2018-2020 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef UWB_TYPES_H
-#define UWB_TYPES_H
-#if __cplusplus > 199711L
-#define register  // Deprecated in C++11.
-#endif            // #if __cplusplus > 199711L
-/****************************************************************************
-** UWB_HDR header definition for UWB messages
-*****************************************************************************/
-typedef struct {
-  uint16_t event;
-  uint16_t len;
-  uint16_t offset;
-  uint16_t layer_specific;
-} UWB_HDR;
-#define UWB_HDR_SIZE (sizeof(UWB_HDR))
-
-/* Mask for UWB_HDR event field */
-#define UWB_EVT_MASK 0xFF00
-#define UWB_SUB_EVT_MASK 0x00FF
-
-/****************************************************************************
-** UWB_HAL_TASK  definitions
-*****************************************************************************/
-
-/* UWB_HAL_TASK event messages */
-/* UCI message for sending to UWBC          */
-#define UWB_HAL_EVT_TO_UWB_UCI 0x0100
-/* Request to start UCIT quick timer        */
-#define UWB_HAL_EVT_POST_CORE_RESET 0x0200
-/* Request to start chip-specific config    */
-#define UWB_HAL_EVT_TO_START_QUICK_TIMER 0x0300
-/* UCI message for hci persistency data     */
-#define UWB_HAL_EVT_HCI 0x0400
-/* UCI message to issue prediscover config  */
-#define UWB_HAL_EVT_PRE_DISCOVER 0x0500
-/* permission to send commands queued in HAL*/
-#define UWB_HAL_EVT_CONTROL_GRANTED 0x0600
-
-/* UWB_HAL_TASK sub event messages */
-#define UWB_HAL_HCI_RSP_NV_READ_EVT (0x01 | UWB_HAL_EVT_HCI)
-#define UWB_HAL_HCI_RSP_NV_WRITE_EVT (0x02 | UWB_HAL_EVT_HCI)
-#define UWB_HAL_HCI_VSC_TIMEOUT_EVT (0x03 | UWB_HAL_EVT_HCI)
-
-/* Event masks for UWB_TASK messages */
-/* UCI message for sending to host stack    */
-#define UWB_EVT_TO_UWB_UCI 0x4000
-/* Error notification to UWB Task           */
-#define UWB_EVT_TO_UWB_ERR 0x4100
-/* Messages between UWB and UCI task        */
-#define UWB_EVT_TO_UWB_MSGS 0x4200
-
-/*****************************************************************************
-** Macros to get and put bytes to and from a stream (Little Endian format).
-*****************************************************************************/
-
-#define UINT32_TO_STREAM(p, u32)     \
-  {                                  \
-    *(p)++ = (uint8_t)(u32);         \
-    *(p)++ = (uint8_t)((u32) >> 8);  \
-    *(p)++ = (uint8_t)((u32) >> 16); \
-    *(p)++ = (uint8_t)((u32) >> 24); \
-  }
-#define UINT24_TO_STREAM(p, u24)     \
-  {                                  \
-    *(p)++ = (uint8_t)(u24);         \
-    *(p)++ = (uint8_t)((u24) >> 8);  \
-    *(p)++ = (uint8_t)((u24) >> 16); \
-  }
-#define UINT16_TO_STREAM(p, u16)    \
-  {                                 \
-    *(p)++ = (uint8_t)(u16);        \
-    *(p)++ = (uint8_t)((u16) >> 8); \
-  }
-#define UINT8_TO_STREAM(p, u8) \
-  { *(p)++ = (uint8_t)(u8); }
-#define INT8_TO_STREAM(p, u8) \
-  { *(p)++ = (int8_t)(u8); }
-#define ARRAY32_TO_STREAM(p, a)                                   \
-  {                                                               \
-    register int ijk;                                             \
-    for (ijk = 0; ijk < 32; ijk++) *(p)++ = (uint8_t)a[31 - ijk]; \
-  }
-#define ARRAY16_TO_STREAM(p, a)                                   \
-  {                                                               \
-    register int ijk;                                             \
-    for (ijk = 0; ijk < 16; ijk++) *(p)++ = (uint8_t)a[15 - ijk]; \
-  }
-#define ARRAY8_TO_STREAM(p, a)                                  \
-  {                                                             \
-    register int ijk;                                           \
-    for (ijk = 0; ijk < 8; ijk++) *(p)++ = (uint8_t)a[7 - ijk]; \
-  }
-#define BDADDR_TO_STREAM(p, a)                    \
-  {                                               \
-    register int ijk;                             \
-    for (ijk = 0; ijk < BD_ADDR_LEN; ijk++)       \
-      *(p)++ = (uint8_t)a[BD_ADDR_LEN - 1 - ijk]; \
-  }
-#define LAP_TO_STREAM(p, a)                   \
-  {                                           \
-    register int ijk;                         \
-    for (ijk = 0; ijk < LAP_LEN; ijk++)       \
-      *(p)++ = (uint8_t)a[LAP_LEN - 1 - ijk]; \
-  }
-#define DEVCLASS_TO_STREAM(p, a)                    \
-  {                                                 \
-    register int ijk;                               \
-    for (ijk = 0; ijk < DEV_CLASS_LEN; ijk++)       \
-      *(p)++ = (uint8_t)a[DEV_CLASS_LEN - 1 - ijk]; \
-  }
-#define ARRAY_TO_STREAM(p, a, len)                            \
-  {                                                           \
-    register int ijk;                                         \
-    for (ijk = 0; ijk < len; ijk++) *(p)++ = (uint8_t)a[ijk]; \
-  }
-#define REVERSE_ARRAY_TO_STREAM(p, a, len)                              \
-  {                                                                     \
-    register int ijk;                                                   \
-    for (ijk = 0; ijk < len; ijk++) *(p)++ = (uint8_t)a[len - 1 - ijk]; \
-  }
-
-#define STREAM_TO_UINT8(u8, p) \
-  {                            \
-    u8 = (uint8_t)(*(p));      \
-    (p) += 1;                  \
-  }
-#define STREAM_TO_UINT16(u16, p)                                          \
-  {                                                                       \
-    u16 = (uint16_t)((uint16_t)(*(p)) + (((uint16_t)(*((p) + 1))) << 8)); \
-    (p) += 2;                                                             \
-  }
-#define STREAM_TO_INT16(i16, p)                                          \
-  {                                                                      \
-    i16 = (int16_t)((uint16_t)(*(p)) + (((uint16_t)(*((p) + 1))) << 8)); \
-    (p) += 2;                                                            \
-  }
-#define STREAM_TO_UINT24(u32, p)                                    \
-  {                                                                 \
-    u32 = (((uint32_t)(*(p))) + ((((uint32_t)(*((p) + 1)))) << 8) + \
-           ((((uint32_t)(*((p) + 2)))) << 16));                     \
-    (p) += 3;                                                       \
-  }
-#define STREAM_TO_UINT32(u32, p)                                    \
-  {                                                                 \
-    u32 = (((uint32_t)(*(p))) + ((((uint32_t)(*((p) + 1)))) << 8) + \
-           ((((uint32_t)(*((p) + 2)))) << 16) +                     \
-           ((((uint32_t)(*((p) + 3)))) << 24));                     \
-    (p) += 4;                                                       \
-  }
-#define STREAM_TO_UINT40(u40, p)                                    \
-  {                                                                 \
-    u40 = (((uint64_t)(*(p))) + ((((uint64_t)(*((p) + 1)))) << 8) + \
-           ((((uint64_t)(*((p) + 2)))) << 16) +                     \
-           ((((uint64_t)(*((p) + 3)))) << 24) +                     \
-           ((((uint64_t)(*((p) + 4)))) << 32));                     \
-    (p) += 5;                                                       \
-  }
-#define STREAM_TO_UINT64(u64, p)                                    \
-  {                                                                 \
-    u64 = (((uint64_t)(*(p))) + ((((uint64_t)(*((p) + 1)))) << 8) + \
-           ((((uint64_t)(*((p) + 2)))) << 16) +                     \
-           ((((uint64_t)(*((p) + 3)))) << 24) +                     \
-           ((((uint64_t)(*((p) + 4)))) << 32) +                     \
-           ((((uint64_t)(*((p) + 5)))) << 40) +                     \
-           ((((uint64_t)(*((p) + 6)))) << 48) +                     \
-           ((((uint64_t)(*((p) + 7)))) << 56));                     \
-    (p) += 8;                                                       \
-  }
-#define STREAM_TO_BDADDR(a, p)                              \
-  {                                                         \
-    register int ijk;                                       \
-    register uint8_t* pbda = (uint8_t*)a + BD_ADDR_LEN - 1; \
-    for (ijk = 0; ijk < BD_ADDR_LEN; ijk++) *pbda-- = *p++; \
-  }
-#define STREAM_TO_ARRAY32(a, p)                   \
-  {                                               \
-    register int ijk;                             \
-    register uint8_t* _pa = (uint8_t*)a + 31;     \
-    for (ijk = 0; ijk < 32; ijk++) *_pa-- = *p++; \
-  }
-#define STREAM_TO_ARRAY16(a, p)                   \
-  {                                               \
-    register int ijk;                             \
-    register uint8_t* _pa = (uint8_t*)a + 15;     \
-    for (ijk = 0; ijk < 16; ijk++) *_pa-- = *p++; \
-  }
-#define STREAM_TO_ARRAY8(a, p)                   \
-  {                                              \
-    register int ijk;                            \
-    register uint8_t* _pa = (uint8_t*)a + 7;     \
-    for (ijk = 0; ijk < 8; ijk++) *_pa-- = *p++; \
-  }
-#define STREAM_TO_DEVCLASS(a, p)                             \
-  {                                                          \
-    register int ijk;                                        \
-    register uint8_t* _pa = (uint8_t*)a + DEV_CLASS_LEN - 1; \
-    for (ijk = 0; ijk < DEV_CLASS_LEN; ijk++) *_pa-- = *p++; \
-  }
-#define STREAM_TO_LAP(a, p)                             \
-  {                                                     \
-    register int ijk;                                   \
-    register uint8_t* plap = (uint8_t*)a + LAP_LEN - 1; \
-    for (ijk = 0; ijk < LAP_LEN; ijk++) *plap-- = *p++; \
-  }
-#define STREAM_TO_ARRAY(a, p, len)                             \
-  {                                                            \
-    register int ijk;                                          \
-    for (ijk = 0; ijk < len; ijk++) ((uint8_t*)a)[ijk] = *p++; \
-  }
-#define REVERSE_STREAM_TO_ARRAY(a, p, len)         \
-  {                                                \
-    register int ijk;                              \
-    register uint8_t* _pa = (uint8_t*)a + len - 1; \
-    for (ijk = 0; ijk < len; ijk++) *_pa-- = *p++; \
-  }
-
-/*****************************************************************************
-** Macros to get and put bytes to and from a field (Little Endian format).
-** These are the same as to stream, except the pointer is not incremented.
-*****************************************************************************/
-
-#define UINT32_TO_FIELD(p, u32)                    \
-  {                                                \
-    *(uint8_t*)(p) = (uint8_t)(u32);               \
-    *((uint8_t*)(p) + 1) = (uint8_t)((u32) >> 8);  \
-    *((uint8_t*)(p) + 2) = (uint8_t)((u32) >> 16); \
-    *((uint8_t*)(p) + 3) = (uint8_t)((u32) >> 24); \
-  }
-#define UINT24_TO_FIELD(p, u24)                    \
-  {                                                \
-    *(uint8_t*)(p) = (uint8_t)(u24);               \
-    *((uint8_t*)(p) + 1) = (uint8_t)((u24) >> 8);  \
-    *((uint8_t*)(p) + 2) = (uint8_t)((u24) >> 16); \
-  }
-#define UINT16_TO_FIELD(p, u16)                   \
-  {                                               \
-    *(uint8_t*)(p) = (uint8_t)(u16);              \
-    *((uint8_t*)(p) + 1) = (uint8_t)((u16) >> 8); \
-  }
-#define UINT8_TO_FIELD(p, u8) \
-  { *(uint8_t*)(p) = (uint8_t)(u8); }
-
-/*****************************************************************************
-** Macros to get and put bytes to and from a stream (Big Endian format)
-*****************************************************************************/
-
-#define UINT32_TO_BE_STREAM(p, u32)  \
-  {                                  \
-    *(p)++ = (uint8_t)((u32) >> 24); \
-    *(p)++ = (uint8_t)((u32) >> 16); \
-    *(p)++ = (uint8_t)((u32) >> 8);  \
-    *(p)++ = (uint8_t)(u32);         \
-  }
-#define UINT24_TO_BE_STREAM(p, u24)  \
-  {                                  \
-    *(p)++ = (uint8_t)((u24) >> 16); \
-    *(p)++ = (uint8_t)((u24) >> 8);  \
-    *(p)++ = (uint8_t)(u24);         \
-  }
-#define UINT16_TO_BE_STREAM(p, u16) \
-  {                                 \
-    *(p)++ = (uint8_t)((u16) >> 8); \
-    *(p)++ = (uint8_t)(u16);        \
-  }
-#define UINT8_TO_BE_STREAM(p, u8) \
-  { *(p)++ = (uint8_t)(u8); }
-#define ARRAY_TO_BE_STREAM(p, a, len)                         \
-  {                                                           \
-    register int ijk;                                         \
-    for (ijk = 0; ijk < len; ijk++) *(p)++ = (uint8_t)a[ijk]; \
-  }
-
-#define BE_STREAM_TO_UINT8(u8, p) \
-  {                               \
-    u8 = (uint8_t)(*(p));         \
-    (p) += 1;                     \
-  }
-#define BE_STREAM_TO_UINT16(u16, p)                                     \
-  {                                                                     \
-    u16 = (uint16_t)(((uint16_t)(*(p)) << 8) + (uint16_t)(*((p) + 1))); \
-    (p) += 2;                                                           \
-  }
-#define BE_STREAM_TO_UINT24(u32, p)                                   \
-  {                                                                   \
-    u32 = (((uint32_t)(*((p) + 2))) + ((uint32_t)(*((p) + 1)) << 8) + \
-           ((uint32_t)(*(p)) << 16));                                 \
-    (p) += 3;                                                         \
-  }
-#define BE_STREAM_TO_UINT32(u32, p)                                    \
-  {                                                                    \
-    u32 = ((uint32_t)(*((p) + 3)) + ((uint32_t)(*((p) + 2)) << 8) +    \
-           ((uint32_t)(*((p) + 1)) << 16) + ((uint32_t)(*(p)) << 24)); \
-    (p) += 4;                                                          \
-  }
-#define BE_STREAM_TO_ARRAY(p, a, len)                          \
-  {                                                            \
-    register int ijk;                                          \
-    for (ijk = 0; ijk < len; ijk++) ((uint8_t*)a)[ijk] = *p++; \
-  }
-
-/*****************************************************************************
-** Macros to get and put bytes to and from a field (Big Endian format).
-** These are the same as to stream, except the pointer is not incremented.
-*****************************************************************************/
-
-#define UINT32_TO_BE_FIELD(p, u32)                 \
-  {                                                \
-    *(uint8_t*)(p) = (uint8_t)((u32) >> 24);       \
-    *((uint8_t*)(p) + 1) = (uint8_t)((u32) >> 16); \
-    *((uint8_t*)(p) + 2) = (uint8_t)((u32) >> 8);  \
-    *((uint8_t*)(p) + 3) = (uint8_t)(u32);         \
-  }
-#define UINT24_TO_BE_FIELD(p, u24)                \
-  {                                               \
-    *(uint8_t*)(p) = (uint8_t)((u24) >> 16);      \
-    *((uint8_t*)(p) + 1) = (uint8_t)((u24) >> 8); \
-    *((uint8_t*)(p) + 2) = (uint8_t)(u24);        \
-  }
-#define UINT16_TO_BE_FIELD(p, u16)          \
-  {                                         \
-    *(uint8_t*)(p) = (uint8_t)((u16) >> 8); \
-    *((uint8_t*)(p) + 1) = (uint8_t)(u16);  \
-  }
-#define UINT8_TO_BE_FIELD(p, u8) \
-  { *(uint8_t*)(p) = (uint8_t)(u8); }
-
-/*****************************************************************************
-** Define trace levels
-*****************************************************************************/
-
-/* No trace messages to be generated    */
-#define BT_TRACE_LEVEL_NONE 0
-/* Error condition trace messages       */
-#define BT_TRACE_LEVEL_ERROR 1
-/* Warning condition trace messages     */
-#define BT_TRACE_LEVEL_WARNING 2
-/* API traces                           */
-#define BT_TRACE_LEVEL_API 3
-/* Debug messages for events            */
-#define BT_TRACE_LEVEL_EVENT 4
-/* Full debug messages                  */
-#define BT_TRACE_LEVEL_DEBUG 5
-
-#define TRACE_CTRL_GENERAL 0x00000000
-#define TRACE_LAYER_UCI 0x00280000
-#define TRACE_LAYER_HAL 0x00310000
-#define TRACE_LAYER_GKI 0x001a0000
-#define TRACE_ORG_STACK 0x00000000
-#define TRACE_ORG_GKI 0x00000400
-
-#define TRACE_TYPE_ERROR 0x00000000
-#define TRACE_TYPE_WARNING 0x00000001
-#define TRACE_TYPE_API 0x00000002
-#define TRACE_TYPE_EVENT 0x00000003
-#define TRACE_TYPE_DEBUG 0x00000004
-
-#define TRACE_TYPE_GENERIC 0x00000008
-
-#endif /* UWB_TYPES_H */
diff --git a/src/log/uci_log.h b/src/log/uci_log.h
deleted file mode 100755
index 87d79b9..0000000
--- a/src/log/uci_log.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021 NXP.
- *
- * 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.
- */
-
-#ifndef UWB_UCI_LOG_H_
-#define UWB_UCI_LOG_H_
-
-#include <log/log.h>
-
-/* global log level Ref */
-extern bool uwb_debug_enabled;
-
-static const char* UWB_UCI_CORE_LOG = "UwbUciCore";
-
-#ifndef UNUSED
-#define UNUSED(X) (void)X;
-#endif
-
-/* define log module included when compile */
-#define ENABLE_UCI_LOGGING TRUE
-
-/* ############## Logging APIs of actual modules ################# */
-/* Logging APIs used by UCI module */
-#if (ENABLE_UCI_LOGGING == TRUE)
-#define UCI_TRACE_D(...)                                         \
-  {                                                              \
-    if (uwb_debug_enabled)                                       \
-      LOG_PRI(ANDROID_LOG_DEBUG, UWB_UCI_CORE_LOG, __VA_ARGS__); \
-  }
-#define UCI_TRACE_I(...)                                        \
-  {                                                             \
-    if (uwb_debug_enabled)                                      \
-      LOG_PRI(ANDROID_LOG_INFO, UWB_UCI_CORE_LOG, __VA_ARGS__); \
-  }
-#define UCI_TRACE_W(...)                                        \
-  {                                                             \
-    if (uwb_debug_enabled)                                      \
-      LOG_PRI(ANDROID_LOG_WARN, UWB_UCI_CORE_LOG, __VA_ARGS__); \
-  }
-#define UCI_TRACE_E(...)                                         \
-  {                                                              \
-    if (uwb_debug_enabled)                                       \
-      LOG_PRI(ANDROID_LOG_ERROR, UWB_UCI_CORE_LOG, __VA_ARGS__); \
-  }
-#else
-#define UCI_TRACE_D(...)
-#define UCI_TRACE_I(...)
-#define UCI_TRACE_W(...)
-#define UCI_TRACE_E(...)
-#endif /* Logging APIs used by UCI module */
-
-#endif /* UWB_UCI_LOG_H_ */
diff --git a/src/rust/uwb_core/protos/uwb_service.proto b/src/rust/uwb_core/protos/uwb_service.proto
index 3d51c4d..944f82e 100644
--- a/src/rust/uwb_core/protos/uwb_service.proto
+++ b/src/rust/uwb_core/protos/uwb_service.proto
@@ -95,8 +95,7 @@
   UCI_STATUS_RANGING_RX_MAC_IE_MISSING = 39;
   UCI_STATUS_ERROR_ROUND_INDEX_NOT_ACTIVATED = 40;
   UCI_STATUS_ERROR_NUMBER_OF_ACTIVE_RANGING_ROUNDS_EXCEEDED = 41;
-  UCI_STATUS_ERROR_ROUND_INDEX_NOT_SET_AS_INITIATOR = 42;
-  UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST = 43;
+  UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST = 42;
 
   UCI_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED = 48;
   UCI_STATUS_DATA_RX_CRC_ERROR = 49;
@@ -108,12 +107,6 @@
   UCI_STATUS_RFU_OR_VENDOR_SPECIFIC = 255;
 }
 
-// Represents uwb_uci_packets::OwrAoaStatusCode
-enum OwrAoaStatusCode {
-    UCI_STATUS_SUCCESS = 0;
-    UCI_STATUS_INTER_FRAME_INTERVAL_TIMEOUT = 1;
-}
-
 // Represent uwb_uci_packets::DeviceState.
 enum DeviceState {
     DEVICE_STATE_READY = 0;
@@ -451,7 +444,7 @@
 // uwb_uci_packets::ExtendedAddressOwrAoaRangingMeasurement.
 message OwrAoaRangingMeasurement {
   uint64 mac_address = 1;
-  OwrAoaStatusCode owr_aoa_status_code = 2;
+  StatusCode status = 2;
   uint32 nlos = 3;
   uint32 block_index = 4;
   uint32 frame_sequence_number = 5;
diff --git a/src/rust/uwb_core/src/params/uci_packets.rs b/src/rust/uwb_core/src/params/uci_packets.rs
index 2e0941e..5cd5822 100644
--- a/src/rust/uwb_core/src/params/uci_packets.rs
+++ b/src/rust/uwb_core/src/params/uci_packets.rs
@@ -24,11 +24,10 @@
     Controlee, ControleeStatus, Controlees, CreditAvailability, DataRcvStatusCode,
     DataTransferNtfStatusCode, DeviceConfigId, DeviceConfigStatus, DeviceConfigTlv, DeviceState,
     ExtendedAddressDlTdoaRangingMeasurement, ExtendedAddressOwrAoaRangingMeasurement,
-    ExtendedAddressTwoWayRangingMeasurement, FiraComponent, GroupId, MessageType,
-    MulticastUpdateStatusCode, OwrAoaStatusCode, PowerStats, RangingMeasurementType, ReasonCode,
-    ResetConfig, SessionState, SessionType, ShortAddressDlTdoaRangingMeasurement,
-    ShortAddressOwrAoaRangingMeasurement, ShortAddressTwoWayRangingMeasurement, StatusCode,
-    UpdateMulticastListAction,
+    ExtendedAddressTwoWayRangingMeasurement, GroupId, MessageType, MulticastUpdateStatusCode,
+    PowerStats, RangingMeasurementType, ReasonCode, ResetConfig, SessionState, SessionType,
+    ShortAddressDlTdoaRangingMeasurement, ShortAddressOwrAoaRangingMeasurement,
+    ShortAddressTwoWayRangingMeasurement, StatusCode, UpdateMulticastListAction,
 };
 pub(crate) use uwb_uci_packets::{UciControlPacket, UciDataPacket, UciDataPacketHal};
 
@@ -38,6 +37,10 @@
 pub type SessionId = u32;
 /// The type of the sub-session identifier.
 pub type SubSessionId = u32;
+/// The type of the session handle.
+pub type SessionHandle = u32;
+/// Generic type used to represent either a session id or session handle.
+pub type SessionToken = u32;
 
 /// Wrap the original AppConfigTlv type to redact the PII fields when logging.
 #[derive(Clone, PartialEq)]
diff --git a/src/rust/uwb_core/src/proto/mappings.rs b/src/rust/uwb_core/src/proto/mappings.rs
index 0d21c09..cb0e078 100644
--- a/src/rust/uwb_core/src/proto/mappings.rs
+++ b/src/rust/uwb_core/src/proto/mappings.rs
@@ -29,8 +29,8 @@
 };
 use crate::params::uci_packets::{
     Controlee, DeviceState, ExtendedAddressDlTdoaRangingMeasurement,
-    ExtendedAddressOwrAoaRangingMeasurement, ExtendedAddressTwoWayRangingMeasurement,
-    OwrAoaStatusCode, PowerStats, RangingMeasurementType, ReasonCode, SessionState, SessionType,
+    ExtendedAddressOwrAoaRangingMeasurement, ExtendedAddressTwoWayRangingMeasurement, PowerStats,
+    RangingMeasurementType, ReasonCode, SessionState, SessionType,
     ShortAddressDlTdoaRangingMeasurement, ShortAddressOwrAoaRangingMeasurement,
     ShortAddressTwoWayRangingMeasurement, StatusCode, UpdateMulticastListAction,
 };
@@ -42,8 +42,7 @@
     FiraAppConfigParams as ProtoFiraAppConfigParams, HoppingMode as ProtoHoppingMode,
     KeyRotation as ProtoKeyRotation, MacAddressMode as ProtoMacAddressMode,
     MacFcsType as ProtoMacFcsType, MultiNodeMode as ProtoMultiNodeMode,
-    OwrAoaRangingMeasurement as ProtoOwrAoaRangingMeasurement,
-    OwrAoaStatusCode as ProtoOwrAoaStatusCode, PowerStats as ProtoPowerStats,
+    OwrAoaRangingMeasurement as ProtoOwrAoaRangingMeasurement, PowerStats as ProtoPowerStats,
     PreambleDuration as ProtoPreambleDuration, PrfMode as ProtoPrfMode,
     PsduDataRate as ProtoPsduDataRate, RangeDataNtfConfig as ProtoRangeDataNtfConfig,
     RangingMeasurementType as ProtoRangingMeasurementType,
@@ -167,9 +166,6 @@
             ProtoStatusCode::UCI_STATUS_ERROR_NUMBER_OF_ACTIVE_RANGING_ROUNDS_EXCEEDED => {
                     StatusCode::UciStatusErrorNumberOfActiveRangingRoundsExceeded
             }
-            ProtoStatusCode::UCI_STATUS_ERROR_ROUND_INDEX_NOT_SET_AS_INITIATOR => {
-                StatusCode::UciStatusErrorRoundIndexNotSetAsInitiator
-            }
             ProtoStatusCode::UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST =>
                     StatusCode::UciStatusErrorDlTdoaDeviceAddressNotMatchingInReplyTimeList,
             ProtoStatusCode::UCI_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED => {
@@ -256,9 +252,6 @@
             StatusCode::UciStatusErrorNumberOfActiveRangingRoundsExceeded => {
                 ProtoStatusCode::UCI_STATUS_ERROR_NUMBER_OF_ACTIVE_RANGING_ROUNDS_EXCEEDED
             }
-            StatusCode::UciStatusErrorRoundIndexNotSetAsInitiator => {
-                ProtoStatusCode::UCI_STATUS_ERROR_ROUND_INDEX_NOT_SET_AS_INITIATOR
-            }
             StatusCode::UciStatusErrorDlTdoaDeviceAddressNotMatchingInReplyTimeList => {
                 ProtoStatusCode::UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST
             }
@@ -283,12 +276,6 @@
 }
 
 enum_mapping! {
-    ProtoOwrAoaStatusCode => OwrAoaStatusCode,
-    UCI_STATUS_SUCCESS => UciStatusSuccess,
-    UCI_STATUS_INTER_FRAME_INTERVAL_TIMEOUT => UciStatusInterFrameIntervalTimeout,
-}
-
-enum_mapping! {
     ProtoDeviceState => DeviceState,
     DEVICE_STATE_READY => DeviceStateReady,
     DEVICE_STATE_ACTIVE => DeviceStateActive,
@@ -766,7 +753,7 @@
     fn from(item: ShortAddressOwrAoaRangingMeasurement) -> Self {
         let mut result = Self::new();
         result.set_mac_address(item.mac_address.into());
-        result.set_owr_aoa_status_code(item.status.into());
+        result.set_status(item.status.into());
         result.set_nlos(item.nlos.into());
         result.set_block_index(item.block_index.into());
         result.set_frame_sequence_number(item.frame_sequence_number.into());
@@ -782,7 +769,7 @@
     fn from(item: ExtendedAddressOwrAoaRangingMeasurement) -> Self {
         let mut result = Self::new();
         result.set_mac_address(item.mac_address);
-        result.set_owr_aoa_status_code(item.status.into());
+        result.set_status(item.status.into());
         result.set_nlos(item.nlos.into());
         result.set_block_index(item.block_index.into());
         result.set_frame_sequence_number(item.frame_sequence_number.into());
@@ -876,7 +863,7 @@
     fn from(item: SessionRangeData) -> Self {
         let mut result = Self::new();
         result.set_sequence_number(item.sequence_number);
-        result.set_session_id(item.session_id);
+        result.set_session_id(item.session_token);
         result.set_current_ranging_interval_ms(item.current_ranging_interval_ms);
         result.set_ranging_measurement_type(item.ranging_measurement_type.into());
         match to_proto_ranging_measurements(item.ranging_measurements) {
@@ -971,8 +958,7 @@
     type Error = String;
     fn try_from(item: ProtoControlee) -> std::result::Result<Self, Self::Error> {
         Ok(Self {
-            short_address: item
-                .short_address
+            short_address: item.short_address.to_ne_bytes()[0..2]
                 .try_into()
                 .map_err(|_| "Failed to convert short_address")?,
             subsession_id: item.subsession_id,
diff --git a/src/rust/uwb_core/src/service/uwb_service.rs b/src/rust/uwb_core/src/service/uwb_service.rs
index a2ecb85..ce00f95 100644
--- a/src/rust/uwb_core/src/service/uwb_service.rs
+++ b/src/rust/uwb_core/src/service/uwb_service.rs
@@ -709,7 +709,8 @@
         let session_type = SessionType::FiraRangingSession;
         let params = generate_params();
         let action = UpdateMulticastListAction::AddControlee;
-        let controlees = vec![Controlee { short_address: 0x13, subsession_id: 0x24 }];
+        let short_address: [u8; 2] = [0x12, 0x34];
+        let controlees = vec![Controlee { short_address, subsession_id: 0x24 }];
 
         let uci_manager = MockUciManager::new();
         let (service, _, _runtime) = setup_uwb_service(uci_manager);
diff --git a/src/rust/uwb_core/src/session/session_manager.rs b/src/rust/uwb_core/src/session/session_manager.rs
index e9432ba..2c9a711 100644
--- a/src/rust/uwb_core/src/session/session_manager.rs
+++ b/src/rust/uwb_core/src/session/session_manager.rs
@@ -294,7 +294,7 @@
 
     fn handle_uci_notification(&mut self, notf: UciSessionNotification) {
         match notf {
-            UciSessionNotification::Status { session_id, session_state, reason_code } => {
+            UciSessionNotification::Status { session_token, session_state, reason_code } => {
                 let reason_code = match ReasonCode::try_from(reason_code) {
                     Ok(r) => r,
                     Err(_) => {
@@ -306,21 +306,21 @@
                     }
                 };
                 if session_state == SessionState::SessionStateDeinit {
-                    debug!("Session {} is deinitialized", session_id);
-                    let _ = self.active_sessions.remove(&session_id);
+                    debug!("Session {} is deinitialized", session_token);
+                    let _ = self.active_sessions.remove(&session_token);
                     let _ = self.session_notf_sender.send(SessionNotification::SessionState {
-                        session_id,
+                        session_id: session_token,
                         session_state,
                         reason_code,
                     });
                     return;
                 }
 
-                match self.active_sessions.get_mut(&session_id) {
+                match self.active_sessions.get_mut(&session_token) {
                     Some(session) => {
                         session.on_session_status_changed(session_state);
                         let _ = self.session_notf_sender.send(SessionNotification::SessionState {
-                            session_id,
+                            session_id: session_token,
                             session_state,
                             reason_code,
                         });
@@ -328,36 +328,36 @@
                     None => {
                         warn!(
                             "Received notification of the unknown Session {}: {:?}, {:?}",
-                            session_id, session_state, reason_code
+                            session_token, session_state, reason_code
                         );
                     }
                 }
             }
             UciSessionNotification::UpdateControllerMulticastList {
-                session_id,
+                session_token,
                 remaining_multicast_list_size: _,
                 status_list,
-            } => match self.active_sessions.get_mut(&session_id) {
+            } => match self.active_sessions.get_mut(&session_token) {
                 Some(session) => session.on_controller_multicast_list_udpated(status_list),
                 None => {
                     warn!(
                         "Received the notification of the unknown Session {}: {:?}",
-                        session_id, status_list
+                        session_token, status_list
                     );
                 }
             },
             UciSessionNotification::SessionInfo(range_data) => {
-                if self.active_sessions.get(&range_data.session_id).is_some() {
+                if self.active_sessions.get(&range_data.session_token).is_some() {
                     let _ = self.session_notf_sender.send(SessionNotification::RangeData {
-                        session_id: range_data.session_id,
+                        session_id: range_data.session_token,
                         range_data,
                     });
                 } else {
                     warn!("Received range data of the unknown Session: {:?}", range_data);
                 }
             }
-            UciSessionNotification::DataCredit { session_id, credit_availability: _ } => {
-                match self.active_sessions.get(&session_id) {
+            UciSessionNotification::DataCredit { session_token, credit_availability: _ } => {
+                match self.active_sessions.get(&session_token) {
                     Some(_) => {
                         /*
                          * TODO(b/270443790): Handle the DataCredit notification in the new
@@ -367,17 +367,17 @@
                     None => {
                         warn!(
                             "Received the Data Credit notification for an unknown Session {}",
-                            session_id
+                            session_token
                         );
                     }
                 }
             }
             UciSessionNotification::DataTransferStatus {
-                session_id,
+                session_token,
                 uci_sequence_number: _,
                 status: _,
             } => {
-                match self.active_sessions.get(&session_id) {
+                match self.active_sessions.get(&session_token) {
                     Some(_) => {
                         /*
                          * TODO(b/270443790): Handle the DataTransferStatus notification in the
@@ -387,7 +387,7 @@
                     None => {
                         warn!(
                             "Received a Data Transfer Status notification for unknown Session {}",
-                            session_id
+                            session_token
                         );
                     }
                 }
@@ -481,7 +481,7 @@
     pub(crate) fn session_range_data(session_id: SessionId) -> SessionRangeData {
         SessionRangeData {
             sequence_number: 1,
-            session_id,
+            session_token: session_id,
             current_ranging_interval_ms: 3,
             ranging_measurement_type: RangingMeasurementType::TwoWay,
             ranging_measurements: RangingMeasurements::ShortAddressTwoWay(vec![
@@ -512,7 +512,7 @@
         session_state: SessionState,
     ) -> UciNotification {
         UciNotification::Session(UciSessionNotification::Status {
-            session_id,
+            session_token: session_id,
             session_state,
             reason_code: ReasonCode::StateChangeWithSessionManagementCommands.into(),
         })
@@ -773,17 +773,18 @@
         let params = generate_params();
         let tlvs = params.generate_tlvs();
         let action = UpdateMulticastListAction::AddControlee;
-        let controlees = vec![Controlee { short_address: 0x13, subsession_id: 0x24 }];
+        let short_address: [u8; 2] = [0x12, 0x34];
+        let controlees = vec![Controlee { short_address, subsession_id: 0x24 }];
 
         let controlees_clone = controlees.clone();
         let (mut session_manager, mut mock_uci_manager, _) =
             setup_session_manager(move |uci_manager| {
                 let multicast_list_notf = vec![UciNotification::Session(
                     UciSessionNotification::UpdateControllerMulticastList {
-                        session_id,
+                        session_token: session_id,
                         remaining_multicast_list_size: 1,
                         status_list: vec![ControleeStatus {
-                            mac_address: 0x13,
+                            mac_address: [0x34, 0x12],
                             subsession_id: 0x24,
                             status: MulticastUpdateStatusCode::StatusOkMulticastListUpdate,
                         }],
@@ -830,7 +831,8 @@
         let params = generate_ccc_params();
         let tlvs = params.generate_tlvs();
         let action = UpdateMulticastListAction::AddControlee;
-        let controlees = vec![Controlee { short_address: 0x13, subsession_id: 0x24 }];
+        let short_address: [u8; 2] = [0x12, 0x34];
+        let controlees = vec![Controlee { short_address, subsession_id: 0x24 }];
 
         let (mut session_manager, mut mock_uci_manager, _) =
             setup_session_manager(move |uci_manager| {
@@ -869,7 +871,8 @@
         let params = generate_params();
         let tlvs = params.generate_tlvs();
         let action = UpdateMulticastListAction::AddControlee;
-        let controlees = vec![Controlee { short_address: 0x13, subsession_id: 0x24 }];
+        let short_address: [u8; 2] = [0x12, 0x34];
+        let controlees = vec![Controlee { short_address, subsession_id: 0x24 }];
 
         let controlees_clone = controlees.clone();
         let (mut session_manager, mut mock_uci_manager, _) =
diff --git a/src/rust/uwb_core/src/session/uwb_session.rs b/src/rust/uwb_core/src/session/uwb_session.rs
index 91bd6ce..37fcba4 100644
--- a/src/rust/uwb_core/src/session/uwb_session.rs
+++ b/src/rust/uwb_core/src/session/uwb_session.rs
@@ -178,6 +178,8 @@
     async fn initialize(&mut self, params: AppConfigParams) -> Result<Response> {
         debug_assert!(*self.state_receiver.borrow() == SessionState::SessionStateDeinit);
 
+        // TODO(b/279669973): Support CR-461 fully here. Need to wait for session init rsp.
+        // But, that does not seem to be fully plumbed up in session_manager yet.
         self.uci_manager.session_init(self.session_id, self.session_type).await?;
         self.wait_state(SessionState::SessionStateInit).await?;
 
diff --git a/src/rust/uwb_core/src/uci/command.rs b/src/rust/uwb_core/src/uci/command.rs
index dc06dab..2afb5a8 100644
--- a/src/rust/uwb_core/src/uci/command.rs
+++ b/src/rust/uwb_core/src/uci/command.rs
@@ -20,7 +20,7 @@
 use crate::error::{Error, Result};
 use crate::params::uci_packets::{
     AppConfigTlv, AppConfigTlvType, Controlees, CountryCode, DeviceConfigId, DeviceConfigTlv,
-    ResetConfig, SessionId, SessionType, UpdateMulticastListAction,
+    ResetConfig, SessionId, SessionToken, SessionType, UpdateMulticastListAction,
 };
 use uwb_uci_packets::{build_session_update_controller_multicast_list_cmd, GroupId, MessageType};
 
@@ -39,45 +39,46 @@
     CoreGetConfig {
         cfg_id: Vec<DeviceConfigId>,
     },
+    CoreQueryTimeStamp,
     SessionInit {
         session_id: SessionId,
         session_type: SessionType,
     },
     SessionDeinit {
-        session_id: SessionId,
+        session_token: SessionToken,
     },
     SessionSetAppConfig {
-        session_id: SessionId,
+        session_token: SessionToken,
         config_tlvs: Vec<AppConfigTlv>,
     },
     SessionGetAppConfig {
-        session_id: SessionId,
+        session_token: SessionToken,
         app_cfg: Vec<AppConfigTlvType>,
     },
     SessionGetCount,
     SessionGetState {
-        session_id: SessionId,
+        session_token: SessionToken,
     },
     SessionUpdateControllerMulticastList {
-        session_id: SessionId,
+        session_token: SessionToken,
         action: UpdateMulticastListAction,
         controlees: Controlees,
     },
     SessionUpdateDtTagRangingRounds {
-        session_id: u32,
+        session_token: u32,
         ranging_round_indexes: Vec<u8>,
     },
     SessionQueryMaxDataSize {
-        session_id: SessionId,
+        session_token: SessionToken,
     },
     SessionStart {
-        session_id: SessionId,
+        session_token: SessionToken,
     },
     SessionStop {
-        session_id: SessionId,
+        session_token: SessionToken,
     },
     SessionGetRangingCount {
-        session_id: SessionId,
+        session_token: SessionToken,
     },
     AndroidSetCountryCode {
         country_code: CountryCode,
@@ -99,21 +100,27 @@
             UciCommand::SessionInit { session_id, session_type } => {
                 uwb_uci_packets::SessionInitCmdBuilder { session_id, session_type }.build().into()
             }
-            UciCommand::SessionDeinit { session_id } => {
-                uwb_uci_packets::SessionDeinitCmdBuilder { session_id }.build().into()
+            UciCommand::SessionDeinit { session_token } => {
+                uwb_uci_packets::SessionDeinitCmdBuilder { session_token }.build().into()
             }
             UciCommand::CoreGetDeviceInfo => {
                 uwb_uci_packets::GetDeviceInfoCmdBuilder {}.build().into()
             }
             UciCommand::CoreGetCapsInfo => uwb_uci_packets::GetCapsInfoCmdBuilder {}.build().into(),
-            UciCommand::SessionGetState { session_id } => {
-                uwb_uci_packets::SessionGetStateCmdBuilder { session_id }.build().into()
+            UciCommand::SessionGetState { session_token } => {
+                uwb_uci_packets::SessionGetStateCmdBuilder { session_token }.build().into()
             }
-            UciCommand::SessionUpdateControllerMulticastList { session_id, action, controlees } => {
-                build_session_update_controller_multicast_list_cmd(session_id, action, controlees)
-                    .map_err(|_| Error::BadParameters)?
-                    .into()
-            }
+            UciCommand::SessionUpdateControllerMulticastList {
+                session_token,
+                action,
+                controlees,
+            } => build_session_update_controller_multicast_list_cmd(
+                session_token,
+                action,
+                controlees,
+            )
+            .map_err(|_| Error::BadParameters)?
+            .into(),
             UciCommand::CoreSetConfig { config_tlvs } => {
                 uwb_uci_packets::SetConfigCmdBuilder { tlvs: config_tlvs }.build().into()
             }
@@ -122,30 +129,34 @@
             }
             .build()
             .into(),
-            UciCommand::SessionSetAppConfig { session_id, config_tlvs } => {
+            UciCommand::CoreQueryTimeStamp {} => {
+                uwb_uci_packets::CoreQueryTimeStampCmdBuilder {}.build().into()
+            }
+            UciCommand::SessionSetAppConfig { session_token, config_tlvs } => {
                 uwb_uci_packets::SessionSetAppConfigCmdBuilder {
-                    session_id,
+                    session_token,
                     tlvs: config_tlvs.into_iter().map(|tlv| tlv.into_inner()).collect(),
                 }
                 .build()
                 .into()
             }
-            UciCommand::SessionGetAppConfig { session_id, app_cfg } => {
+            UciCommand::SessionGetAppConfig { session_token, app_cfg } => {
                 uwb_uci_packets::SessionGetAppConfigCmdBuilder {
-                    session_id,
+                    session_token,
                     app_cfg: app_cfg.into_iter().map(u8::from).collect(),
                 }
                 .build()
                 .into()
             }
-            UciCommand::SessionUpdateDtTagRangingRounds { session_id, ranging_round_indexes } => {
-                uwb_uci_packets::SessionUpdateDtTagRangingRoundsCmdBuilder {
-                    session_id,
-                    ranging_round_indexes,
-                }
-                .build()
-                .into()
+            UciCommand::SessionUpdateDtTagRangingRounds {
+                session_token,
+                ranging_round_indexes,
+            } => uwb_uci_packets::SessionUpdateDtTagRangingRoundsCmdBuilder {
+                session_token,
+                ranging_round_indexes,
             }
+            .build()
+            .into(),
             UciCommand::AndroidGetPowerStats => {
                 uwb_uci_packets::AndroidGetPowerStatsCmdBuilder {}.build().into()
             }
@@ -166,17 +177,17 @@
                 uwb_uci_packets::DeviceResetCmdBuilder { reset_config }.build().into()
             }
             // UCI Session Control Commands
-            UciCommand::SessionStart { session_id } => {
-                uwb_uci_packets::SessionStartCmdBuilder { session_id }.build().into()
+            UciCommand::SessionStart { session_token } => {
+                uwb_uci_packets::SessionStartCmdBuilder { session_token }.build().into()
             }
-            UciCommand::SessionStop { session_id } => {
-                uwb_uci_packets::SessionStopCmdBuilder { session_id }.build().into()
+            UciCommand::SessionStop { session_token } => {
+                uwb_uci_packets::SessionStopCmdBuilder { session_token }.build().into()
             }
-            UciCommand::SessionGetRangingCount { session_id } => {
-                uwb_uci_packets::SessionGetRangingCountCmdBuilder { session_id }.build().into()
+            UciCommand::SessionGetRangingCount { session_token } => {
+                uwb_uci_packets::SessionGetRangingCountCmdBuilder { session_token }.build().into()
             }
-            UciCommand::SessionQueryMaxDataSize { session_id } => {
-                uwb_uci_packets::SessionQueryMaxDataSizeCmdBuilder { session_id }.build().into()
+            UciCommand::SessionQueryMaxDataSize { session_token } => {
+                uwb_uci_packets::SessionQueryMaxDataSizeCmdBuilder { session_token }.build().into()
             }
         };
         Ok(packet)
@@ -266,27 +277,27 @@
             .into()
         );
 
-        cmd = UciCommand::SessionDeinit { session_id: 1 };
+        cmd = UciCommand::SessionDeinit { session_token: 1 };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
-            uwb_uci_packets::SessionDeinitCmdBuilder { session_id: 1 }.build().into()
+            uwb_uci_packets::SessionDeinitCmdBuilder { session_token: 1 }.build().into()
         );
 
-        cmd = UciCommand::SessionSetAppConfig { session_id: 1, config_tlvs: vec![] };
+        cmd = UciCommand::SessionSetAppConfig { session_token: 1, config_tlvs: vec![] };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
-            uwb_uci_packets::SessionSetAppConfigCmdBuilder { session_id: 1, tlvs: vec![] }
+            uwb_uci_packets::SessionSetAppConfigCmdBuilder { session_token: 1, tlvs: vec![] }
                 .build()
                 .into()
         );
 
-        cmd = UciCommand::SessionGetAppConfig { session_id: 1, app_cfg: vec![] };
+        cmd = UciCommand::SessionGetAppConfig { session_token: 1, app_cfg: vec![] };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
-            uwb_uci_packets::SessionGetAppConfigCmdBuilder { session_id: 1, app_cfg: vec![] }
+            uwb_uci_packets::SessionGetAppConfigCmdBuilder { session_token: 1, app_cfg: vec![] }
                 .build()
                 .into()
         );
@@ -295,15 +306,15 @@
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(packet, uwb_uci_packets::SessionGetCountCmdBuilder {}.build().into());
 
-        cmd = UciCommand::SessionGetState { session_id: 1 };
+        cmd = UciCommand::SessionGetState { session_token: 1 };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
-            uwb_uci_packets::SessionGetStateCmdBuilder { session_id: 1 }.build().into()
+            uwb_uci_packets::SessionGetStateCmdBuilder { session_token: 1 }.build().into()
         );
 
         cmd = UciCommand::SessionUpdateControllerMulticastList {
-            session_id: 1,
+            session_token: 1,
             action: UpdateMulticastListAction::AddControlee,
             controlees: Controlees::NoSessionKey(vec![]),
         };
@@ -321,43 +332,46 @@
         );
 
         cmd = UciCommand::SessionUpdateDtTagRangingRounds {
-            session_id: 1,
+            session_token: 1,
             ranging_round_indexes: vec![0],
         };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
             uwb_uci_packets::SessionUpdateDtTagRangingRoundsCmdBuilder {
-                session_id: 1,
+                session_token: 1,
                 ranging_round_indexes: vec![0]
             }
             .build()
             .into()
         );
 
-        cmd = UciCommand::SessionQueryMaxDataSize { session_id: 1 };
+        cmd = UciCommand::SessionQueryMaxDataSize { session_token: 1 };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
-            uwb_uci_packets::SessionQueryMaxDataSizeCmdBuilder { session_id: 1 }.build().into()
+            uwb_uci_packets::SessionQueryMaxDataSizeCmdBuilder { session_token: 1 }.build().into()
         );
 
-        cmd = UciCommand::SessionStart { session_id: 1 };
+        cmd = UciCommand::SessionStart { session_token: 1 };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
-            uwb_uci_packets::SessionStartCmdBuilder { session_id: 1 }.build().into()
+            uwb_uci_packets::SessionStartCmdBuilder { session_token: 1 }.build().into()
         );
 
-        cmd = UciCommand::SessionStop { session_id: 1 };
-        packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
-        assert_eq!(packet, uwb_uci_packets::SessionStopCmdBuilder { session_id: 1 }.build().into());
-
-        cmd = UciCommand::SessionGetRangingCount { session_id: 1 };
+        cmd = UciCommand::SessionStop { session_token: 1 };
         packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
         assert_eq!(
             packet,
-            uwb_uci_packets::SessionGetRangingCountCmdBuilder { session_id: 1 }.build().into()
+            uwb_uci_packets::SessionStopCmdBuilder { session_token: 1 }.build().into()
+        );
+
+        cmd = UciCommand::SessionGetRangingCount { session_token: 1 };
+        packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
+        assert_eq!(
+            packet,
+            uwb_uci_packets::SessionGetRangingCountCmdBuilder { session_token: 1 }.build().into()
         );
 
         let country_code: [u8; 2] = [85, 83];
diff --git a/src/rust/uwb_core/src/uci/mock_uci_hal.rs b/src/rust/uwb_core/src/uci/mock_uci_hal.rs
index 7e7cfc0..4b170f1 100644
--- a/src/rust/uwb_core/src/uci/mock_uci_hal.rs
+++ b/src/rust/uwb_core/src/uci/mock_uci_hal.rs
@@ -17,6 +17,7 @@
 use std::time::Duration;
 
 use async_trait::async_trait;
+use log::error;
 use tokio::sync::{mpsc, Notify};
 use tokio::time::timeout;
 
@@ -28,7 +29,8 @@
 /// The mock implementation of UciHal.
 #[derive(Default, Clone)]
 pub struct MockUciHal {
-    packet_sender: Option<mpsc::UnboundedSender<UciHalPacket>>,
+    // Wrap inside Arc<Mutex<>> so that the MockUciHal.clone(s) refer to the same object.
+    packet_sender: Arc<Mutex<Option<mpsc::UnboundedSender<UciHalPacket>>>>,
     expected_calls: Arc<Mutex<VecDeque<ExpectedCall>>>,
     expect_call_consumed: Arc<Notify>,
 }
@@ -92,6 +94,19 @@
         }
         true
     }
+
+    // Receive a UCI packet (eg: UCI DATA_MESSAGE_RCV), from UWBS to Host.
+    pub fn receive_packet(&mut self, packet: UciHalPacket) -> Result<()> {
+        if let Some(ref ps) = *self.packet_sender.lock().unwrap() {
+            match ps.send(packet) {
+                Ok(_) => Ok(()),
+                Err(_) => Err(Error::Unknown),
+            }
+        } else {
+            error!("MockUciHal unable to Rx packet from HAL as channel closed");
+            Err(Error::MockUndefined)
+        }
+    }
 }
 
 #[async_trait]
@@ -107,7 +122,7 @@
                     }
                 }
                 if out.is_ok() {
-                    self.packet_sender.replace(packet_sender);
+                    self.packet_sender.lock().unwrap().replace(packet_sender);
                 }
                 out
             }
@@ -125,7 +140,7 @@
             Some(ExpectedCall::Close { out }) => {
                 self.expect_call_consumed.notify_one();
                 if out.is_ok() {
-                    self.packet_sender = None;
+                    *self.packet_sender.lock().unwrap() = None;
                 }
                 out
             }
@@ -144,7 +159,8 @@
                 if expected_cmd == cmd =>
             {
                 self.expect_call_consumed.notify_one();
-                let packet_sender = self.packet_sender.as_mut().unwrap();
+                let mut packet_sender_opt = self.packet_sender.lock().unwrap();
+                let packet_sender = packet_sender_opt.as_mut().unwrap();
                 for msg in packets.into_iter() {
                     let _ = packet_sender.send(msg);
                 }
@@ -166,7 +182,8 @@
                 if expected_packet_tx == packet_tx =>
             {
                 self.expect_call_consumed.notify_one();
-                let packet_sender = self.packet_sender.as_mut().unwrap();
+                let mut packet_sender_opt = self.packet_sender.lock().unwrap();
+                let packet_sender = packet_sender_opt.as_mut().unwrap();
                 for msg in inject_packets_rx.into_iter() {
                     let _ = packet_sender.send(msg);
                 }
diff --git a/src/rust/uwb_core/src/uci/mock_uci_manager.rs b/src/rust/uwb_core/src/uci/mock_uci_manager.rs
index a206392..21e1ddb 100644
--- a/src/rust/uwb_core/src/uci/mock_uci_manager.rs
+++ b/src/rust/uwb_core/src/uci/mock_uci_manager.rs
@@ -28,10 +28,9 @@
 use crate::error::{Error, Result};
 use crate::params::uci_packets::{
     app_config_tlvs_eq, device_config_tlvs_eq, AppConfigTlv, AppConfigTlvType, CapTlv, Controlees,
-    CoreSetConfigResponse, CountryCode, DeviceConfigId, DeviceConfigTlv, FiraComponent,
-    GetDeviceInfoResponse, PowerStats, RawUciMessage, ResetConfig, SessionId, SessionState,
-    SessionType, SessionUpdateDtTagRangingRoundsResponse, SetAppConfigResponse,
-    UpdateMulticastListAction,
+    CoreSetConfigResponse, CountryCode, DeviceConfigId, DeviceConfigTlv, GetDeviceInfoResponse,
+    PowerStats, RawUciMessage, ResetConfig, SessionId, SessionState, SessionToken, SessionType,
+    SessionUpdateDtTagRangingRoundsResponse, SetAppConfigResponse, UpdateMulticastListAction,
 };
 use crate::uci::notification::{
     CoreNotification, DataRcvNotification, SessionNotification, UciNotification,
@@ -146,6 +145,13 @@
             .push_back(ExpectedCall::CoreGetConfig { expected_config_ids, out });
     }
 
+    /// Prepare Mock to expect core_query_uwb_timestamp.
+    ///
+    /// MockUciManager expects call with parameters, returns out as response.
+    pub fn expect_core_query_uwb_timestamp(&mut self, out: Result<u64>) {
+        self.expected_calls.lock().unwrap().push_back(ExpectedCall::CoreQueryTimeStamp { out });
+    }
+
     /// Prepare Mock to expect session_init.
     ///
     /// MockUciManager expects call with parameters, returns out as response, followed by notfs
@@ -389,15 +395,13 @@
         &mut self,
         expected_session_id: SessionId,
         expected_address: Vec<u8>,
-        expected_dest_end_point: FiraComponent,
-        expected_uci_sequence_num: u8,
+        expected_uci_sequence_num: u16,
         expected_app_payload_data: Vec<u8>,
         out: Result<()>,
     ) {
         self.expected_calls.lock().unwrap().push_back(ExpectedCall::SendDataPacket {
             expected_session_id,
             expected_address,
-            expected_dest_end_point,
             expected_uci_sequence_num,
             expected_app_payload_data,
             out,
@@ -576,6 +580,21 @@
         }
     }
 
+    async fn core_query_uwb_timestamp(&self) -> Result<u64> {
+        let mut expected_calls = self.expected_calls.lock().unwrap();
+        match expected_calls.pop_front() {
+            Some(ExpectedCall::CoreQueryTimeStamp { out }) => {
+                self.expect_call_consumed.notify_one();
+                out
+            }
+            Some(call) => {
+                expected_calls.push_front(call);
+                Err(Error::MockUndefined)
+            }
+            None => Err(Error::MockUndefined),
+        }
+    }
+
     async fn session_init(&self, session_id: SessionId, session_type: SessionType) -> Result<()> {
         let mut expected_calls = self.expected_calls.lock().unwrap();
         match expected_calls.pop_front() {
@@ -889,8 +908,7 @@
         &self,
         session_id: SessionId,
         address: Vec<u8>,
-        dest_end_point: FiraComponent,
-        uci_sequence_num: u8,
+        uci_sequence_num: u16,
         app_payload_data: Vec<u8>,
     ) -> Result<()> {
         let mut expected_calls = self.expected_calls.lock().unwrap();
@@ -898,13 +916,11 @@
             Some(ExpectedCall::SendDataPacket {
                 expected_session_id,
                 expected_address,
-                expected_dest_end_point,
                 expected_uci_sequence_num,
                 expected_app_payload_data,
                 out,
             }) if expected_session_id == session_id
                 && expected_address == address
-                && expected_dest_end_point == dest_end_point
                 && expected_uci_sequence_num == uci_sequence_num
                 && expected_app_payload_data == app_payload_data =>
             {
@@ -918,6 +934,13 @@
             None => Err(Error::MockUndefined),
         }
     }
+
+    async fn get_session_token_from_session_id(
+        &self,
+        _session_id: SessionId,
+    ) -> Result<SessionToken> {
+        Ok(1) // No uci call here, no mock required.
+    }
 }
 
 #[derive(Clone)]
@@ -948,6 +971,9 @@
         expected_config_ids: Vec<DeviceConfigId>,
         out: Result<Vec<DeviceConfigTlv>>,
     },
+    CoreQueryTimeStamp {
+        out: Result<u64>,
+    },
     SessionInit {
         expected_session_id: SessionId,
         expected_session_type: SessionType,
@@ -1024,8 +1050,7 @@
     SendDataPacket {
         expected_session_id: SessionId,
         expected_address: Vec<u8>,
-        expected_dest_end_point: FiraComponent,
-        expected_uci_sequence_num: u8,
+        expected_uci_sequence_num: u16,
         expected_app_payload_data: Vec<u8>,
         out: Result<()>,
     },
diff --git a/src/rust/uwb_core/src/uci/notification.rs b/src/rust/uwb_core/src/uci/notification.rs
index 8007158..2158850 100644
--- a/src/rust/uwb_core/src/uci/notification.rs
+++ b/src/rust/uwb_core/src/uci/notification.rs
@@ -22,9 +22,9 @@
 use crate::params::uci_packets::{
     ControleeStatus, CreditAvailability, DataRcvStatusCode, DataTransferNtfStatusCode, DeviceState,
     ExtendedAddressDlTdoaRangingMeasurement, ExtendedAddressOwrAoaRangingMeasurement,
-    ExtendedAddressTwoWayRangingMeasurement, FiraComponent, RangingMeasurementType, RawUciMessage,
-    SessionId, SessionState, ShortAddressDlTdoaRangingMeasurement,
-    ShortAddressOwrAoaRangingMeasurement, ShortAddressTwoWayRangingMeasurement, StatusCode,
+    ExtendedAddressTwoWayRangingMeasurement, RangingMeasurementType, RawUciMessage, SessionState,
+    SessionToken, ShortAddressDlTdoaRangingMeasurement, ShortAddressOwrAoaRangingMeasurement,
+    ShortAddressTwoWayRangingMeasurement, StatusCode,
 };
 
 /// enum of all UCI notifications with structured fields.
@@ -52,8 +52,8 @@
 pub enum SessionNotification {
     /// SessionStatusNtf equivalent.
     Status {
-        /// SessionId : u32
-        session_id: SessionId,
+        /// SessionToken : u32
+        session_token: SessionToken,
         /// uwb_uci_packets::SessionState.
         session_state: SessionState,
         /// uwb_uci_packets::Reasoncode.
@@ -61,8 +61,8 @@
     },
     /// SessionUpdateControllerMulticastListNtf equivalent.
     UpdateControllerMulticastList {
-        /// SessionId : u32
-        session_id: SessionId,
+        /// SessionToken : u32
+        session_token: SessionToken,
         /// count of controlees: u8
         remaining_multicast_list_size: usize,
         /// list of controlees.
@@ -72,15 +72,15 @@
     SessionInfo(SessionRangeData),
     /// DataCreditNtf equivalent.
     DataCredit {
-        /// SessionId : u32
-        session_id: SessionId,
+        /// SessionToken : u32
+        session_token: SessionToken,
         /// Credit Availability (for sending Data packets on UWB Session)
         credit_availability: CreditAvailability,
     },
     /// DataTransferStatusNtf equivalent.
     DataTransferStatus {
-        /// SessionId : u32
-        session_id: SessionId,
+        /// SessionToken : u32
+        session_token: SessionToken,
         /// Sequence Number: u8
         uci_sequence_number: u8,
         /// Data Transfer Status Code
@@ -95,7 +95,7 @@
     pub sequence_number: u32,
 
     /// The identifier of the session.
-    pub session_id: SessionId,
+    pub session_token: SessionToken,
 
     /// The current ranging interval setting in the unit of ms.
     pub current_ranging_interval_ms: u32,
@@ -137,26 +137,20 @@
 }
 
 /// The DATA_RCV packet
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, std::cmp::PartialEq)]
 pub struct DataRcvNotification {
     /// The identifier of the session on which data transfer is happening.
-    pub session_id: SessionId,
+    pub session_token: SessionToken,
 
     /// The status of the data rx.
     pub status: DataRcvStatusCode,
 
     /// The sequence number of the data packet.
-    pub uci_sequence_num: u32,
+    pub uci_sequence_num: u16,
 
     /// MacAddress of the sender of the application data.
     pub source_address: UwbAddress,
 
-    /// Identifier for the source FiraComponent.
-    pub source_fira_component: FiraComponent,
-
-    /// Identifier for the destination FiraComponent.
-    pub dest_fira_component: FiraComponent,
-
     /// Application Payload Data
     pub payload: Vec<u8>,
 }
@@ -166,12 +160,10 @@
     fn try_from(evt: uwb_uci_packets::UciDataPacket) -> std::result::Result<Self, Self::Error> {
         match evt.specialize() {
             uwb_uci_packets::UciDataPacketChild::UciDataRcv(evt) => Ok(DataRcvNotification {
-                session_id: evt.get_session_id(),
+                session_token: evt.get_session_token(),
                 status: evt.get_status(),
                 uci_sequence_num: evt.get_uci_sequence_number(),
                 source_address: UwbAddress::Extended(evt.get_source_mac_address().to_le_bytes()),
-                source_fira_component: evt.get_source_fira_component(),
-                dest_fira_component: evt.get_dest_fira_component(),
                 payload: evt.get_data().to_vec(),
             }),
             _ => {
@@ -242,13 +234,13 @@
         use uwb_uci_packets::SessionConfigNotificationChild;
         match evt.specialize() {
             SessionConfigNotificationChild::SessionStatusNtf(evt) => Ok(Self::Status {
-                session_id: evt.get_session_id(),
+                session_token: evt.get_session_token(),
                 session_state: evt.get_session_state(),
                 reason_code: evt.get_reason_code(),
             }),
             SessionConfigNotificationChild::SessionUpdateControllerMulticastListNtf(evt) => {
                 Ok(Self::UpdateControllerMulticastList {
-                    session_id: evt.get_session_id(),
+                    session_token: evt.get_session_token(),
                     remaining_multicast_list_size: evt.get_remaining_multicast_list_size() as usize,
                     status_list: evt.get_controlee_status().clone(),
                 })
@@ -270,12 +262,12 @@
         match evt.specialize() {
             SessionControlNotificationChild::SessionInfoNtf(evt) => evt.try_into(),
             SessionControlNotificationChild::DataCreditNtf(evt) => Ok(Self::DataCredit {
-                session_id: evt.get_session_id(),
+                session_token: evt.get_session_token(),
                 credit_availability: evt.get_credit_availability(),
             }),
             SessionControlNotificationChild::DataTransferStatusNtf(evt) => {
                 Ok(Self::DataTransferStatus {
-                    session_id: evt.get_session_id(),
+                    session_token: evt.get_session_token(),
                     uci_sequence_number: evt.get_uci_sequence_number(),
                     status: evt.get_status(),
                 })
@@ -307,7 +299,16 @@
             SessionInfoNtfChild::ShortMacOwrAoaSessionInfoNtf(evt) => {
                 if evt.get_owr_aoa_ranging_measurements().clone().len() == 1 {
                     RangingMeasurements::ShortAddressOwrAoa(
-                        evt.get_owr_aoa_ranging_measurements().clone().pop().unwrap(),
+                        match evt.get_owr_aoa_ranging_measurements().clone().pop() {
+                            Some(r) => r,
+                            None => {
+                                error!(
+                                    "Unable to parse ShortAddress OwrAoA measurement: {:?}",
+                                    evt
+                                );
+                                return Err(Error::BadParameters);
+                            }
+                        },
                     )
                 } else {
                     error!("Wrong count of OwrAoA ranging measurements {:?}", evt);
@@ -317,7 +318,16 @@
             SessionInfoNtfChild::ExtendedMacOwrAoaSessionInfoNtf(evt) => {
                 if evt.get_owr_aoa_ranging_measurements().clone().len() == 1 {
                     RangingMeasurements::ExtendedAddressOwrAoa(
-                        evt.get_owr_aoa_ranging_measurements().clone().pop().unwrap(),
+                        match evt.get_owr_aoa_ranging_measurements().clone().pop() {
+                            Some(r) => r,
+                            None => {
+                                error!(
+                                    "Unable to parse ExtendedAddress OwrAoA measurement: {:?}",
+                                    evt
+                                );
+                                return Err(Error::BadParameters);
+                            }
+                        },
                     )
                 } else {
                     error!("Wrong count of OwrAoA ranging measurements {:?}", evt);
@@ -363,7 +373,7 @@
         };
         Ok(Self::SessionInfo(SessionRangeData {
             sequence_number: evt.get_sequence_number(),
-            session_id: evt.get_session_id(),
+            session_token: evt.get_session_token(),
             current_ranging_interval_ms: evt.get_current_ranging_interval(),
             ranging_measurement_type: evt.get_ranging_measurement_type(),
             ranging_measurements,
@@ -450,7 +460,6 @@
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::params::uci_packets::OwrAoaStatusCode;
 
     #[test]
     fn test_ranging_measurements_trait() {
@@ -538,7 +547,7 @@
         let extended_two_way_session_info_ntf =
             uwb_uci_packets::ExtendedMacTwoWaySessionInfoNtfBuilder {
                 sequence_number: 0x10,
-                session_id: 0x11,
+                session_token: 0x11,
                 rcr_indicator: 0x12,
                 current_ranging_interval: 0x13,
                 two_way_ranging_measurements: vec![extended_measurement.clone()],
@@ -556,7 +565,7 @@
             uci_notification_from_extended_two_way_session_info_ntf,
             UciNotification::Session(SessionNotification::SessionInfo(SessionRangeData {
                 sequence_number: 0x10,
-                session_id: 0x11,
+                session_token: 0x11,
                 ranging_measurement_type: uwb_uci_packets::RangingMeasurementType::TwoWay,
                 current_ranging_interval_ms: 0x13,
                 ranging_measurements: RangingMeasurements::ExtendedAddressTwoWay(vec![
@@ -588,7 +597,7 @@
         };
         let short_two_way_session_info_ntf = uwb_uci_packets::ShortMacTwoWaySessionInfoNtfBuilder {
             sequence_number: 0x10,
-            session_id: 0x11,
+            session_token: 0x11,
             rcr_indicator: 0x12,
             current_ranging_interval: 0x13,
             two_way_ranging_measurements: vec![short_measurement.clone()],
@@ -606,7 +615,7 @@
             uci_notification_from_short_two_way_session_info_ntf,
             UciNotification::Session(SessionNotification::SessionInfo(SessionRangeData {
                 sequence_number: 0x10,
-                session_id: 0x11,
+                session_token: 0x11,
                 ranging_measurement_type: uwb_uci_packets::RangingMeasurementType::TwoWay,
                 current_ranging_interval_ms: 0x13,
                 ranging_measurements: RangingMeasurements::ShortAddressTwoWay(vec![
@@ -622,7 +631,7 @@
     fn test_session_notification_casting_from_extended_mac_owr_aoa_session_info_ntf() {
         let extended_measurement = uwb_uci_packets::ExtendedAddressOwrAoaRangingMeasurement {
             mac_address: 0x1234_5678_90ab,
-            status: OwrAoaStatusCode::UciStatusSuccess,
+            status: StatusCode::UciStatusOk,
             nlos: 0,
             frame_sequence_number: 1,
             block_index: 1,
@@ -634,7 +643,7 @@
         let extended_owr_aoa_session_info_ntf =
             uwb_uci_packets::ExtendedMacOwrAoaSessionInfoNtfBuilder {
                 sequence_number: 0x10,
-                session_id: 0x11,
+                session_token: 0x11,
                 rcr_indicator: 0x12,
                 current_ranging_interval: 0x13,
                 owr_aoa_ranging_measurements: vec![extended_measurement.clone()],
@@ -652,7 +661,7 @@
             uci_notification_from_extended_owr_aoa_session_info_ntf,
             UciNotification::Session(SessionNotification::SessionInfo(SessionRangeData {
                 sequence_number: 0x10,
-                session_id: 0x11,
+                session_token: 0x11,
                 ranging_measurement_type: uwb_uci_packets::RangingMeasurementType::OwrAoa,
                 current_ranging_interval_ms: 0x13,
                 ranging_measurements: RangingMeasurements::ExtendedAddressOwrAoa(
@@ -668,7 +677,7 @@
     fn test_session_notification_casting_from_short_mac_owr_aoa_session_info_ntf() {
         let short_measurement = uwb_uci_packets::ShortAddressOwrAoaRangingMeasurement {
             mac_address: 0x1234,
-            status: OwrAoaStatusCode::UciStatusSuccess,
+            status: StatusCode::UciStatusOk,
             nlos: 0,
             frame_sequence_number: 1,
             block_index: 1,
@@ -679,7 +688,7 @@
         };
         let short_owr_aoa_session_info_ntf = uwb_uci_packets::ShortMacOwrAoaSessionInfoNtfBuilder {
             sequence_number: 0x10,
-            session_id: 0x11,
+            session_token: 0x11,
             rcr_indicator: 0x12,
             current_ranging_interval: 0x13,
             owr_aoa_ranging_measurements: vec![short_measurement.clone()],
@@ -697,7 +706,7 @@
             uci_notification_from_short_owr_aoa_session_info_ntf,
             UciNotification::Session(SessionNotification::SessionInfo(SessionRangeData {
                 sequence_number: 0x10,
-                session_id: 0x11,
+                session_token: 0x11,
                 ranging_measurement_type: uwb_uci_packets::RangingMeasurementType::OwrAoa,
                 current_ranging_interval_ms: 0x13,
                 ranging_measurements: RangingMeasurements::ShortAddressOwrAoa(short_measurement),
@@ -710,7 +719,7 @@
     #[test]
     fn test_session_notification_casting_from_session_status_ntf() {
         let session_status_ntf = uwb_uci_packets::SessionStatusNtfBuilder {
-            session_id: 0x20,
+            session_token: 0x20,
             session_state: uwb_uci_packets::SessionState::SessionStateActive,
             reason_code: uwb_uci_packets::ReasonCode::StateChangeWithSessionManagementCommands
                 .into(),
@@ -725,7 +734,7 @@
         assert_eq!(
             uci_notification_from_session_status_ntf,
             UciNotification::Session(SessionNotification::Status {
-                session_id: 0x20,
+                session_token: 0x20,
                 session_state: uwb_uci_packets::SessionState::SessionStateActive,
                 reason_code: uwb_uci_packets::ReasonCode::StateChangeWithSessionManagementCommands
                     .into(),
@@ -737,18 +746,18 @@
     fn test_session_notification_casting_from_session_update_controller_multicast_list_ntf_packet()
     {
         let controlee_status = uwb_uci_packets::ControleeStatus {
-            mac_address: 0xc0a8,
+            mac_address: [0x0c, 0xa8],
             subsession_id: 0x30,
             status: uwb_uci_packets::MulticastUpdateStatusCode::StatusOkMulticastListUpdate,
         };
         let another_controlee_status = uwb_uci_packets::ControleeStatus {
-            mac_address: 0xc0a9,
+            mac_address: [0x0c, 0xa9],
             subsession_id: 0x31,
             status: uwb_uci_packets::MulticastUpdateStatusCode::StatusErrorKeyFetchFail,
         };
         let session_update_controller_multicast_list_ntf =
             uwb_uci_packets::SessionUpdateControllerMulticastListNtfBuilder {
-                session_id: 0x32,
+                session_token: 0x32,
                 remaining_multicast_list_size: 0x2,
                 controlee_status: vec![controlee_status.clone(), another_controlee_status.clone()],
             }
@@ -764,7 +773,7 @@
         assert_eq!(
             uci_notification_from_session_update_controller_multicast_list_ntf,
             UciNotification::Session(SessionNotification::UpdateControllerMulticastList {
-                session_id: 0x32,
+                session_token: 0x32,
                 remaining_multicast_list_size: 0x2,
                 status_list: vec![controlee_status, another_controlee_status],
             })
diff --git a/src/rust/uwb_core/src/uci/pcapng_uci_logger_factory.rs b/src/rust/uwb_core/src/uci/pcapng_uci_logger_factory.rs
index 04e1ef4..7c191b7 100644
--- a/src/rust/uwb_core/src/uci/pcapng_uci_logger_factory.rs
+++ b/src/rust/uwb_core/src/uci/pcapng_uci_logger_factory.rs
@@ -566,6 +566,7 @@
     #[test]
     fn test_file_switch_epb_unfit_case() {
         let dir = tempdir().unwrap();
+        let last_file_expected = dir.as_ref().to_owned().join("log_2.pcapng");
         {
             let runtime = Builder::new_multi_thread().enable_all().build().unwrap();
             let mut file_manager_140 = PcapngUciLoggerFactoryBuilder::new()
@@ -585,7 +586,15 @@
             let packet_2 = UciVendor_A_NotificationBuilder { opcode: 2, payload: None }.build();
             logger_0.log_uci_control_packet(packet_2.into());
             // Sleep needed to guarantee handling pending logs before runtime goes out of scope.
-            thread::sleep(time::Duration::from_millis(10));
+            let mut timeout = 100;
+            let timeout_slice = 10;
+            loop {
+                if last_file_expected.exists() || timeout == 0 {
+                    break;
+                }
+                thread::sleep(time::Duration::from_millis(timeout_slice));
+                timeout -= timeout_slice;
+            }
         }
         // Expect (Old to new):
         // File 2: SHB->IDB->EPB->IDB (cannot fit next)
diff --git a/src/rust/uwb_core/src/uci/response.rs b/src/rust/uwb_core/src/uci/response.rs
index b0d5b2b..dfeb6c8 100644
--- a/src/rust/uwb_core/src/uci/response.rs
+++ b/src/rust/uwb_core/src/uci/response.rs
@@ -17,12 +17,12 @@
 use crate::error::{Error, Result};
 use crate::params::uci_packets::{
     AppConfigTlv, CapTlv, CoreSetConfigResponse, DeviceConfigTlv, GetDeviceInfoResponse,
-    PowerStats, RawUciMessage, SessionState, SessionUpdateDtTagRangingRoundsResponse,
-    SetAppConfigResponse, StatusCode, UciControlPacket,
+    PowerStats, RawUciMessage, SessionHandle, SessionState,
+    SessionUpdateDtTagRangingRoundsResponse, SetAppConfigResponse, StatusCode, UciControlPacket,
 };
 use crate::uci::error::status_code_to_result;
 
-#[derive(Debug)]
+#[derive(Debug, Clone, PartialEq)]
 pub(super) enum UciResponse {
     SetLoggerMode,
     SetNotification,
@@ -33,7 +33,8 @@
     CoreGetCapsInfo(Result<Vec<CapTlv>>),
     CoreSetConfig(CoreSetConfigResponse),
     CoreGetConfig(Result<Vec<DeviceConfigTlv>>),
-    SessionInit(Result<()>),
+    CoreQueryTimeStamp(Result<u64>),
+    SessionInit(Result<Option<SessionHandle>>),
     SessionDeinit(Result<()>),
     SessionSetAppConfig(SetAppConfigResponse),
     SessionGetAppConfig(Result<Vec<AppConfigTlv>>),
@@ -59,6 +60,7 @@
             Self::CoreGetDeviceInfo(result) => Self::matches_result_retry(result),
             Self::CoreGetCapsInfo(result) => Self::matches_result_retry(result),
             Self::CoreGetConfig(result) => Self::matches_result_retry(result),
+            Self::CoreQueryTimeStamp(result) => Self::matches_result_retry(result),
             Self::SessionInit(result) => Self::matches_result_retry(result),
             Self::SessionDeinit(result) => Self::matches_result_retry(result),
             Self::SessionGetAppConfig(result) => Self::matches_result_retry(result),
@@ -141,6 +143,9 @@
             CoreResponseChild::GetConfigRsp(evt) => Ok(UciResponse::CoreGetConfig(
                 status_code_to_result(evt.get_status()).map(|_| evt.get_tlvs().clone()),
             )),
+            CoreResponseChild::CoreQueryTimeStampRsp(evt) => Ok(UciResponse::CoreQueryTimeStamp(
+                status_code_to_result(evt.get_status()).map(|_| evt.get_timeStamp()),
+            )),
             _ => Err(Error::Unknown),
         }
     }
@@ -154,8 +159,11 @@
         use uwb_uci_packets::SessionConfigResponseChild;
         match evt.specialize() {
             SessionConfigResponseChild::SessionInitRsp(evt) => {
-                Ok(UciResponse::SessionInit(status_code_to_result(evt.get_status())))
+                Ok(UciResponse::SessionInit(status_code_to_result(evt.get_status()).map(|_| None)))
             }
+            SessionConfigResponseChild::SessionInitRsp_V2(evt) => Ok(UciResponse::SessionInit(
+                status_code_to_result(evt.get_status()).map(|_| Some(evt.get_session_handle())),
+            )),
             SessionConfigResponseChild::SessionDeinitRsp(evt) => {
                 Ok(UciResponse::SessionDeinit(status_code_to_result(evt.get_status())))
             }
diff --git a/src/rust/uwb_core/src/uci/uci_hal.rs b/src/rust/uwb_core/src/uci/uci_hal.rs
index 1153872..151a808 100644
--- a/src/rust/uwb_core/src/uci/uci_hal.rs
+++ b/src/rust/uwb_core/src/uci/uci_hal.rs
@@ -32,7 +32,7 @@
 /// this trait and inject into the library.
 /// Note: Each method should be completed in 1000 ms.
 #[async_trait]
-pub trait UciHal: 'static + Send {
+pub trait UciHal: 'static + Send + Sync {
     /// Open the UCI HAL and power on the UWB Subsystem.
     ///
     /// All the other API should be called after the open() completes successfully. Once the method
diff --git a/src/rust/uwb_core/src/uci/uci_logger.rs b/src/rust/uwb_core/src/uci/uci_logger.rs
index 5023d7a..7045b43 100644
--- a/src/rust/uwb_core/src/uci/uci_logger.rs
+++ b/src/rust/uwb_core/src/uci/uci_logger.rs
@@ -74,10 +74,12 @@
         UciControlPacketChild::UciCommand(control_cmd) => match control_cmd.specialize() {
             UciCommandChild::SessionConfigCommand(session_cmd) => match session_cmd.specialize() {
                 SessionConfigCommandChild::SessionSetAppConfigCmd(set_config_cmd) => {
-                    let session_id = set_config_cmd.get_session_id();
+                    let session_token = set_config_cmd.get_session_token();
                     let tlvs = set_config_cmd.get_tlvs().to_owned();
                     let filtered_tlvs = tlvs.into_iter().map(filter_tlv).collect();
-                    SessionSetAppConfigCmdBuilder { session_id, tlvs: filtered_tlvs }.build().into()
+                    SessionSetAppConfigCmdBuilder { session_token, tlvs: filtered_tlvs }
+                        .build()
+                        .into()
                 }
                 _ => session_cmd.into(),
             },
@@ -214,7 +216,7 @@
     #[test]
     fn test_log_command_filter() -> Result<()> {
         let set_config_cmd = UciCommand::SessionSetAppConfig {
-            session_id: 0x1,
+            session_token: 0x1,
             config_tlvs: vec![
                 // Filtered to 0-filled of same length
                 AppConfigTlv { cfg_id: AppConfigTlvType::VendorId, v: vec![0, 1, 2] }.into(),
diff --git a/src/rust/uwb_core/src/uci/uci_manager.rs b/src/rust/uwb_core/src/uci/uci_manager.rs
index 9d05224..f2563eb 100644
--- a/src/rust/uwb_core/src/uci/uci_manager.rs
+++ b/src/rust/uwb_core/src/uci/uci_manager.rs
@@ -13,26 +13,27 @@
 // limitations under the License.
 
 use std::convert::TryInto;
+use std::sync::Arc;
 use std::time::Duration;
 
 use async_trait::async_trait;
-use log::{debug, error, warn};
-use tokio::sync::{mpsc, oneshot};
+use log::{debug, error, info, warn};
+use tokio::sync::{mpsc, oneshot, Mutex};
 
 use crate::uci::command::UciCommand;
 //use crate::uci::error::{Error, Result};
 use crate::error::{Error, Result};
 use crate::params::uci_packets::{
     AppConfigTlv, AppConfigTlvType, CapTlv, Controlees, CoreSetConfigResponse, CountryCode,
-    CreditAvailability, DeviceConfigId, DeviceConfigTlv, DeviceState, FiraComponent,
-    GetDeviceInfoResponse, GroupId, MessageType, PowerStats, RawUciMessage, ResetConfig, SessionId,
-    SessionState, SessionType, SessionUpdateDtTagRangingRoundsResponse, SetAppConfigResponse,
+    CreditAvailability, DeviceConfigId, DeviceConfigTlv, DeviceState, GetDeviceInfoResponse,
+    GroupId, MessageType, PowerStats, RawUciMessage, ResetConfig, SessionId, SessionState,
+    SessionToken, SessionType, SessionUpdateDtTagRangingRoundsResponse, SetAppConfigResponse,
     UciDataPacket, UciDataPacketHal, UpdateMulticastListAction,
 };
 use crate::params::utils::bytes_to_u64;
 use crate::uci::message::UciMessage;
 use crate::uci::notification::{
-    CoreNotification, DataRcvNotification, SessionNotification, UciNotification,
+    CoreNotification, DataRcvNotification, SessionNotification, SessionRangeData, UciNotification,
 };
 use crate::uci::response::UciResponse;
 use crate::uci::timeout_uci_hal::TimeoutUciHal;
@@ -87,6 +88,7 @@
         &self,
         config_ids: Vec<DeviceConfigId>,
     ) -> Result<Vec<DeviceConfigTlv>>;
+    async fn core_query_uwb_timestamp(&self) -> Result<u64>;
     async fn session_init(&self, session_id: SessionId, session_type: SessionType) -> Result<()>;
     async fn session_deinit(&self, session_id: SessionId) -> Result<()>;
     async fn session_set_app_config(
@@ -139,10 +141,15 @@
         &self,
         session_id: SessionId,
         address: Vec<u8>,
-        dest_end_point: FiraComponent,
-        uci_sequence_number: u8,
+        uci_sequence_number: u16,
         app_payload_data: Vec<u8>,
     ) -> Result<()>;
+
+    // Get Session token from session id
+    async fn get_session_token_from_session_id(
+        &self,
+        session_id: SessionId,
+    ) -> Result<SessionToken>;
 }
 
 /// UciManagerImpl is the main implementation of UciManager. Using the actor model, UciManagerImpl
@@ -150,6 +157,11 @@
 #[derive(Clone)]
 pub struct UciManagerImpl {
     cmd_sender: mpsc::UnboundedSender<(UciManagerCmd, oneshot::Sender<Result<UciResponse>>)>,
+
+    // FIRA version 2 introduces a UWBS generated session handle to use as identifier for all
+    // session related commands. This map stores the app provided session id to UWBS generated
+    // session handle mapping if provided, else reuses session id.
+    session_id_to_token_map: Arc<Mutex<HashMap<SessionId, SessionToken>>>,
 }
 
 impl UciManagerImpl {
@@ -160,10 +172,18 @@
         logger_mode: UciLoggerMode,
     ) -> Self {
         let (cmd_sender, cmd_receiver) = mpsc::unbounded_channel();
-        let mut actor = UciManagerActor::new(hal, logger, logger_mode, cmd_receiver);
+        let session_id_to_token_map: Arc<Mutex<HashMap<SessionId, SessionToken>>> =
+            Arc::new(Mutex::new(HashMap::new()));
+        let mut actor = UciManagerActor::new(
+            hal,
+            logger,
+            logger_mode,
+            cmd_receiver,
+            session_id_to_token_map.clone(),
+        );
         tokio::spawn(async move { actor.run().await });
 
-        Self { cmd_sender }
+        Self { cmd_sender, session_id_to_token_map }
     }
 
     // Send the |cmd| to the UciManagerActor.
@@ -177,6 +197,15 @@
             }
         }
     }
+
+    async fn get_session_token(&self, session_id: &SessionId) -> Result<SessionToken> {
+        self.session_id_to_token_map
+            .lock()
+            .await
+            .get(session_id)
+            .ok_or(Error::BadParameters)
+            .copied()
+    }
 }
 
 #[async_trait]
@@ -290,17 +319,27 @@
         }
     }
 
+    async fn core_query_uwb_timestamp(&self) -> Result<u64> {
+        let cmd = UciCommand::CoreQueryTimeStamp;
+        match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
+            Ok(UciResponse::CoreQueryTimeStamp(resp)) => resp,
+            Ok(_) => Err(Error::Unknown),
+            Err(e) => Err(e),
+        }
+    }
+
     async fn session_init(&self, session_id: SessionId, session_type: SessionType) -> Result<()> {
         let cmd = UciCommand::SessionInit { session_id, session_type };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
-            Ok(UciResponse::SessionInit(resp)) => resp,
+            Ok(UciResponse::SessionInit(resp)) => resp.map(|_| {}),
             Ok(_) => Err(Error::Unknown),
             Err(e) => Err(e),
         }
     }
 
     async fn session_deinit(&self, session_id: SessionId) -> Result<()> {
-        let cmd = UciCommand::SessionDeinit { session_id };
+        let cmd =
+            UciCommand::SessionDeinit { session_token: self.get_session_token(&session_id).await? };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionDeinit(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -313,7 +352,10 @@
         session_id: SessionId,
         config_tlvs: Vec<AppConfigTlv>,
     ) -> Result<SetAppConfigResponse> {
-        let cmd = UciCommand::SessionSetAppConfig { session_id, config_tlvs };
+        let cmd = UciCommand::SessionSetAppConfig {
+            session_token: self.get_session_token(&session_id).await?,
+            config_tlvs,
+        };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionSetAppConfig(resp)) => Ok(resp),
             Ok(_) => Err(Error::Unknown),
@@ -326,7 +368,10 @@
         session_id: SessionId,
         app_cfg: Vec<AppConfigTlvType>,
     ) -> Result<Vec<AppConfigTlv>> {
-        let cmd = UciCommand::SessionGetAppConfig { session_id, app_cfg };
+        let cmd = UciCommand::SessionGetAppConfig {
+            session_token: self.get_session_token(&session_id).await?,
+            app_cfg,
+        };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionGetAppConfig(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -344,7 +389,9 @@
     }
 
     async fn session_get_state(&self, session_id: SessionId) -> Result<SessionState> {
-        let cmd = UciCommand::SessionGetState { session_id };
+        let cmd = UciCommand::SessionGetState {
+            session_token: self.get_session_token(&session_id).await?,
+        };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionGetState(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -367,8 +414,11 @@
             warn!("Number of controlees should be between 1 to 8");
             return Err(Error::BadParameters);
         }
-        let cmd =
-            UciCommand::SessionUpdateControllerMulticastList { session_id, action, controlees };
+        let cmd = UciCommand::SessionUpdateControllerMulticastList {
+            session_token: self.get_session_token(&session_id).await?,
+            action,
+            controlees,
+        };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionUpdateControllerMulticastList(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -381,7 +431,10 @@
         session_id: u32,
         ranging_round_indexes: Vec<u8>,
     ) -> Result<SessionUpdateDtTagRangingRoundsResponse> {
-        let cmd = UciCommand::SessionUpdateDtTagRangingRounds { session_id, ranging_round_indexes };
+        let cmd = UciCommand::SessionUpdateDtTagRangingRounds {
+            session_token: self.get_session_token(&session_id).await?,
+            ranging_round_indexes,
+        };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionUpdateDtTagRangingRounds(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -390,7 +443,9 @@
     }
 
     async fn session_query_max_data_size(&self, session_id: SessionId) -> Result<u16> {
-        let cmd = UciCommand::SessionQueryMaxDataSize { session_id };
+        let cmd = UciCommand::SessionQueryMaxDataSize {
+            session_token: self.get_session_token(&session_id).await?,
+        };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionQueryMaxDataSize(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -399,7 +454,8 @@
     }
 
     async fn range_start(&self, session_id: SessionId) -> Result<()> {
-        let cmd = UciCommand::SessionStart { session_id };
+        let cmd =
+            UciCommand::SessionStart { session_token: self.get_session_token(&session_id).await? };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionStart(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -408,7 +464,8 @@
     }
 
     async fn range_stop(&self, session_id: SessionId) -> Result<()> {
-        let cmd = UciCommand::SessionStop { session_id };
+        let cmd =
+            UciCommand::SessionStop { session_token: self.get_session_token(&session_id).await? };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionStop(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -417,7 +474,9 @@
     }
 
     async fn range_get_ranging_count(&self, session_id: SessionId) -> Result<usize> {
-        let cmd = UciCommand::SessionGetRangingCount { session_id };
+        let cmd = UciCommand::SessionGetRangingCount {
+            session_token: self.get_session_token(&session_id).await?,
+        };
         match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
             Ok(UciResponse::SessionGetRangingCount(resp)) => resp,
             Ok(_) => Err(Error::Unknown),
@@ -463,20 +522,17 @@
         &self,
         session_id: SessionId,
         dest_mac_address_bytes: Vec<u8>,
-        dest_fira_component: FiraComponent,
-        uci_sequence_number: u8,
+        uci_sequence_number: u16,
         data: Vec<u8>,
     ) -> Result<()> {
         debug!(
             "send_data_packet(): will Tx a data packet, session_id {}, sequence_number {}",
             session_id, uci_sequence_number
         );
-        let dest_mac_address =
-            bytes_to_u64(dest_mac_address_bytes).ok_or(Error::BadParameters).unwrap();
+        let dest_mac_address = bytes_to_u64(dest_mac_address_bytes).ok_or(Error::BadParameters)?;
         let data_snd_packet = uwb_uci_packets::UciDataSndBuilder {
-            session_id,
+            session_token: self.get_session_token(&session_id).await?,
             dest_mac_address,
-            dest_fira_component,
             uci_sequence_number,
             data,
         }
@@ -488,6 +544,14 @@
             Err(e) => Err(e),
         }
     }
+
+    // Get session token from session id (no uci call).
+    async fn get_session_token_from_session_id(
+        &self,
+        session_id: SessionId,
+    ) -> Result<SessionToken> {
+        Ok(self.get_session_token(&session_id).await?)
+    }
 }
 
 struct UciManagerActor<T: UciHal, U: UciLogger> {
@@ -500,7 +564,7 @@
 
     // Set to true when |hal| is opened successfully.
     is_hal_opened: bool,
-    // Receive response, notification and data packets from |hal|. Only used when |hal| is opened
+    // Receive response, notification and data packets from |mut hal|. Only used when |hal| is opened
     // successfully.
     packet_receiver: mpsc::UnboundedReceiver<UciHalPacket>,
     // Defrag the UCI packets.
@@ -512,11 +576,11 @@
 
     // Store per-session CreditAvailability. This should be initialized when a UWB session becomes
     // ACTIVE, and updated every time a Data packet fragment is sent or a DataCreditNtf is received.
-    data_credit_map: HashMap<SessionId, CreditAvailability>,
+    data_credit_map: HashMap<SessionToken, CreditAvailability>,
 
     // Store the Uci Data packet fragments to be sent to the UWBS, keyed by the SessionId. This
     // helps to retrieve the next packet fragment to be sent, when the UWBS is ready to accept it.
-    data_packet_fragments_map: HashMap<SessionId, VecDeque<UciDataPacketHal>>,
+    data_packet_fragments_map: HashMap<SessionToken, VecDeque<UciDataPacketHal>>,
 
     // The timeout of waiting for the notification of device ready notification.
     wait_device_status_timeout: PinSleep,
@@ -541,6 +605,14 @@
     session_notf_sender: mpsc::UnboundedSender<SessionNotification>,
     vendor_notf_sender: mpsc::UnboundedSender<RawUciMessage>,
     data_rcv_notf_sender: mpsc::UnboundedSender<DataRcvNotification>,
+
+    // Used to store the last init session id to help map the session handle sent
+    // in session int response can be correctly mapped.
+    last_init_session_id: Option<SessionId>,
+    // FIRA version 2 introduces a UWBS generated session handle to use as identifier for all
+    // session related commands. This map stores the app provided session id to UWBS generated
+    // session handle mapping if provided, else reuses session id.
+    session_id_to_token_map: Arc<Mutex<HashMap<SessionId, SessionToken>>>,
 }
 
 impl<T: UciHal, U: UciLogger> UciManagerActor<T, U> {
@@ -552,6 +624,7 @@
             UciManagerCmd,
             oneshot::Sender<Result<UciResponse>>,
         )>,
+        session_id_to_token_map: Arc<Mutex<HashMap<SessionId, SessionToken>>>,
     ) -> Self {
         Self {
             hal: TimeoutUciHal::new(hal),
@@ -572,6 +645,8 @@
             session_notf_sender: mpsc::unbounded_channel().0,
             vendor_notf_sender: mpsc::unbounded_channel().0,
             data_rcv_notf_sender: mpsc::unbounded_channel().0,
+            last_init_session_id: None,
+            session_id_to_token_map,
         }
     }
 
@@ -600,7 +675,9 @@
 
                 // Timeout waiting for the response of the UCI command.
                 _ = &mut self.wait_resp_timeout, if self.is_waiting_resp() => {
-                    self.uci_cmd_retryer.take().unwrap().send_result(Err(Error::Timeout));
+                    if let Some(uci_cmd_retryer) = self.uci_cmd_retryer.take() {
+                        uci_cmd_retryer.send_result(Err(Error::Timeout));
+                    }
                 }
 
                 // Timeout waiting for the notification of the device status.
@@ -619,6 +696,60 @@
         }
     }
 
+    async fn insert_session_token(&self, session_id: SessionId, session_token: SessionToken) {
+        self.session_id_to_token_map.lock().await.insert(session_id, session_token);
+    }
+
+    async fn remove_session_token(&self, session_token: &SessionToken) {
+        self.session_id_to_token_map.lock().await.retain(|_, val| *val != *session_token);
+    }
+
+    async fn get_session_id(&self, session_token: &SessionToken) -> Result<SessionId> {
+        self.session_id_to_token_map
+            .lock()
+            .await
+            .iter()
+            .find_map(|(key, &val)| if val == *session_token { Some(key) } else { None })
+            .ok_or(Error::BadParameters)
+            .copied()
+    }
+
+    fn save_session_id_if_init_cmd(&mut self, cmd: &UciCommand) {
+        // Store the last init session id to help map the session handle sent
+        // in session init response.
+        if let UciCommand::SessionInit { session_id, .. } = cmd {
+            self.last_init_session_id = Some(*session_id);
+        }
+    }
+
+    async fn store_session_token_if_init_resp(&mut self, resp: &UciResponse) -> Result<()> {
+        // Store the session_id to session_token mapping for this new session.
+        if let UciResponse::SessionInit(session_init_resp) = resp {
+            let session_id = match self.last_init_session_id.take() {
+                Some(session_id) => session_id,
+                None => {
+                    return Err(Error::Unknown);
+                }
+            };
+            if let Ok(opt_session_handle) = session_init_resp {
+                let session_handle = match opt_session_handle {
+                    // Session Handle provided by UWBS, use as token for further commands.
+                    Some(session_handle) => {
+                        info!(
+                            "session handle: {:?} provided for session id: {:?}",
+                            session_handle, session_id
+                        );
+                        *session_handle
+                    }
+                    // Session Handle not provided by UWBS, reuse session id as token for further commands.
+                    None => session_id,
+                };
+                self.insert_session_token(session_id, session_handle).await;
+            }
+        }
+        Ok(())
+    }
+
     async fn handle_cmd(
         &mut self,
         cmd: UciManagerCmd,
@@ -697,6 +828,8 @@
             UciManagerCmd::SendUciCommand { cmd } => {
                 debug_assert!(self.uci_cmd_retryer.is_none());
 
+                self.save_session_id_if_init_cmd(&cmd);
+
                 // Remember that this command is a raw UCI command, we'll use this later
                 // to send a raw UCI response.
                 if let UciCommand::RawUciCmd { mt: _, gid, oid, payload: _ } = cmd.clone() {
@@ -715,14 +848,19 @@
                     }
                     self.last_raw_cmd = Some(RawUciControlPacket {
                         mt: u8::from(MessageType::Command),
-                        gid: gid_u8.unwrap(),
-                        oid: oid_u8.unwrap(),
-                        payload: Vec::new(), // There's no need to store the Raw UCI CMD's payload.
+                        gid: gid_u8.unwrap(), // Safe as we check gid_u8.is_err() above.
+                        oid: oid_u8.unwrap(), // Safe as we check uid_i8.is_err() above.
+                        payload: Vec::new(),  // There's no need to store the Raw UCI CMD's payload.
                     });
                 }
 
                 self.uci_cmd_retryer =
                     Some(UciCmdRetryer { cmd, result_sender, retry_count: MAX_RETRY_COUNT });
+
+                // Reset DataSndRetryer so if a CORE_GENERIC_ERROR_NTF with STATUS_UCI_PACKET_RETRY
+                // is received, only this UCI CMD packet will be retried.
+                let _ = self.uci_data_snd_retryer.take();
+
                 self.retry_uci_cmd().await;
             }
 
@@ -756,11 +894,11 @@
 
     async fn retry_uci_data_snd(&mut self) {
         if let Some(mut uci_data_snd_retryer) = self.uci_data_snd_retryer.take() {
-            let data_packet_session_id = uci_data_snd_retryer.data_packet_session_id;
+            let data_packet_session_token = uci_data_snd_retryer.data_packet_session_token;
             if !uci_data_snd_retryer.could_retry() {
                 error!(
                     "Out of retries for Uci DataSnd packet, last DataSnd packet session_id:{}",
-                    data_packet_session_id
+                    data_packet_session_token
                 );
                 return;
             }
@@ -772,7 +910,7 @@
                 Err(e) => {
                     error!(
                         "DataSnd packet fragment session_id:{} retry failed with error:{}",
-                        data_packet_session_id, e
+                        data_packet_session_token, e
                     );
                 }
             }
@@ -793,14 +931,14 @@
 
     async fn handle_data_snd_packet(&mut self, data_snd_packet: UciDataSnd) -> Result<UciResponse> {
         // Verify that there's an entry for the Session in the CreditAvailability map.
-        let data_packet_session_id = data_snd_packet.get_session_id();
+        let data_packet_session_token = data_snd_packet.get_session_token();
         let data_packet_sequence_number = data_snd_packet.get_uci_sequence_number();
 
-        if !self.data_credit_map.contains_key(&data_packet_session_id) {
+        if !self.data_credit_map.contains_key(&data_packet_session_token) {
             error!(
-                "DataSnd packet session_id:{}, sequence_number:{} cannot be sent as unknown \
+                "DataSnd packet session_token:{}, sequence_number:{} cannot be sent as unknown \
                 credit availability for the session",
-                data_packet_session_id, data_packet_sequence_number
+                data_packet_session_token, data_packet_sequence_number
             );
             return Err(Error::PacketTxError);
         }
@@ -809,13 +947,13 @@
         let mut packet_fragments: Vec<UciDataPacketHal> = data_snd_packet.into();
         if packet_fragments.is_empty() {
             error!(
-                "DataSnd packet session_id:{}, sequence number:{} could not be split into fragments",
-                data_packet_session_id, data_packet_sequence_number
+                "DataSnd packet session_token:{}, sequence number:{} could not be split into fragments",
+                data_packet_session_token, data_packet_sequence_number
             );
             return Err(Error::PacketTxError);
         }
 
-        match self.data_packet_fragments_map.get_mut(&data_packet_session_id) {
+        match self.data_packet_fragments_map.get_mut(&data_packet_session_token) {
             Some(q) => {
                 for p in packet_fragments.drain(..) {
                     q.push_back(p);
@@ -823,29 +961,29 @@
             }
             None => {
                 error!(
-                    "DataSnd packet fragments map not found for session_id:{}",
-                    data_packet_session_id
+                    "DataSnd packet fragments map not found for session_token:{}",
+                    data_packet_session_token
                 );
                 return Err(Error::PacketTxError);
             }
         }
 
-        self.send_data_packet_fragment(data_packet_session_id).await
+        self.send_data_packet_fragment(data_packet_session_token).await
     }
 
     async fn send_data_packet_fragment(
         &mut self,
-        data_packet_session_id: SessionId,
+        data_packet_session_token: SessionToken,
     ) -> Result<UciResponse> {
         // Check if a credit is available before sending this data packet fragment. If not, return
         // for now, and send this packet later when the credit becomes available (indicated by
         // receiving a DataCreditNtf).
-        let credit = self.data_credit_map.get(&data_packet_session_id);
+        let credit = self.data_credit_map.get(&data_packet_session_token);
         if credit.is_none() {
             error!(
-                "DataSnd packet fragment cannot be sent for session_id:{} as unknown \
+                "DataSnd packet fragment cannot be sent for session_token:{} as unknown \
                 credit availability for the session",
-                data_packet_session_id
+                data_packet_session_token
             );
             return Err(Error::PacketTxError);
         }
@@ -855,7 +993,7 @@
 
         // We have credit available, let's send the packet to UWBS.
         let hal_data_packet_fragment =
-            match self.data_packet_fragments_map.get_mut(&data_packet_session_id) {
+            match self.data_packet_fragments_map.get_mut(&data_packet_session_token) {
                 Some(q) => {
                     match q.pop_front() {
                         Some(p) => p,
@@ -873,21 +1011,22 @@
         // Create and save a retryer for sending this data packet fragment.
         self.uci_data_snd_retryer = Some(UciDataSndRetryer {
             data_packet: hal_data_packet_fragment.clone(),
-            data_packet_session_id,
+            data_packet_session_token,
             retry_count: MAX_RETRY_COUNT,
         });
 
         let result = self.hal.send_packet(hal_data_packet_fragment.to_vec()).await;
         if result.is_err() {
             error!(
-                "Result {:?} of sending data packet fragment SessionId: {} to HAL",
-                result, data_packet_session_id
+                "Result {:?} of sending data packet fragment SessionToken: {} to HAL",
+                result, data_packet_session_token
             );
             return Err(Error::PacketTxError);
         }
 
         // Update the map after the successful write.
-        self.data_credit_map.insert(data_packet_session_id, CreditAvailability::CreditNotAvailable);
+        self.data_credit_map
+            .insert(data_packet_session_token, CreditAvailability::CreditNotAvailable);
         Ok(UciResponse::SendUciData(Ok(())))
     }
 
@@ -954,6 +1093,10 @@
             self.retry_uci_cmd().await;
             return;
         }
+        if let Err(_e) = self.store_session_token_if_init_resp(&resp).await {
+            error!("Session init response received without a sesson id stored! Something has gone badly wrong: {:?}", resp);
+            return;
+        }
 
         if let Some(uci_cmd_retryer) = self.uci_cmd_retryer.take() {
             uci_cmd_retryer.send_result(Ok(resp));
@@ -986,51 +1129,63 @@
                 }
                 let _ = self.core_notf_sender.send(core_notf);
             }
-            UciNotification::Session(session_notf) => {
-                if let SessionNotification::Status { session_id, session_state, reason_code: _ } =
-                    session_notf
-                {
-                    self.handle_session_state_notification(session_id, session_state).await;
-                }
-                if let SessionNotification::DataCredit { session_id, credit_availability } =
-                    session_notf
-                {
-                    if !self.data_credit_map.contains_key(&session_id) {
-                        // Currently just log, as this is unexpected (the entry should exist once
-                        // the ranging session is Active and be removed once it is Idle).
-                        debug!(
-                            "Received a DataCreditNtf for non-existent session_id: {}",
-                            session_id
-                        );
+            UciNotification::Session(orig_session_notf) => {
+                let mod_session_notf = {
+                    match self
+                        .replace_session_token_with_session_id(orig_session_notf.clone())
+                        .await
+                    {
+                        Ok(session_notf) => session_notf,
+                        Err(e) => {
+                            error!("Failed to find corresponding session id, discarding session notification {:?}: {:?}", orig_session_notf, e);
+                            return;
+                        }
                     }
-                    self.data_credit_map.insert(session_id, credit_availability);
-                    if credit_availability == CreditAvailability::CreditAvailable {
-                        if let Err(e) = self.send_data_packet_fragment(session_id).await {
-                            error!(
-                                "Sending data packet fragment failed with Err:{}, after a\
-                                   DataCreditNtf is received, for sessionId:{}",
-                                e, session_id
+                };
+                match orig_session_notf {
+                    SessionNotification::Status {
+                        session_token,
+                        session_state,
+                        reason_code: _,
+                    } => self.handle_session_state_notification(session_token, session_state).await,
+                    SessionNotification::DataCredit { session_token, credit_availability } => {
+                        if !self.data_credit_map.contains_key(&session_token) {
+                            // Currently just log, as this is unexpected (the entry should exist once
+                            // the ranging session is Active and be removed once it is Idle).
+                            debug!(
+                                "Received a DataCreditNtf for non-existent session_token: {}",
+                                session_token
                             );
                         }
-                    } else {
-                        // Log as this should usually not happen (it's not an error).
-                        debug!(
-                            "Received a DataCreditNtf with no credit available for session_id:{}",
-                            session_id
+                        self.data_credit_map.insert(session_token, credit_availability);
+                        if credit_availability == CreditAvailability::CreditAvailable {
+                            if let Err(e) = self.send_data_packet_fragment(session_token).await {
+                                error!(
+                                    "Sending data packet fragment failed with Err:{}, after a\
+                                   DataCreditNtf is received, for session_token:{}",
+                                    e, session_token
+                                );
+                            }
+                        } else {
+                            // Log as this should usually not happen (it's not an error).
+                            debug!(
+                            "Received a DataCreditNtf with no credit available for session_token:{}",
+                            session_token
                         );
+                        }
+                        return; // We consume these here and don't need to send to upper layer.
                     }
-                    return; // We consume these here and don't need to send to upper layer.
+                    SessionNotification::DataTransferStatus {
+                        session_token: _,
+                        uci_sequence_number: _,
+                        status: _,
+                    } => {
+                        // Reset the UciDataSnd Retryer since we received a DataTransferStatusNtf.
+                        let _ = self.uci_data_snd_retryer.take();
+                    }
+                    _ => {}
                 }
-                if let SessionNotification::DataTransferStatus {
-                    session_id: _,
-                    uci_sequence_number: _,
-                    status: _,
-                } = session_notf
-                {
-                    // Reset the UciDataSnd Retryer since we received a DataTransferStatusNtf.
-                    let _ = self.uci_data_snd_retryer.take();
-                }
-                let _ = self.session_notf_sender.send(session_notf);
+                let _ = self.session_notf_sender.send(mod_session_notf);
             }
             UciNotification::Vendor(vendor_notf) => {
                 let _ = self.vendor_notf_sender.send(vendor_notf);
@@ -1038,26 +1193,82 @@
         }
     }
 
+    // Modify session_token field in all session related notifications with session id.
+    // TODO: Sharing of structs across UCI (PDL) & JNI layer like this makes this ugly. Ideally
+    // the struct sent to JNI layer should only contain |session_id| and at uci layer
+    // it could be |session_id| or |session_handle|.
+    async fn replace_session_token_with_session_id(
+        &self,
+        session_notification: SessionNotification,
+    ) -> Result<SessionNotification> {
+        match session_notification {
+            SessionNotification::Status { session_token, session_state, reason_code } => {
+                Ok(SessionNotification::Status {
+                    session_token: self.get_session_id(&session_token).await?,
+                    session_state,
+                    reason_code,
+                })
+            }
+            SessionNotification::UpdateControllerMulticastList {
+                session_token,
+                remaining_multicast_list_size,
+                status_list,
+            } => Ok(SessionNotification::UpdateControllerMulticastList {
+                session_token: self.get_session_id(&session_token).await?,
+                remaining_multicast_list_size,
+                status_list,
+            }),
+            SessionNotification::SessionInfo(session_range_data) => {
+                Ok(SessionNotification::SessionInfo(SessionRangeData {
+                    sequence_number: session_range_data.sequence_number,
+                    session_token: self.get_session_id(&session_range_data.session_token).await?,
+                    current_ranging_interval_ms: session_range_data.current_ranging_interval_ms,
+                    ranging_measurement_type: session_range_data.ranging_measurement_type,
+                    ranging_measurements: session_range_data.ranging_measurements,
+                    rcr_indicator: session_range_data.rcr_indicator,
+                    raw_ranging_data: session_range_data.raw_ranging_data,
+                }))
+            }
+            SessionNotification::DataTransferStatus {
+                session_token,
+                uci_sequence_number,
+                status,
+            } => Ok(SessionNotification::DataTransferStatus {
+                session_token: self.get_session_id(&session_token).await?,
+                uci_sequence_number,
+                status,
+            }),
+            SessionNotification::DataCredit { session_token, credit_availability } => {
+                Ok(SessionNotification::DataCredit {
+                    session_token: self.get_session_id(&session_token).await?,
+                    credit_availability,
+                })
+            }
+        }
+    }
+
     async fn handle_session_state_notification(
         &mut self,
-        session_id: SessionId,
+        session_token: SessionToken,
         session_state: SessionState,
     ) {
         match session_state {
             SessionState::SessionStateInit => {
-                if let Err(e) = self.hal.notify_session_initialized(session_id).await {
+                if let Err(e) = self.hal.notify_session_initialized(session_token).await {
                     warn!("notify_session_initialized() failed: {:?}", e);
                 }
             }
             SessionState::SessionStateActive => {
-                self.data_credit_map.insert(session_id, CreditAvailability::CreditAvailable);
-                self.data_packet_fragments_map.insert(session_id, VecDeque::new());
+                self.data_credit_map.insert(session_token, CreditAvailability::CreditAvailable);
+                self.data_packet_fragments_map.insert(session_token, VecDeque::new());
             }
             SessionState::SessionStateIdle => {
-                self.data_credit_map.remove(&session_id);
-                self.data_packet_fragments_map.remove(&session_id);
+                self.data_credit_map.remove(&session_token);
+                self.data_packet_fragments_map.remove(&session_token);
             }
-            _ => {}
+            SessionState::SessionStateDeinit => {
+                self.remove_session_token(&session_token).await;
+            }
         }
     }
 
@@ -1126,7 +1337,7 @@
     // sessions, as there can be outstanding DataSnd packet fragments across them. We could do an
     // alternative implementation of sending all of them.
     data_packet: UciDataPacketHal,
-    data_packet_session_id: u32,
+    data_packet_session_token: SessionToken,
     retry_count: usize,
 }
 
@@ -1169,17 +1380,19 @@
     },
 }
 
-#[cfg(test)]
+#[cfg(any(test))]
 mod tests {
     use super::*;
 
     use bytes::Bytes;
+    use tokio::macros::support::Future;
     use uwb_uci_packets::{SessionGetCountCmdBuilder, SessionGetCountRspBuilder};
 
     use crate::params::uci_packets::{
-        AppConfigStatus, AppConfigTlvType, CapTlvType, Controlee, DataTransferNtfStatusCode,
-        StatusCode,
+        AppConfigStatus, AppConfigTlvType, CapTlvType, Controlee, DataRcvStatusCode,
+        DataTransferNtfStatusCode, StatusCode,
     };
+    use crate::params::UwbAddress;
     use crate::uci::mock_uci_hal::MockUciHal;
     use crate::uci::mock_uci_logger::{MockUciLogger, UciLogEvent};
     use crate::uci::uci_logger::NopUciLogger;
@@ -1210,24 +1423,14 @@
         bytes
     }
 
-    async fn setup_uci_manager_with_open_hal<F>(
-        setup_hal_fn: F,
-        uci_logger_mode: UciLoggerMode,
-        log_sender: mpsc::UnboundedSender<UciLogEvent>,
-    ) -> (UciManagerImpl, MockUciHal)
-    where
-        F: FnOnce(&mut MockUciHal),
-    {
-        init_test_logging();
-
-        // Open the hal.
-        let mut hal = MockUciHal::new();
+    fn setup_hal_for_open(hal: &mut MockUciHal) {
+        // Setup Open the hal.
         let notf = into_uci_hal_packets(uwb_uci_packets::DeviceStatusNtfBuilder {
             device_state: uwb_uci_packets::DeviceState::DeviceStateReady,
         });
         hal.expected_open(Some(notf), Ok(()));
 
-        // Get the device info.
+        // Setup Get the device info.
         let cmd = UciCommand::CoreGetDeviceInfo;
         let resp = into_uci_hal_packets(uwb_uci_packets::GetDeviceInfoRspBuilder {
             status: uwb_uci_packets::StatusCode::UciStatusOk,
@@ -1238,14 +1441,31 @@
             vendor_spec_info: vec![0x1, 0x2],
         });
         hal.expected_send_command(cmd, resp, Ok(()));
+    }
 
-        setup_hal_fn(&mut hal);
+    async fn setup_uci_manager_with_open_hal<F, Fut>(
+        setup_hal_fn: F,
+        uci_logger_mode: UciLoggerMode,
+        log_sender: mpsc::UnboundedSender<UciLogEvent>,
+    ) -> (UciManagerImpl, MockUciHal)
+    where
+        F: FnOnce(MockUciHal) -> Fut,
+        Fut: Future<Output = ()>,
+    {
+        init_test_logging();
+
+        let mut hal = MockUciHal::new();
+        // Open the hal.
+        setup_hal_for_open(&mut hal);
 
         // Verify open_hal() is working.
         let uci_manager =
             UciManagerImpl::new(hal.clone(), MockUciLogger::new(log_sender), uci_logger_mode);
         let result = uci_manager.open_hal().await;
         assert!(result.is_ok());
+        assert!(hal.wait_expected_calls_done().await);
+
+        setup_hal_fn(hal.clone()).await;
 
         (uci_manager, hal)
     }
@@ -1267,7 +1487,7 @@
     #[tokio::test]
     async fn test_close_hal_explicitly() {
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            |hal| {
+            |mut hal| async move {
                 hal.expected_close(Ok(()));
             },
             UciLoggerMode::Disabled,
@@ -1283,7 +1503,7 @@
     #[tokio::test]
     async fn test_close_hal_when_exit() {
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            |hal| {
+            |mut hal| async move {
                 // UciManager should close the hal if the hal is still opened when exit.
                 hal.expected_close(Ok(()));
             },
@@ -1312,12 +1532,11 @@
     #[tokio::test]
     async fn test_device_reset_ok() {
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::DeviceReset { reset_config: ResetConfig::UwbsReset };
                 let resp = into_uci_hal_packets(uwb_uci_packets::DeviceResetRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
                 });
-
                 hal.expected_send_command(cmd, resp, Ok(()));
             },
             UciLoggerMode::Disabled,
@@ -1341,7 +1560,7 @@
         let vendor_spec_info_clone = vendor_spec_info.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::CoreGetDeviceInfo;
                 let resp = into_uci_hal_packets(uwb_uci_packets::GetDeviceInfoRspBuilder {
                     status,
@@ -1377,7 +1596,7 @@
         let tlv_clone = tlv.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::CoreGetCapsInfo;
                 let resp = into_uci_hal_packets(uwb_uci_packets::GetCapsInfoRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
@@ -1408,7 +1627,7 @@
         let config_status_clone = config_status.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::CoreSetConfig { config_tlvs: vec![tlv_clone] };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SetConfigRspBuilder {
                     status,
@@ -1435,7 +1654,7 @@
         let tlv_clone = tlv.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::CoreGetConfig { cfg_id: vec![cfg_id] };
                 let resp = into_uci_hal_packets(uwb_uci_packets::GetConfigRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
@@ -1455,47 +1674,111 @@
         assert!(mock_hal.wait_expected_calls_done().await);
     }
 
+    fn setup_hal_for_session_initialize(
+        hal: &mut MockUciHal,
+        session_type: SessionType,
+        session_id: u32,
+        session_token: u32,
+    ) {
+        // Setup for hal open.
+        setup_hal_for_open(hal);
+
+        // Setup session init.
+        let cmd = UciCommand::SessionInit { session_id, session_type };
+        let mut resp = if session_id == session_token {
+            into_uci_hal_packets(uwb_uci_packets::SessionInitRspBuilder {
+                status: uwb_uci_packets::StatusCode::UciStatusOk,
+            })
+        } else {
+            // This is testing FIRA v2 flow where a session handle is provided by UWBS.
+            into_uci_hal_packets(uwb_uci_packets::SessionInitRsp_V2Builder {
+                status: uwb_uci_packets::StatusCode::UciStatusOk,
+                session_handle: session_token,
+            })
+        };
+        let mut notf = into_uci_hal_packets(uwb_uci_packets::SessionStatusNtfBuilder {
+            session_token,
+            session_state: uwb_uci_packets::SessionState::SessionStateInit,
+            reason_code: uwb_uci_packets::ReasonCode::StateChangeWithSessionManagementCommands
+                .into(),
+        });
+        resp.append(&mut notf);
+        hal.expected_send_command(cmd, resp, Ok(()));
+        hal.expected_notify_session_initialized(session_token, Ok(()));
+    }
+
+    async fn setup_uci_manager_with_session_initialized<F, Fut>(
+        setup_hal_fn: F,
+        uci_logger_mode: UciLoggerMode,
+        log_sender: mpsc::UnboundedSender<UciLogEvent>,
+        session_id: u32,
+        session_token: u32,
+    ) -> (UciManagerImpl, MockUciHal)
+    where
+        F: FnOnce(MockUciHal) -> Fut,
+        Fut: Future<Output = ()>,
+    {
+        let session_type = SessionType::FiraRangingSession;
+
+        init_test_logging();
+
+        let mut hal = MockUciHal::new();
+        setup_hal_for_session_initialize(&mut hal, session_type, session_id, session_token);
+
+        // Verify open_hal() is working.
+        let uci_manager =
+            UciManagerImpl::new(hal.clone(), MockUciLogger::new(log_sender), uci_logger_mode);
+        let result = uci_manager.open_hal().await;
+        assert!(result.is_ok());
+
+        // Verify session is initialized.
+        let result = uci_manager.session_init(session_id, session_type).await;
+        assert!(result.is_ok());
+        assert!(hal.wait_expected_calls_done().await);
+
+        setup_hal_fn(hal.clone()).await;
+
+        (uci_manager, hal)
+    }
+
     #[tokio::test]
     async fn test_session_init_ok() {
         let session_id = 0x123;
-        let session_type = SessionType::FiraRangingSession;
+        let session_token = 0x123;
+        let (_, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |_hal| async move {},
+            UciLoggerMode::Disabled,
+            mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
+        )
+        .await;
+        assert!(mock_hal.wait_expected_calls_done().await);
+    }
 
-        let (uci_manager, mut mock_hal) =
-            setup_uci_manager_with_open_hal(
-                move |hal| {
-                    let cmd = UciCommand::SessionInit { session_id, session_type };
-                    let mut resp = into_uci_hal_packets(uwb_uci_packets::SessionInitRspBuilder {
-                        status: uwb_uci_packets::StatusCode::UciStatusOk,
-                    });
-                    let mut notf = into_uci_hal_packets(uwb_uci_packets::SessionStatusNtfBuilder {
-                        session_id,
-                        session_state: uwb_uci_packets::SessionState::SessionStateInit,
-                        reason_code:
-                            uwb_uci_packets::ReasonCode::StateChangeWithSessionManagementCommands
-                                .into(),
-                    });
-                    resp.append(&mut notf);
-
-                    hal.expected_send_command(cmd, resp, Ok(()));
-                    hal.expected_notify_session_initialized(session_id, Ok(()));
-                },
-                UciLoggerMode::Disabled,
-                mpsc::unbounded_channel::<UciLogEvent>().0,
-            )
-            .await;
-
-        let result = uci_manager.session_init(session_id, session_type).await;
-        assert!(result.is_ok());
+    #[tokio::test]
+    async fn test_session_init_v2_ok() {
+        let session_id = 0x123;
+        let session_token = 0x321; // different session handle
+        let (_, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |_hal| async move {},
+            UciLoggerMode::Disabled,
+            mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
+        )
+        .await;
         assert!(mock_hal.wait_expected_calls_done().await);
     }
 
     #[tokio::test]
     async fn test_session_deinit_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                let cmd = UciCommand::SessionDeinit { session_id };
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd = UciCommand::SessionDeinit { session_token };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionDeinitRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
                 });
@@ -1504,6 +1787,34 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
+        )
+        .await;
+
+        let result = uci_manager.session_deinit(session_id).await;
+        assert!(result.is_ok());
+        assert!(mock_hal.wait_expected_calls_done().await);
+    }
+
+    #[tokio::test]
+    async fn test_session_deinit_v2_ok() {
+        let session_id = 0x123;
+        let session_token = 0x321; // different session handle
+
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd = UciCommand::SessionDeinit { session_token };
+                let resp = into_uci_hal_packets(uwb_uci_packets::SessionDeinitRspBuilder {
+                    status: uwb_uci_packets::StatusCode::UciStatusOk,
+                });
+
+                hal.expected_send_command(cmd, resp, Ok(()));
+            },
+            UciLoggerMode::Disabled,
+            mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1515,13 +1826,14 @@
     #[tokio::test]
     async fn test_session_set_app_config_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
         let config_tlv = AppConfigTlv::new(AppConfigTlvType::DeviceType, vec![0x12, 0x34, 0x56]);
         let config_tlv_clone = config_tlv.clone();
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            |hal| {
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
                 let cmd = UciCommand::SessionSetAppConfig {
-                    session_id,
+                    session_token,
                     config_tlvs: vec![config_tlv_clone],
                 };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionSetAppConfigRspBuilder {
@@ -1533,6 +1845,43 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
+        )
+        .await;
+
+        let expected_result =
+            SetAppConfigResponse { status: StatusCode::UciStatusOk, config_status: vec![] };
+        let result =
+            uci_manager.session_set_app_config(session_id, vec![config_tlv]).await.unwrap();
+        assert_eq!(result, expected_result);
+        assert!(mock_hal.wait_expected_calls_done().await);
+    }
+
+    #[tokio::test]
+    async fn test_session_set_app_config_v2_ok() {
+        let session_id = 0x123;
+        let session_token = 0x321;
+        let config_tlv = AppConfigTlv::new(AppConfigTlvType::DeviceType, vec![0x12, 0x34, 0x56]);
+        let config_tlv_clone = config_tlv.clone();
+
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd = UciCommand::SessionSetAppConfig {
+                    session_token,
+                    config_tlvs: vec![config_tlv_clone],
+                };
+                let resp = into_uci_hal_packets(uwb_uci_packets::SessionSetAppConfigRspBuilder {
+                    status: uwb_uci_packets::StatusCode::UciStatusOk,
+                    cfg_status: vec![],
+                });
+
+                hal.expected_send_command(cmd, resp, Ok(()));
+            },
+            UciLoggerMode::Disabled,
+            mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1547,13 +1896,15 @@
     #[tokio::test]
     async fn test_session_get_app_config_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
         let config_id = AppConfigTlvType::DeviceType;
         let tlv = AppConfigTlv::new(AppConfigTlvType::DeviceType, vec![0x12, 0x34, 0x56]);
         let tlv_clone = tlv.clone();
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                let cmd = UciCommand::SessionGetAppConfig { session_id, app_cfg: vec![config_id] };
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd =
+                    UciCommand::SessionGetAppConfig { session_token, app_cfg: vec![config_id] };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionGetAppConfigRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
                     tlvs: vec![tlv_clone.into_inner()],
@@ -1563,6 +1914,8 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1577,7 +1930,7 @@
         let session_count = 5;
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::SessionGetCount;
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionGetCountRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
@@ -1599,11 +1952,12 @@
     #[tokio::test]
     async fn test_session_get_state_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
         let session_state = SessionState::SessionStateActive;
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                let cmd = UciCommand::SessionGetState { session_id };
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd = UciCommand::SessionGetState { session_token };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionGetStateRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
                     session_state,
@@ -1613,6 +1967,8 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1624,14 +1980,16 @@
     #[tokio::test]
     async fn test_session_update_controller_multicast_list_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
         let action = UpdateMulticastListAction::AddControlee;
-        let controlee = Controlee { short_address: 0x4567, subsession_id: 0x90ab };
+        let short_address: [u8; 2] = [0x45, 0x67];
+        let controlee = Controlee { short_address, subsession_id: 0x90ab };
         let controlee_clone = controlee.clone();
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
                 let cmd = UciCommand::SessionUpdateControllerMulticastList {
-                    session_id,
+                    session_token,
                     action,
                     controlees: Controlees::NoSessionKey(vec![controlee_clone]),
                 };
@@ -1645,6 +2003,8 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1661,15 +2021,18 @@
 
     #[tokio::test]
     async fn test_set_active_dt_tag_ranging_rounds() {
+        let session_id = 0x123;
+        let session_token = 0x123;
+
         let ranging_rounds = SessionUpdateDtTagRangingRoundsResponse {
             status: StatusCode::UciStatusErrorRoundIndexNotActivated,
             ranging_round_indexes: vec![3],
         };
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
                 let cmd = UciCommand::SessionUpdateDtTagRangingRounds {
-                    session_id: 1,
+                    session_token,
                     ranging_round_indexes: vec![3, 5],
                 };
                 let resp = into_uci_hal_packets(
@@ -1683,10 +2046,13 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
-        let result = uci_manager.session_update_dt_tag_ranging_rounds(1, vec![3, 5]).await.unwrap();
+        let result =
+            uci_manager.session_update_dt_tag_ranging_rounds(session_id, vec![3, 5]).await.unwrap();
 
         assert_eq!(result, ranging_rounds);
         assert!(mock_hal.wait_expected_calls_done().await);
@@ -1695,10 +2061,11 @@
     #[tokio::test]
     async fn test_range_start_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                let cmd = UciCommand::SessionStart { session_id };
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd = UciCommand::SessionStart { session_token };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionStartRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
                 });
@@ -1707,6 +2074,8 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1718,10 +2087,11 @@
     #[tokio::test]
     async fn test_range_stop_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                let cmd = UciCommand::SessionStop { session_id };
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd = UciCommand::SessionStop { session_token };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionStopRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
                 });
@@ -1730,6 +2100,8 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1741,11 +2113,12 @@
     #[tokio::test]
     async fn test_range_get_ranging_count_ok() {
         let session_id = 0x123;
+        let session_token = 0x123;
         let count = 3;
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                let cmd = UciCommand::SessionGetRangingCount { session_id };
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_initialized(
+            |mut hal| async move {
+                let cmd = UciCommand::SessionGetRangingCount { session_token };
                 let resp =
                     into_uci_hal_packets(uwb_uci_packets::SessionGetRangingCountRspBuilder {
                         status: uwb_uci_packets::StatusCode::UciStatusOk,
@@ -1756,6 +2129,8 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
@@ -1770,7 +2145,7 @@
         let country_code_clone = country_code.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::AndroidSetCountryCode { country_code: country_code_clone };
                 let resp = into_uci_hal_packets(uwb_uci_packets::AndroidSetCountryCodeRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
@@ -1800,7 +2175,7 @@
         let power_stats_clone = power_stats.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::AndroidGetPowerStats;
                 let resp = into_uci_hal_packets(uwb_uci_packets::AndroidGetPowerStatsRspBuilder {
                     stats: power_stats_clone,
@@ -1829,7 +2204,7 @@
         let resp_payload_clone = resp_payload.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd { mt, gid, oid, payload: cmd_payload_clone };
                 let resp = into_uci_hal_packets(uwb_uci_packets::UciVendor_F_ResponseBuilder {
                     opcode: oid as u8,
@@ -1863,7 +2238,7 @@
         let cfg_status = vec![app_config];
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd { mt, gid, oid, payload: cmd_payload_clone };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionSetAppConfigRspBuilder {
                     status,
@@ -1897,7 +2272,7 @@
         let cfg_status = vec![app_config];
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd { mt, gid, oid, payload: cmd_payload_clone };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionSetAppConfigRspBuilder {
                     status,
@@ -1932,7 +2307,7 @@
         let resp_payload_clone = resp_payload.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd {
                     mt: cmd_mt.into(),
                     gid: gid.into(),
@@ -1971,7 +2346,7 @@
         resp_payload_expected.extend(resp_payload_fragment_2.clone().into_iter());
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd {
                     mt: cmd_mt.into(),
                     gid: gid.into(),
@@ -2024,7 +2399,7 @@
         let cfg_status = vec![app_config];
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd { mt, gid, oid, payload: cmd_payload_clone };
                 let resp = into_uci_hal_packets(uwb_uci_packets::SessionSetAppConfigRspBuilder {
                     status,
@@ -2054,7 +2429,7 @@
         let cmd_payload = vec![0x11, 0x22, 0x33, 0x44];
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |_hal| {},
+            move |_hal| async {},
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
         )
@@ -2077,7 +2452,7 @@
         let cmd_payload = vec![0x11, 0x22, 0x33, 0x44];
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |_hal| {},
+            |_hal| async move {},
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
         )
@@ -2098,13 +2473,13 @@
         let oid: u8 = 0x3; // SESSION_SET_APP_CONFIG
         let cmd_payload = vec![0x11, 0x22, 0x33, 0x44];
         let cmd_payload_clone = cmd_payload.clone();
-        let session_id = 0x123;
+        let session_token = 0x123;
         let resp_mt: u8 = 0x2;
         let resp_payload = vec![0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08];
         let resp_payload_clone = resp_payload.clone();
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd {
                     mt: cmd_mt.into(),
                     gid: gid.into(),
@@ -2114,7 +2489,7 @@
                 let raw_resp = build_uci_packet(resp_mt, 0, gid, oid, resp_payload_clone);
                 let mut responses =
                     into_uci_hal_packets(uwb_uci_packets::SessionStatusNtfBuilder {
-                        session_id,
+                        session_token,
                         session_state: uwb_uci_packets::SessionState::SessionStateInit,
                         reason_code:
                             uwb_uci_packets::ReasonCode::StateChangeWithSessionManagementCommands
@@ -2149,7 +2524,7 @@
         let resp_payload = vec![0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08];
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::RawUciCmd {
                     mt: cmd_mt.into(),
                     gid: gid.into(),
@@ -2171,27 +2546,199 @@
         assert!(mock_hal.wait_expected_calls_done().await);
     }
 
-    fn setup_active_session(hal: &mut MockUciHal, session_id: u32) {
-        // First setup the Session to be in Active state.
-        let cmd = UciCommand::SessionStart { session_id };
+    fn setup_hal_for_session_active(
+        hal: &mut MockUciHal,
+        session_type: SessionType,
+        session_id: u32,
+        session_token: u32,
+    ) {
+        // Setup session init.
+        setup_hal_for_session_initialize(hal, session_type, session_id, session_token);
+
+        // Setup session active.
+        let cmd = UciCommand::SessionStart { session_token };
         let mut responses = into_uci_hal_packets(uwb_uci_packets::SessionStartRspBuilder {
             status: uwb_uci_packets::StatusCode::UciStatusOk,
         });
         responses.append(&mut into_uci_hal_packets(uwb_uci_packets::SessionStatusNtfBuilder {
-            session_id,
+            session_token,
             session_state: SessionState::SessionStateActive,
             reason_code: 0, /* ReasonCode::StateChangeWithSessionManagementCommands */
         }));
         hal.expected_send_command(cmd, responses, Ok(()));
     }
 
-    // TODO(b/276320369): Listing down the Data Packet Rx scenarios below, will add unit tests
-    // for them in subsequent CLs.
+    async fn setup_uci_manager_with_session_active<F, Fut>(
+        setup_hal_fn: F,
+        uci_logger_mode: UciLoggerMode,
+        log_sender: mpsc::UnboundedSender<UciLogEvent>,
+        session_id: u32,
+        session_token: u32,
+    ) -> (UciManagerImpl, MockUciHal)
+    where
+        F: FnOnce(MockUciHal) -> Fut,
+        Fut: Future<Output = ()>,
+    {
+        let session_type = SessionType::FiraRangingSession;
+
+        init_test_logging();
+
+        let mut hal = MockUciHal::new();
+        setup_hal_for_session_active(&mut hal, session_type, session_id, session_token);
+
+        // Verify open_hal() is working.
+        let uci_manager =
+            UciManagerImpl::new(hal.clone(), MockUciLogger::new(log_sender), uci_logger_mode);
+        let result = uci_manager.open_hal().await;
+        assert!(result.is_ok());
+
+        // Verify session is initialized.
+        let result = uci_manager.session_init(session_id, session_type).await;
+        assert!(result.is_ok());
+
+        // Verify session is started.
+        let result = uci_manager.range_start(session_id).await;
+        assert!(result.is_ok());
+        assert!(hal.wait_expected_calls_done().await);
+
+        setup_hal_fn(hal.clone()).await;
+
+        (uci_manager, hal)
+    }
+
+    // Test Data packet receive for a single packet (on an active UWB session).
     #[tokio::test]
-    async fn test_data_packet_recv_ok() {}
+    async fn test_data_packet_recv_ok() {
+        let mt_data = 0x0;
+        let pbf = 0x0;
+        let dpf = 0x2;
+        let oid = 0x0;
+        let session_id = 0x3;
+        let session_token = 0x5;
+        let uci_sequence_num = 0xa;
+        let source_address = UwbAddress::Extended([0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1]);
+        let app_data = vec![0x01, 0x02, 0x03];
+        let data_rcv_payload = vec![
+            0x05, 0x00, 0x00, 0x00, // SessionToken
+            0x00, // DataRcvStatusCode
+            0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1, // MacAddress
+            0x0a, 0x00, // UciSequenceNumber
+            0x03, 0x00, // AppDataLen
+            0x01, 0x02, 0x03, // AppData
+        ];
+
+        // Setup the DataPacketRcv (Rx by HAL) and the expected DataRcvNotification.
+        let data_packet_rcv = build_uci_packet(mt_data, pbf, dpf, oid, data_rcv_payload);
+        let expected_data_rcv_notification = DataRcvNotification {
+            session_token,
+            status: DataRcvStatusCode::UciStatusSuccess,
+            uci_sequence_num,
+            source_address,
+            payload: app_data,
+        };
+
+        // Setup an active UWBS session over which the DataPacket will be received by the Host.
+        let (mut uci_manager, mut mock_hal) = setup_uci_manager_with_session_active(
+            |_| async move {},
+            UciLoggerMode::Disabled,
+            mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
+        )
+        .await;
+
+        let (data_rcv_notification_sender, mut data_rcv_notification_receiver) =
+            mpsc::unbounded_channel::<DataRcvNotification>();
+        uci_manager.set_data_rcv_notification_sender(data_rcv_notification_sender).await;
+
+        // Inject the UCI DataPacketRcv into HAL.
+        let result = mock_hal.receive_packet(data_packet_rcv);
+        assert!(result.is_ok());
+
+        // UciManager should send a DataRcvNotification (for the valid Rx packet).
+        let result =
+            tokio::time::timeout(Duration::from_millis(100), data_rcv_notification_receiver.recv())
+                .await;
+        assert!(result.is_ok());
+        assert_eq!(result.unwrap(), Some(expected_data_rcv_notification));
+        assert!(mock_hal.wait_expected_calls_done().await);
+    }
+
+    // Test Data packet receive for two packet fragments (on an active UWB session).
+    #[tokio::test]
+    async fn test_data_packet_recv_fragmented_packets_ok() {
+        let mt_data = 0x0;
+        let pbf_fragment_1 = 0x1;
+        let pbf_fragment_2 = 0x0;
+        let dpf = 0x2;
+        let oid = 0x0;
+        let session_id = 0x3;
+        let session_token = 0x5;
+        let uci_sequence_num = 0xa;
+        let source_address = UwbAddress::Extended([0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1]);
+        let app_data_len = 300;
+        let app_data_fragment_1_len = 200;
+        let mut data_rcv_payload_fragment_1: Vec<u8> = vec![
+            0x05, 0x00, 0x00, 0x00, // SessionToken
+            0x00, // DataRcvStatusCode
+            0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1, // MacAddress
+            0x0a, 0x00, // UciSequenceNumber
+            0x2c, 0x01, // AppData Length (300)
+        ];
+
+        // Setup the application data (payload) for the 2 DataPacketRcv fragments.
+        let mut app_data: Vec<u8> = Vec::new();
+        for i in 0..app_data_len {
+            app_data.push((i & 0xff).try_into().unwrap());
+        }
+        data_rcv_payload_fragment_1.extend_from_slice(&app_data[0..app_data_fragment_1_len]);
+        let mut data_rcv_payload_fragment_2: Vec<u8> = Vec::new();
+        data_rcv_payload_fragment_2.extend_from_slice(&app_data[app_data_fragment_1_len..]);
+
+        // Setup the DataPacketRcv fragments (Rx by HAL) and the expected DataRcvNotification.
+        let data_packet_rcv_fragment_1 =
+            build_uci_packet(mt_data, pbf_fragment_1, dpf, oid, data_rcv_payload_fragment_1);
+        let data_packet_rcv_fragment_2 =
+            build_uci_packet(mt_data, pbf_fragment_2, dpf, oid, data_rcv_payload_fragment_2);
+        let expected_data_rcv_notification = DataRcvNotification {
+            session_token,
+            status: DataRcvStatusCode::UciStatusSuccess,
+            uci_sequence_num,
+            source_address,
+            payload: app_data,
+        };
+
+        // Setup an active UWBS session over which the DataPacket will be received by the Host.
+        let (mut uci_manager, mut mock_hal) = setup_uci_manager_with_session_active(
+            |_| async move {},
+            UciLoggerMode::Disabled,
+            mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
+        )
+        .await;
+
+        let (data_rcv_notification_sender, mut data_rcv_notification_receiver) =
+            mpsc::unbounded_channel::<DataRcvNotification>();
+        uci_manager.set_data_rcv_notification_sender(data_rcv_notification_sender).await;
+
+        // Inject the 2 UCI DataPacketRcv into HAL.
+        let result = mock_hal.receive_packet(data_packet_rcv_fragment_1);
+        assert!(result.is_ok());
+        let result = mock_hal.receive_packet(data_packet_rcv_fragment_2);
+        assert!(result.is_ok());
+
+        // UciManager should send a DataRcvNotification (for the valid Rx packet).
+        let result =
+            tokio::time::timeout(Duration::from_millis(100), data_rcv_notification_receiver.recv())
+                .await;
+        assert!(result.is_ok());
+        assert_eq!(result.unwrap(), Some(expected_data_rcv_notification));
+        assert!(mock_hal.wait_expected_calls_done().await);
+    }
 
     #[tokio::test]
-    async fn test_data_packet_recv_fragmented_packet_ok() {}
+    async fn test_data_packet_recv_bad_payload_len_failure() {}
 
     #[tokio::test]
     async fn test_data_packet_send_ok() {
@@ -2201,35 +2748,33 @@
         let dpf = 0x1;
         let oid = 0x0;
         let session_id = 0x5;
+        let session_token = 0x5;
         let dest_mac_address = vec![0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1];
-        let dest_fira_component = FiraComponent::Host;
-        let uci_sequence_number = 0xa;
+        let uci_sequence_number: u16 = 0xa;
         let app_data = vec![0x01, 0x02, 0x03];
         let expected_data_snd_payload = vec![
             0x05, 0x00, 0x00, 0x00, // SessionID
             0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1, // MacAddress
-            0x01, // FiraComponent
-            0x0a, // UciSequenceNumber
+            0x0a, 0x00, // UciSequenceNumber
             0x03, 0x00, // AppDataLen
             0x01, 0x02, 0x03, // AppData
         ];
         let status = DataTransferNtfStatusCode::UciDataTransferStatusRepetitionOk;
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                setup_active_session(hal, session_id);
-
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_active(
+            |mut hal| async move {
                 // Now setup the notifications that should be received after a Data packet send.
                 let data_packet_snd =
                     build_uci_packet(mt_data, pbf, dpf, oid, expected_data_snd_payload);
                 let mut ntfs = into_uci_hal_packets(uwb_uci_packets::DataCreditNtfBuilder {
-                    session_id,
+                    session_token,
                     credit_availability: CreditAvailability::CreditAvailable,
                 });
                 ntfs.append(&mut into_uci_hal_packets(
                     uwb_uci_packets::DataTransferStatusNtfBuilder {
-                        session_id,
-                        uci_sequence_number,
+                        session_token,
+                        // TODO(b/282230468): Remove the u16-to-u8 conversion once spec is updated.
+                        uci_sequence_number: uci_sequence_number.try_into().unwrap(),
                         status,
                     },
                 ));
@@ -2237,20 +2782,13 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
-        let result = uci_manager.range_start(session_id).await;
-        assert!(result.is_ok());
-
         let result = uci_manager
-            .send_data_packet(
-                session_id,
-                dest_mac_address,
-                dest_fira_component,
-                uci_sequence_number,
-                app_data,
-            )
+            .send_data_packet(session_id, dest_mac_address, uci_sequence_number, app_data)
             .await;
         assert!(result.is_ok());
         assert!(mock_hal.wait_expected_calls_done().await);
@@ -2268,16 +2806,15 @@
         let dpf = 0x1;
         let oid = 0x0;
         let session_id = 0x5;
+        let session_token = 0x5;
         let dest_mac_address = vec![0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1];
-        let dest_fira_component = FiraComponent::Host;
-        let uci_sequence_number = 0xa;
+        let uci_sequence_number: u16 = 0xa;
         let app_data_len = 300; // Larger than MAX_PAYLOAD_LEN=255, so fragmentation occurs.
         let mut app_data = Vec::new();
         let mut expected_data_snd_payload_fragment_1 = vec![
             0x05, 0x00, 0x00, 0x00, // SessionID
             0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1, // MacAddress
-            0x01, // FiraComponent
-            0x0a, // UciSequenceNumber
+            0x0a, 0x00, // UciSequenceNumber
             0x2c, 0x01, // AppDataLen = 300
         ];
         let mut expected_data_snd_payload_fragment_2 = Vec::new();
@@ -2294,10 +2831,8 @@
             }
         }
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                setup_active_session(hal, session_id);
-
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_active(
+            |mut hal| async move {
                 // Expected data packet fragment #1 (UCI Header + Initial App data bytes).
                 let data_packet_snd_fragment_1 = build_uci_packet(
                     mt_data,
@@ -2307,7 +2842,7 @@
                     expected_data_snd_payload_fragment_1,
                 );
                 let ntfs = into_uci_hal_packets(uwb_uci_packets::DataCreditNtfBuilder {
-                    session_id,
+                    session_token,
                     credit_availability: CreditAvailability::CreditAvailable,
                 });
                 hal.expected_send_packet(data_packet_snd_fragment_1, ntfs, Ok(()));
@@ -2321,13 +2856,14 @@
                     expected_data_snd_payload_fragment_2,
                 );
                 let mut ntfs = into_uci_hal_packets(uwb_uci_packets::DataCreditNtfBuilder {
-                    session_id,
+                    session_token,
                     credit_availability: CreditAvailability::CreditAvailable,
                 });
                 ntfs.append(&mut into_uci_hal_packets(
                     uwb_uci_packets::DataTransferStatusNtfBuilder {
-                        session_id,
-                        uci_sequence_number,
+                        session_token,
+                        // TODO(b/282230468): Remove the u16-to-u8 conversion once spec is updated.
+                        uci_sequence_number: uci_sequence_number.try_into().unwrap(),
                         status,
                     },
                 ));
@@ -2335,20 +2871,13 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
-        let result = uci_manager.range_start(session_id).await;
-        assert!(result.is_ok());
-
         let result = uci_manager
-            .send_data_packet(
-                session_id,
-                dest_mac_address,
-                dest_fira_component,
-                uci_sequence_number,
-                app_data,
-            )
+            .send_data_packet(session_id, dest_mac_address, uci_sequence_number, app_data)
             .await;
         assert!(result.is_ok());
         assert!(mock_hal.wait_expected_calls_done().await);
@@ -2362,24 +2891,21 @@
         let dpf = 0x1;
         let oid = 0x0;
         let session_id = 0x5;
+        let session_token = 0x5;
         let dest_mac_address = vec![0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1];
-        let dest_fira_component = FiraComponent::Host;
-        let uci_sequence_number = 0xa;
+        let uci_sequence_number: u16 = 0xa;
         let app_data = vec![0x01, 0x02, 0x03];
         let expected_data_snd_payload = vec![
             0x05, 0x00, 0x00, 0x00, // SessionID
             0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1, // MacAddress
-            0x01, // FiraComponent
-            0x0a, // UciSequenceNumber
+            0x0a, 0x00, // UciSequenceNumber
             0x03, 0x00, // AppDataLen
             0x01, 0x02, 0x03, // AppData
         ];
         let status = DataTransferNtfStatusCode::UciDataTransferStatusRepetitionOk;
 
-        let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
-                setup_active_session(hal, session_id);
-
+        let (uci_manager, mut mock_hal) = setup_uci_manager_with_session_active(
+            |mut hal| async move {
                 // Setup receiving a CORE_GENERIC_ERROR_NTF with STATUS_COMMAND_RETRY after a
                 // failed Data packet send attempt.
                 let data_packet_snd =
@@ -2392,13 +2918,14 @@
                 // Setup the notifications that should be received after the Data packet send
                 // is successfully retried.
                 let mut ntfs = into_uci_hal_packets(uwb_uci_packets::DataCreditNtfBuilder {
-                    session_id,
+                    session_token,
                     credit_availability: CreditAvailability::CreditAvailable,
                 });
                 ntfs.append(&mut into_uci_hal_packets(
                     uwb_uci_packets::DataTransferStatusNtfBuilder {
-                        session_id,
-                        uci_sequence_number,
+                        session_token,
+                        // TODO(b/282230468): Remove the u16-to-u8 conversion once spec is updated.
+                        uci_sequence_number: uci_sequence_number.try_into().unwrap(),
                         status,
                     },
                 ));
@@ -2406,20 +2933,13 @@
             },
             UciLoggerMode::Disabled,
             mpsc::unbounded_channel::<UciLogEvent>().0,
+            session_id,
+            session_token,
         )
         .await;
 
-        let result = uci_manager.range_start(session_id).await;
-        assert!(result.is_ok());
-
         let result = uci_manager
-            .send_data_packet(
-                session_id,
-                dest_mac_address,
-                dest_fira_component,
-                uci_sequence_number,
-                app_data,
-            )
+            .send_data_packet(session_id, dest_mac_address, uci_sequence_number, app_data)
             .await;
         assert!(result.is_ok());
         assert!(mock_hal.wait_expected_calls_done().await);
@@ -2469,7 +2989,7 @@
     #[tokio::test]
     async fn test_session_get_count_retry_no_response() {
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::SessionGetCount;
                 hal.expected_send_command(cmd, vec![], Ok(()));
             },
@@ -2486,7 +3006,7 @@
     #[tokio::test]
     async fn test_session_get_count_timeout() {
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::SessionGetCount;
                 hal.expected_send_command(cmd, vec![], Err(Error::Timeout));
             },
@@ -2503,7 +3023,7 @@
     #[tokio::test]
     async fn test_session_get_count_retry_too_many_times() {
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::SessionGetCount;
                 let retry_resp = into_uci_hal_packets(uwb_uci_packets::SessionGetCountRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusCommandRetry,
@@ -2529,7 +3049,7 @@
         let session_count = 5;
 
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::SessionGetCount;
                 let retry_resp = into_uci_hal_packets(uwb_uci_packets::SessionGetCountRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusCommandRetry,
@@ -2558,7 +3078,7 @@
     async fn test_log_manager_interaction() {
         let (log_sender, mut log_receiver) = mpsc::unbounded_channel::<UciLogEvent>();
         let (uci_manager, mut mock_hal) = setup_uci_manager_with_open_hal(
-            move |hal| {
+            |mut hal| async move {
                 let cmd = UciCommand::SessionGetCount;
                 let resp1 = into_uci_hal_packets(uwb_uci_packets::SessionGetCountRspBuilder {
                     status: uwb_uci_packets::StatusCode::UciStatusOk,
diff --git a/src/rust/uwb_core/src/uci/uci_manager_sync.rs b/src/rust/uwb_core/src/uci/uci_manager_sync.rs
index 0c62959..4b1cf25 100644
--- a/src/rust/uwb_core/src/uci/uci_manager_sync.rs
+++ b/src/rust/uwb_core/src/uci/uci_manager_sync.rs
@@ -27,9 +27,9 @@
 use crate::error::{Error, Result};
 use crate::params::{
     AppConfigTlv, AppConfigTlvType, CapTlv, CoreSetConfigResponse, CountryCode, DeviceConfigId,
-    DeviceConfigTlv, FiraComponent, GetDeviceInfoResponse, PowerStats, RawUciMessage, ResetConfig,
-    SessionId, SessionState, SessionType, SessionUpdateDtTagRangingRoundsResponse,
-    SetAppConfigResponse, UpdateMulticastListAction,
+    DeviceConfigTlv, GetDeviceInfoResponse, PowerStats, RawUciMessage, ResetConfig, SessionId,
+    SessionState, SessionType, SessionUpdateDtTagRangingRoundsResponse, SetAppConfigResponse,
+    UpdateMulticastListAction,
 };
 #[cfg(any(test, feature = "mock-utils"))]
 use crate::uci::mock_uci_manager::MockUciManager;
@@ -242,6 +242,11 @@
         self.runtime_handle.block_on(self.uci_manager.core_get_config(config_ids))
     }
 
+    /// Send UCI command for getting uwbs timestamp.
+    pub fn core_query_uwb_timestamp(&self) -> Result<u64> {
+        self.runtime_handle.block_on(self.uci_manager.core_query_uwb_timestamp())
+    }
+
     /// Send UCI command for initiating session.
     pub fn session_init(&self, session_id: SessionId, session_type: SessionType) -> Result<()> {
         self.runtime_handle.block_on(self.uci_manager.session_init(session_id, session_type))
@@ -353,18 +358,20 @@
         &self,
         session_id: SessionId,
         address: Vec<u8>,
-        dest_end_point: FiraComponent,
-        uci_sequence_num: u8,
+        uci_sequence_num: u16,
         app_payload_data: Vec<u8>,
     ) -> Result<()> {
         self.runtime_handle.block_on(self.uci_manager.send_data_packet(
             session_id,
             address,
-            dest_end_point,
             uci_sequence_num,
             app_payload_data,
         ))
     }
+    /// Get session token for session id.
+    pub fn get_session_token(&self, session_id: SessionId) -> Result<u32> {
+        self.runtime_handle.block_on(self.uci_manager.get_session_token_from_session_id(session_id))
+    }
 }
 
 impl UciManagerSync<UciManagerImpl> {
@@ -381,6 +388,7 @@
         hal: H,
         notification_manager_builder: B,
         logger: L,
+        logger_mode: UciLoggerMode,
         runtime_handle: Handle,
     ) -> Result<Self>
     where
@@ -389,8 +397,8 @@
         L: UciLogger,
     {
         // UciManagerImpl::new uses tokio::spawn, so it is called inside the runtime as async fn.
-        let uci_manager = runtime_handle
-            .block_on(async { UciManagerImpl::new(hal, logger, UciLoggerMode::Disabled) });
+        let uci_manager =
+            runtime_handle.block_on(async { UciManagerImpl::new(hal, logger, logger_mode) });
         let mut uci_manager_sync = UciManagerSync { runtime_handle, uci_manager };
         uci_manager_sync.redirect_notification(notification_manager_builder)?;
         Ok(uci_manager_sync)
diff --git a/src/rust/uwb_uci_packets/src/lib.rs b/src/rust/uwb_uci_packets/src/lib.rs
index c5bb3f5..38b0910 100644
--- a/src/rust/uwb_uci_packets/src/lib.rs
+++ b/src/rust/uwb_uci_packets/src/lib.rs
@@ -716,7 +716,7 @@
 #[allow(dead_code)]
 #[derive(Debug, Clone)]
 pub struct ParsedDiagnosticNtfPacket {
-    session_id: u32,
+    session_token: u32,
     sequence_number: u32,
     frame_reports: Vec<ParsedFrameReport>,
 }
@@ -733,7 +733,7 @@
 }
 
 pub fn parse_diagnostics_ntf(evt: AndroidRangeDiagnosticsNtf) -> Result<ParsedDiagnosticNtfPacket> {
-    let session_id = evt.get_session_id();
+    let session_token = evt.get_session_token();
     let sequence_number = evt.get_sequence_number();
     let mut parsed_frame_reports = Vec::new();
     for report in evt.get_frame_reports() {
@@ -773,7 +773,7 @@
         });
     }
     Ok(ParsedDiagnosticNtfPacket {
-        session_id,
+        session_token,
         sequence_number,
         frame_reports: parsed_frame_reports,
     })
@@ -789,8 +789,7 @@
 // TODO(ziyiw): Replace these functions after making uwb_uci_packets::Controlee::write_to() public.
 pub fn write_controlee(controlee: &Controlee) -> BytesMut {
     let mut buffer = BytesMut::new();
-    let short_address = controlee.short_address;
-    buffer.extend_from_slice(&short_address.to_le_bytes()[0..2]);
+    buffer.extend_from_slice(&controlee.short_address);
     let subsession_id = controlee.subsession_id;
     buffer.extend_from_slice(&subsession_id.to_le_bytes()[0..4]);
     buffer
@@ -798,8 +797,7 @@
 
 pub fn write_controlee_2_0_16byte(controlee: &Controlee_V2_0_16_Byte_Version) -> BytesMut {
     let mut buffer = BytesMut::new();
-    let short_address = controlee.short_address;
-    buffer.extend_from_slice(&short_address.to_le_bytes()[0..2]);
+    buffer.extend_from_slice(&controlee.short_address);
     let subsession_id = controlee.subsession_id;
     buffer.extend_from_slice(&subsession_id.to_le_bytes()[0..4]);
     buffer.extend_from_slice(&controlee.subsession_key);
@@ -808,8 +806,7 @@
 
 pub fn write_controlee_2_0_32byte(controlee: &Controlee_V2_0_32_Byte_Version) -> BytesMut {
     let mut buffer = BytesMut::new();
-    let short_address = controlee.short_address;
-    buffer.extend_from_slice(&short_address.to_le_bytes()[0..2]);
+    buffer.extend_from_slice(&controlee.short_address);
     let subsession_id = controlee.subsession_id;
     buffer.extend_from_slice(&subsession_id.to_le_bytes()[0..4]);
     buffer.extend_from_slice(&controlee.subsession_key);
@@ -821,7 +818,7 @@
 /// This function can build the packet with/without message control, which
 /// is indicated by action parameter.
 pub fn build_session_update_controller_multicast_list_cmd(
-    session_id: u32,
+    session_token: u32,
     action: UpdateMulticastListAction,
     controlees: Controlees,
 ) -> Result<SessionUpdateControllerMulticastListCmd> {
@@ -855,7 +852,7 @@
         _ => return Err(Error::InvalidPacketError),
     }
     Ok(SessionUpdateControllerMulticastListCmdBuilder {
-        session_id,
+        session_token,
         action,
         payload: Some(controlees_buf.freeze()),
     }
@@ -903,9 +900,12 @@
         let frame_report =
             FrameReport { uwb_msg_id: 1, action: 1, antenna_set: 1, frame_report_tlvs: tlvs };
         frame_reports.push(frame_report);
-        let packet =
-            AndroidRangeDiagnosticsNtfBuilder { session_id: 1, sequence_number: 1, frame_reports }
-                .build();
+        let packet = AndroidRangeDiagnosticsNtfBuilder {
+            session_token: 1,
+            sequence_number: 1,
+            frame_reports,
+        }
+        .build();
         let mut parsed_packet = parse_diagnostics_ntf(packet).unwrap();
         let parsed_frame_report = parsed_packet.frame_reports.pop().unwrap();
         assert_eq!(rssi_vec, parsed_frame_report.rssi);
@@ -916,7 +916,8 @@
 
     #[test]
     fn test_write_controlee() {
-        let controlee: Controlee = Controlee { short_address: 2, subsession_id: 3 };
+        let short_address: [u8; 2] = [2, 3];
+        let controlee: Controlee = Controlee { short_address, subsession_id: 3 };
         let bytes = write_controlee(&controlee);
         let parsed_controlee = Controlee::parse(&bytes).unwrap();
         assert_eq!(controlee, parsed_controlee);
@@ -924,7 +925,8 @@
 
     #[test]
     fn test_build_multicast_update_packet() {
-        let controlee = Controlee { short_address: 0x1234, subsession_id: 0x1324_3546 };
+        let short_address: [u8; 2] = [0x12, 0x34];
+        let controlee = Controlee { short_address, subsession_id: 0x1324_3546 };
         let packet: UciControlPacket = build_session_update_controller_multicast_list_cmd(
             0x1425_3647,
             UpdateMulticastListAction::AddControlee,
@@ -939,7 +941,7 @@
             vec![
                 0x21, 0x07, 0x00, 0x0c, // 2(packet info), RFU, payload length(12)
                 0x47, 0x36, 0x25, 0x14, // 4(session id (LE))
-                0x00, 0x01, 0x34, 0x12, // action, # controlee, 2(short address (LE))
+                0x00, 0x01, 0x12, 0x34, // action, # controlee, 2(short address (LE))
                 0x46, 0x35, 0x24, 0x13, // 4(subsession id (LE))
             ]
         );
diff --git a/src/rust/uwb_uci_packets/uci_packets.pdl b/src/rust/uwb_uci_packets/uci_packets.pdl
index edec9a7..54de313 100644
--- a/src/rust/uwb_uci_packets/uci_packets.pdl
+++ b/src/rust/uwb_uci_packets/uci_packets.pdl
@@ -49,6 +49,7 @@
     CORE_GET_CONFIG = 0x05,
     CORE_DEVICE_SUSPEND = 0x06,
     CORE_GENERIC_ERROR_NTF = 0x07,
+    CORE_QUERY_UWBS_TIMESTAMP = 0x08,
 }
 
 enum SessionConfigOpCode : 6 {
@@ -101,7 +102,9 @@
     UCI_STATUS_UNKNOWN_OID = 0x08,
     UCI_STATUS_READ_ONLY = 0x09,
     UCI_STATUS_COMMAND_RETRY = 0x0A,
-    RFU_STATUS_CODE_RANGE_1 = 0x0B..0x10,
+    UCI_STATUS_UNKNOWN = 0x0B,
+    UCI_STATUS_NOT_APPLICABLE = 0x0C,
+    RFU_STATUS_CODE_RANGE_1 = 0x0D..0x10,
 
     // UWB Session Specific Status Codes
     UCI_STATUS_SESSION_NOT_EXIST = 0x11,
@@ -113,6 +116,7 @@
     UCI_STATUS_MULTICAST_LIST_FULL = 0x17,
     UCI_STATUS_ADDRESS_NOT_FOUND = 0x18,
     UCI_STATUS_ADDRESS_ALREADY_PRESENT = 0x19,
+    UCI_STATUS_ERROR_UWB_INITIATION_TIME_TOO_OLD = 0x1A,
     UCI_STATUS_OK_NEGATIVE_DISTANCE_REPORT = 0x1B,
     RFU_STATUS_CODE_RANGE_2 = 0x1C..0x1F,
 
@@ -127,9 +131,8 @@
     UCI_STATUS_RANGING_RX_MAC_IE_MISSING = 0x27,
     UCI_STATUS_ERROR_ROUND_INDEX_NOT_ACTIVATED = 0x28,
     UCI_STATUS_ERROR_NUMBER_OF_ACTIVE_RANGING_ROUNDS_EXCEEDED = 0x29,
-    UCI_STATUS_ERROR_ROUND_INDEX_NOT_SET_AS_INITIATOR = 0x2A,
-    UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST = 0x2B,
-    RFU_STATUS_CODE_RANGE_3 = 0x2C..0x2F,
+    UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST = 0x2A,
+    RFU_STATUS_CODE_RANGE_3 = 0x2B..0x2F,
 
     // UWB Data Session Specific Status Codes
     UCI_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED = 0x30,
@@ -147,13 +150,6 @@
     VENDOR_SPECIFIC_STATUS_CODE_2 = 0xFF,
 }
 
-// This needs a separate type as the Status code values in an OWR for AOA
-// Measurement has different values.
-enum OwrAoaStatusCode : 8 {
-    UCI_STATUS_SUCCESS = 0x00,
-    UCI_STATUS_INTER_FRAME_INTERVAL_TIMEOUT = 0x01,
-}
-
 // This needs a separate StatusCode as the Status code values in the DATA_RCV packet have
 // different values from the generic StatusCode above.
 enum DataRcvStatusCode : 8 {
@@ -178,12 +174,6 @@
     UCI_DATA_TRANSFER_STATUS_ERROR_DATA_TRANSFER_IS_ONGOING = 0x06,
 }
 
-enum FiraComponent : 8 {
-    UWBS = 0x00,
-    HOST = 0x01,
-    SECURE_COMPONENT = 0x02,
-}
-
 enum ResetConfig : 8 {
     UWBS_RESET = 0x00,
 }
@@ -515,21 +505,18 @@
 }
 
 packet UciDataSnd : UciDataPacket (data_packet_format = DATA_SND, message_type = DATA) {
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     dest_mac_address: 64,
-    dest_fira_component: FiraComponent,
-    uci_sequence_number: 8,
+    uci_sequence_number: 16,
     _size_(data): 16,
     data: 8[]
 }
 
 packet UciDataRcv : UciDataPacket (data_packet_format = DATA_RCV, message_type = DATA) {
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     status: DataRcvStatusCode,
-    uci_sequence_number: 32,
     source_mac_address: 64,
-    source_fira_component: FiraComponent,
-    dest_fira_component: FiraComponent,
+    uci_sequence_number: 16,
     _size_(data): 16,
     data: 8[]
 }
@@ -722,6 +709,23 @@
     "\x60\x07\x00\x01\x00\x00\x00\x01",
 }
 
+
+packet CoreQueryTimeStampCmd : CoreCommand (opcode = 0x8) { //CORE_QUERY_UWBS_TIMESTAMP
+}
+
+test CoreQueryTimeStampCmd {
+    "\x20\x08\x00\\x00",
+}
+
+packet CoreQueryTimeStampRsp : CoreResponse (opcode = 0x8) { //CORE_QUERY_UWBS_TIMESTAMP
+    status: StatusCode,
+    timeStamp: 64,
+}
+
+test CoreQueryTimeStampRsp {
+    "\x40\x08\x00\x09\x00\x00\x00\x01\x01\x00\x01\x01\x01",
+}
+
 packet SessionInitCmd : SessionConfigCommand (opcode = 0x0) { //SESSION_INIT
     session_id: 32,
     session_type: SessionType,
@@ -731,6 +735,17 @@
     "\x21\x00\x00\x05\x00\x00\x00\x01\x02\x03\x04\x01",
 }
 
+// FIRA version 2 introduces a new version of SESSION_INIT_RSP which
+// includes UWBS generated session handle.
+packet SessionInitRsp_V2 : SessionConfigResponse (opcode = 0x0) { //SESSION_INIT
+    status: StatusCode,
+    session_handle: 32,
+}
+
+test SessionInitRsp_V2 {
+    "\x41\x00\x00\x01\x00\x00\x00\x11\x00\x00\x00\x01",
+}
+
 packet SessionInitRsp : SessionConfigResponse (opcode = 0x0) { //SESSION_INIT
     status: StatusCode,
 }
@@ -740,7 +755,7 @@
 }
 
 packet SessionDeinitCmd : SessionConfigCommand (opcode = 0x1) { //SESSION_DEINIT
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
 }
 
 test SessionDeinitCmd {
@@ -756,7 +771,7 @@
 }
 
 packet SessionStatusNtf : SessionConfigNotification (opcode = 0x2) { //SESSION_STATUS_NTF
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     session_state: SessionState,
     // TODO(b/272775225): Switch back to the enum type ReasonCode, once PDL supports defining a
     // range inside an enum (for the vendor-specific space), in b/267339120.
@@ -775,7 +790,7 @@
 }
 
 packet SessionSetAppConfigCmd : SessionConfigCommand (opcode = 0x3) { //SESSION_SET_APP_CONFIG
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     _count_(tlvs): 8,
     tlvs: AppConfigTlv[]
 }
@@ -800,7 +815,7 @@
 }
 
 packet SessionGetAppConfigCmd : SessionConfigCommand (opcode = 0x4) { //SESSION_GET_APP_CONFIG
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     _count_(app_cfg): 8,
     app_cfg: 8[], // AppConfigTlvType (Infra does not allow array of enums)
 }
@@ -836,7 +851,7 @@
 }
 
 packet SessionGetStateCmd : SessionConfigCommand (opcode = 0x6) { //SESSION_GET_STATE
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
 }
 
 test SessionGetStateCmd {
@@ -853,7 +868,7 @@
 }
 
 packet SessionUpdateDtTagRangingRoundsCmd : SessionConfigCommand (opcode = 0x9) { //SESSION_UPDATE_ACTIVE_ROUNDS_DT_TAG
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     _count_(ranging_round_indexes): 8,
     ranging_round_indexes: 8[],
 }
@@ -873,18 +888,18 @@
 }
 
 struct Controlee {
-    short_address: 16,
+    short_address: 8[2],
     subsession_id: 32,
 }
 
 struct Controlee_V2_0_16_Byte_Version {
-    short_address: 16,
+    short_address: 8[2],
     subsession_id: 32,
     subsession_key: 8[16],
 }
 
 struct Controlee_V2_0_32_Byte_Version {
-    short_address: 16,
+    short_address: 8[2],
     subsession_id: 32,
     subsession_key: 8[32],
 }
@@ -897,7 +912,7 @@
 }
 
 packet SessionUpdateControllerMulticastListCmd : SessionConfigCommand (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     action: UpdateMulticastListAction,
     _payload_,
 }
@@ -926,13 +941,13 @@
 }
 
 struct ControleeStatus {
-    mac_address: 16,
+    mac_address: 8[2],
     subsession_id: 32,
     status: MulticastUpdateStatusCode,
 }
 
 packet SessionUpdateControllerMulticastListNtf : SessionConfigNotification (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     remaining_multicast_list_size: 8,
     _count_(controlee_status): 8,
     controlee_status: ControleeStatus[],
@@ -943,7 +958,7 @@
 }
 
 packet DataCreditNtf : SessionControlNotification (opcode = 0x04) { // SESSION_DATA_CREDIT_NTF
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     credit_availability: CreditAvailability,
 }
 
@@ -952,7 +967,7 @@
 }
 
 packet DataTransferStatusNtf : SessionControlNotification (opcode = 0x05) { // SESSION_DATA_TRANSFER_STATUS_NTF
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     uci_sequence_number: 8,
     status: DataTransferNtfStatusCode,
     // TODO(b/269779288): Add the tx_count field for implementing the DATA_REPETITION added in CR490.
@@ -963,7 +978,7 @@
 }
 
 packet SessionQueryMaxDataSizeCmd : SessionConfigCommand (opcode = 0xB) { //QUERY_MAX_DATA_SIZE
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
 }
 
 test SessionQueryMaxDataSizeCmd {
@@ -971,7 +986,7 @@
 }
 
 packet SessionQueryMaxDataSizeRsp : SessionConfigResponse (opcode = 0xB) { //QUER_MAX_DATA_SIZE
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     max_data_size: 16,
 }
 
@@ -980,7 +995,7 @@
 }
 
 packet SessionStartCmd : SessionControlCommand (opcode = 0x0) { //RANGE_START
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
 }
 
 test SessionStartCmd {
@@ -1037,7 +1052,7 @@
 
 struct ShortAddressOwrAoaRangingMeasurement {
     mac_address: 16,
-    status: OwrAoaStatusCode,
+    status: StatusCode,
     nlos: 8,
     frame_sequence_number: 8,
     block_index: 16,
@@ -1049,7 +1064,7 @@
 
 struct ExtendedAddressOwrAoaRangingMeasurement {
     mac_address: 64,
-    status: OwrAoaStatusCode,
+    status: StatusCode,
     nlos: 8,
     frame_sequence_number: 8,
     block_index: 16,
@@ -1068,7 +1083,7 @@
 
 packet SessionInfoNtf : SessionControlNotification (opcode = 0x0) { // SESSION_INFO
     sequence_number: 32,
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     rcr_indicator: 8,
     current_ranging_interval: 32,
     ranging_measurement_type: RangingMeasurementType,
@@ -1139,7 +1154,7 @@
 }
 
 packet SessionStopCmd : SessionControlCommand (opcode = 0x1) { // SESSION_STOP
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
 }
 
 test SessionStopCmd {
@@ -1155,7 +1170,7 @@
 }
 
 packet SessionGetRangingCountCmd : SessionControlCommand (opcode = 0x3) { // SESSION_GET_RANGING_COUNT
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
 }
 
 test SessionGetRangingCountCmd {
@@ -1274,7 +1289,7 @@
 }
 
 packet AndroidRangeDiagnosticsNtf : AndroidNotification (opcode = 0x2) { //FIRA_RANGE_DIAGNOSTICS
-    session_id: 32,
+    session_token: 32, // Session ID or Session Handle (based on UWBS version)
     sequence_number: 32,
     _count_(frame_reports): 8,
     frame_reports: FrameReport[],
diff --git a/src/uci/include/uci_defs.h b/src/uci/include/uci_defs.h
deleted file mode 100755
index 8579e63..0000000
--- a/src/uci/include/uci_defs.h
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021-2022 NXP.
- *
- * 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.
- */
-
-/******************************************************************************
- *
- *  This file contains the definition from UCI specification
- *
- ******************************************************************************/
-
-#ifndef UWB_UCI_DEFS_H
-#define UWB_UCI_DEFS_H
-
-#include <stdint.h>
-
-#define UCI_PAYLOAD_SUPPORT  1
-#define UCI_MAX_PAYLOAD_SIZE 4096
-
-/* Define the message header size for all UCI Commands and Notifications.
- */
-#define UCI_MSG_HDR_SIZE 0x04     /* per UCI spec */
-#define UCI_MAX_PAYLOAD_SIZE 4096 /* max control message size */
-#define UCI_MAX_PKT_SIZE 259 /* Max payload size + header size */
-#define UCI_PSDU_SIZE_4K 4096     /* PSDU Data size */
-#define UCI_VENDOR_INFO_MAX_SIZE 0xFF
-
-#define UCI_PAYLOAD_SUPPORT 1
-#define MAX_UCI_DATA_PKT_SIZE 4096
-#define UCI_LENGTH_SHIFT 8
-#define UCI_RESPONSE_STATUS_OFFSET 0x04
-#define UCI_RESPONSE_PAYLOAD_OFFSET 0x05
-#define UCI_MAX_FRAGMENT_BUFF_SIZE 4200
-
-/* UCI Command and Notification Format:
- * 4 byte message header:
- * byte 0: MT PBF GID
- * byte 1: OID
- * byte 2: RFU - To be used for extended playload length
- * byte 3: Message Length */
-
-/* MT: Message Type (byte 0) */
-#define UCI_MT_MASK 0xE0
-#define UCI_MT_SHIFT 0x05
-#define UCI_MT_DATA 0x00 /* (UCI_MT_DATA << UCI_MT_SHIFT) = 0x00 */
-#define UCI_MT_CMD 0x01 /* (UCI_MT_CMD << UCI_MT_SHIFT) = 0x20 */
-#define UCI_MT_RSP 0x02 /* (UCI_MT_RSP << UCI_MT_SHIFT) = 0x40 */
-#define UCI_MT_NTF 0x03 /* (UCI_MT_NTF << UCI_MT_SHIFT) = 0x60 */
-
-#define UCI_MTS_CMD 0x20
-#define UCI_MTS_RSP 0x40
-#define UCI_MTS_NTF 0x60
-
-#define UCI_NTF_BIT 0x80 /* the tUWB_VS_EVT is a notification */
-#define UCI_RSP_BIT 0x40 /* the tUWB_VS_EVT is a response     */
-
-/* PBF: Packet Boundary Flag (byte 0) */
-#define UCI_PBF_MASK 0x10
-#define UCI_PBF_SHIFT 0x04
-#define UCI_PBF_NO_OR_LAST 0x00 /* not fragmented or last fragment */
-#define UCI_PBF_ST_CONT 0x10    /* start or continuing fragment */
-
-#define DATA_MESSAGE_SND 0x01
-
-/* GID: Group Identifier (byte 0) */
-#define UCI_GID_MASK 0x0F
-#define UCI_GID_SHIFT 0x00
-#define UCI_GID_CORE 0x00           /* 0000b UCI Core group */
-#define UCI_GID_SESSION_MANAGE 0x01 /* 0001b Session Config commands */
-#define UCI_GID_RANGE_MANAGE 0x02   /* 0010b Range Management group */
-#define UCI_GID_ANDROID 0x0C        /* 1110b Android vendor group */
-#define UCI_GID_TEST 0x0D           /* 1101b RF Test Gropup */
-
-/* Vendor specific group Identifier */
-#define UCI_GID_VENDOR_SPECIFIC_0x09 0x09
-#define UCI_GID_VENDOR_SPECIFIC_0x0A 0x0A
-#define UCI_GID_VENDOR_SPECIFIC_0x0B 0x0B
-#define UCI_GID_VENDOR_SPECIFIC_0x0C 0x0C
-#define UCI_GID_VENDOR_SPECIFIC_0x0E 0x0E
-#define UCI_GID_VENDOR_SPECIFIC_0x0F 0x0F
-
-/* OID: Opcode Identifier (byte 1) */
-#define UCI_OID_MASK 0x3F
-#define UCI_OID_SHIFT 0x00
-
-/* builds byte0 of UCI Command and Notification packet */
-#define UCI_MSG_BLD_HDR0(p, mt, gid) \
-  *(p)++ = (uint8_t)(((mt) << UCI_MT_SHIFT) | (gid));
-
-#define UCI_MSG_PBLD_HDR0(p, mt, pbf, gid) \
-  *(p)++ = (uint8_t)(((mt) << UCI_MT_SHIFT) | ((pbf) << UCI_PBF_SHIFT) | (gid));
-
-/* builds byte1 of UCI Command and Notification packet */
-#define UCI_MSG_BLD_HDR1(p, oid) *(p)++ = (uint8_t)(((oid) << UCI_OID_SHIFT));
-
-/* parse byte0 of UCI packet */
-#define UCI_MSG_PRS_HDR0(p, mt, pbf, gid)     \
-  mt = (*(p)&UCI_MT_MASK) >> UCI_MT_SHIFT;    \
-  pbf = (*(p)&UCI_PBF_MASK) >> UCI_PBF_SHIFT; \
-  gid = *(p)++ & UCI_GID_MASK;
-
-/* parse MT and PBF bits of UCI packet */
-#define UCI_MSG_PRS_MT_PBF(p, mt, pbf)     \
-  mt = (*(p)&UCI_MT_MASK) >> UCI_MT_SHIFT; \
-  pbf = (*(p)&UCI_PBF_MASK) >> UCI_PBF_SHIFT;
-
-/* parse byte1 of UCI Cmd/Ntf */
-#define UCI_MSG_PRS_HDR1(p, oid) \
-  oid = (*(p)&UCI_OID_MASK);     \
-  (p)++;
-
-/* Allocate smallest possible buffer (for platforms with limited RAM) */
-#define UCI_GET_CMD_BUF(paramlen)                                          \
-  ((UWB_HDR*)phUwb_GKI_getbuf((uint16_t)(UWB_HDR_SIZE + UCI_MSG_HDR_SIZE + \
-                                         UCI_MSG_OFFSET_SIZE + (paramlen))))
-
-/* UCI Data Format:
- * byte 0: MT(0) PBF DPF
- * byte 1: RFU
- * byte 2: Data Length
- * byte 3: Data Length */
-#define UCI_DATA_PBLD_HDR(p, pbf, len)             \
-  *(p)++ = (uint8_t)(((pbf) << UCI_PBF_SHIFT) | DATA_MESSAGE_SND);       \
-  *(p)++ = 0x00;                    \
-  *(p)++ = (uint8_t)(len);       \
-  *(p)++ = (uint8_t)(((len) >> UCI_LENGTH_SHIFT));
-
-/**********************************************
- * UCI Core Group-0: Opcodes and size of commands
- **********************************************/
-#define UCI_MSG_CORE_DEVICE_RESET 0x00
-#define UCI_MSG_CORE_DEVICE_STATUS_NTF 0x01
-#define UCI_MSG_CORE_DEVICE_INFO 0x02
-#define UCI_MSG_CORE_GET_CAPS_INFO 0x03
-#define UCI_MSG_CORE_SET_CONFIG 0x04
-#define UCI_MSG_CORE_GET_CONFIG 0x05
-#define UCI_MSG_CORE_DEVICE_SUSPEND 0x06
-#define UCI_MSG_CORE_GENERIC_ERROR_NTF 0x07
-
-#define UCI_MSG_CORE_DEVICE_RESET_CMD_SIZE 0x01
-#define UCI_MSG_CORE_DEVICE_INFO_CMD_SIZE 0x00
-#define UCI_MSG_CORE_GET_CAPS_INFO_CMD_SIZE 0x00
-
-#define UCI_MSG_DATA_CREDIT_NTF           0x0B
-#define UCI_MSG_DATA_TRANSFER_STATUS_NTF  0x0C
-
-/*********************************************************
- * UCI session config Group-2: Opcodes and size of command
- ********************************************************/
-#define UCI_MSG_SESSION_INIT 0x00
-#define UCI_MSG_SESSION_DEINIT 0x01
-#define UCI_MSG_SESSION_STATUS_NTF 0x02
-#define UCI_MSG_SESSION_SET_APP_CONFIG 0x03
-#define UCI_MSG_SESSION_GET_APP_CONFIG 0x04
-#define UCI_MSG_SESSION_GET_COUNT 0x05
-#define UCI_MSG_SESSION_GET_STATE 0x06
-#define UCI_MSG_SESSION_UPDATE_CONTROLLER_MULTICAST_LIST 0x07
-#define UCI_MSG_SESSION_UPDATE_ACTIVE_ROUNDS_OF_DT_ANCHOR 0x08
-#define UCI_MSG_SESSION_UPDATE_ACTIVE_ROUNDS_OF_DT_TAG 0x09
-#define UCI_MSG_SESSION_CONFIGURE_DT_ANCHOR_RR_RDM_LIST 0x0A
-
-/* Pay load size for each command*/
-#define UCI_MSG_SESSION_INIT_CMD_SIZE 0x05
-#define UCI_MSG_SESSION_DEINIT_CMD_SIZE 0x04
-#define UCI_MSG_SESSION_STATUS_NTF_LEN 0x06
-#define UCI_MSG_SESSION_GET_COUNT_CMD_SIZE 0x00
-#define UCI_MSG_SESSION_GET_STATE_SIZE 0x04
-
-/*********************************************************
- * UWB Ranging Control Group-3: Opcodes and size of command
- *********************************************************/
-#define UCI_MSG_RANGE_START 0x00
-#define UCI_MSG_RANGE_STOP 0x01
-#define UCI_MSG_RANGE_GET_RANGING_COUNT 0x03
-#define UCI_MSG_RANGE_BLINK_DATA_TX 0x04
-
-#define UCI_MSG_RANGE_DATA_NTF 0x00
-#define UCI_MSG_RANGE_BLINK_DATA_TX_NTF 0x04
-
-#define UCI_MSG_RANGE_START_CMD_SIZE 0x04
-#define UCI_MSG_RANGE_STOP_CMD_SIZE 0x04
-#define UCI_MSG_RANGE_GET_COUNT_CMD_SIZE 0x04
-
-/**********************************************
- * UCI Android Vendor Group-E: Opcodes and size of commands
- **********************************************/
-#define UCI_MSG_ANDROID_GET_POWER_STATS 0x00
-#define UCI_MSG_ANDROID_SET_COUNTRY_CODE 0x01
-
-#define UCI_MSG_ANDROID_SET_COUNTRY_CODE_CMD_SIZE COUNTRY_CODE_ARRAY_LEN
-
-/**********************************************
- * UCI Parameter IDs : Device Configurations
- **********************************************/
-#define UCI_PARAM_ID_DEVICE_STATE 0x00
-#define UCI_PARAM_ID_LOW_POWER_MODE 0x01
-
-/* UCI Parameter ID Length */
-#define UCI_PARAM_LEN_DEVICE_STATE 0x01
-#define UCI_PARAM_LEN_LOW_POWER_MODE 0x01
-
-/*************************************************
- * UCI Parameter IDs : Application Configurations
- ************************************************/
-#define UCI_PARAM_ID_DEVICE_TYPE 0x00
-#define UCI_PARAM_ID_RANGING_ROUND_USAGE 0x01
-#define UCI_PARAM_ID_STS_CONFIG 0x02
-#define UCI_PARAM_ID_MULTI_NODE_MODE 0x03
-#define UCI_PARAM_ID_CHANNEL_NUMBER 0x04
-#define UCI_PARAM_ID_NO_OF_CONTROLEE 0x05
-#define UCI_PARAM_ID_DEVICE_MAC_ADDRESS 0x06
-#define UCI_PARAM_ID_DST_MAC_ADDRESS 0x07
-#define UCI_PARAM_ID_SLOT_DURATION 0x08
-#define UCI_PARAM_ID_RANGING_INTERVAL 0x09
-#define UCI_PARAM_ID_STS_INDEX 0x0A
-#define UCI_PARAM_ID_MAC_FCS_TYPE 0x0B
-#define UCI_PARAM_ID_RANGING_ROUND_CONTROL 0x0C
-#define UCI_PARAM_ID_AOA_RESULT_REQ 0x0D
-#define UCI_PARAM_ID_RNG_DATA_NTF 0x0E
-#define UCI_PARAM_ID_RNG_DATA_NTF_PROXIMITY_NEAR 0x0F
-#define UCI_PARAM_ID_RNG_DATA_NTF_PROXIMITY_FAR 0x10
-#define UCI_PARAM_ID_DEVICE_ROLE 0x11
-#define UCI_PARAM_ID_RFRAME_CONFIG 0x12
-#define UCI_PARAM_ID_PREAMBLE_CODE_INDEX 0x14
-#define UCI_PARAM_ID_SFD_ID 0x15
-#define UCI_PARAM_ID_PSDU_DATA_RATE 0x16
-#define UCI_PARAM_ID_PREAMBLE_DURATION 0x17
-#define UCI_PARAM_ID_RANGING_TIME_STRUCT 0x1A
-#define UCI_PARAM_ID_SLOTS_PER_RR 0x1B
-#define UCI_PARAM_ID_TX_ADAPTIVE_PAYLOAD_POWER 0x1C
-#define UCI_PARAM_ID_RESPONDER_SLOT_INDEX 0x1E
-#define UCI_PARAM_ID_PRF_MODE 0x1F
-#define UCI_PARAM_ID_CAP_SIZE_RANGE 0x20
-#define UCI_PARAM_ID_SCHEDULED_MODE 0x22
-#define UCI_PARAM_ID_KEY_ROTATION 0x23
-#define UCI_PARAM_ID_KEY_ROTATION_RATE 0x24
-#define UCI_PARAM_ID_SESSION_PRIORITY 0x25
-#define UCI_PARAM_ID_MAC_ADDRESS_MODE 0x26
-#define UCI_PARAM_ID_VENDOR_ID 0x27
-#define UCI_PARAM_ID_STATIC_STS_IV 0x28
-#define UCI_PARAM_ID_NUMBER_OF_STS_SEGMENTS 0x29
-#define UCI_PARAM_ID_MAX_RR_RETRY 0x2A
-#define UCI_PARAM_ID_UWB_INITIATION_TIME 0x2B
-#define UCI_PARAM_ID_HOPPING_MODE 0x2C
-#define UCI_PARAM_ID_BLOCK_STRIDE_LENGTH 0x2D
-#define UCI_PARAM_ID_RESULT_REPORT_CONFIG 0x2E
-#define UCI_PARAM_ID_IN_BAND_TERMINATION_ATTEMPT_COUNT 0x2F
-#define UCI_PARAM_ID_SUB_SESSION_ID 0x30
-#define UCI_PARAM_ID_BPRF_PHR_DATA_RATE 0x31
-#define UCI_PARAM_ID_MAX_NUMBER_OF_MEASUREMENTS 0x32
-#define UCI_PARAM_ID_UL_TDOA_TX_INTERVAL 0x33
-#define UCI_PARAM_ID_UL_TDOA_RANDOM_WINDOW 0x34
-#define UCI_PARAM_ID_UL_TDOA_DEVICE_ID 0x38
-#define UCI_PARAM_ID_UL_TDOA_TX_TIMESTAMP 0x39
-
-/* UCI Parameter ID Length */
-#define UCI_PARAM_LEN_DEVICE_ROLE 0x01
-#define UCI_PARAM_LEN_RANGING_ROUND_USAGE 0x01
-#define UCI_PARAM_LEN_STS_CONFIG 0x01
-#define UCI_PARAM_LEN_MULTI_NODE_MODE 0x01
-#define UCI_PARAM_LEN_CHANNEL_NUMBER 0x01
-#define UCI_PARAM_LEN_NO_OF_CONTROLEE 0x01
-#define UCI_PARAM_LEN_DEVICE_MAC_ADDRESS 0x02
-#define UCI_PARAM_LEN_DEST_MAC_ADDRESS 0x02
-#define UCI_PARAM_LEN_SLOT_DURATION 0x02
-#define UCI_PARAM_LEN_RANGING_INTERVAL 0x02
-#define UCI_PARAM_LEN_STS_INDEX 0x01
-#define UCI_PARAM_LEN_MAC_FCS_TYPE 0x01
-#define UCI_PARAM_LEN_RANGING_ROUND_CONTROL 0x01
-#define UCI_PARAM_LEN_AOA_RESULT_REQ 0x01
-#define UCI_PARAM_LEN_RNG_DATA_NTF 0x01
-#define UCI_PARAM_LEN_RNG_DATA_NTF_PROXIMITY_NEAR 0x02
-#define UCI_PARAM_LEN_RNG_DATA_NTF_PROXIMITY_FAR 0x02
-#define UCI_PARAM_LEN_DEVICE_TYPE 0x01
-#define UCI_PARAM_LEN_RFRAME_CONFIG 0x01
-#define UCI_PARAM_LEN_RX_MODE 0x01
-#define UCI_PARAM_LEN_PREAMBLE_CODE_INDEX 0x01
-#define UCI_PARAM_LEN_SFD_ID 0x01
-#define UCI_PARAM_LEN_PSDU_DATA_RATE 0x01
-#define UCI_PARAM_LEN_PREAMPLE_DURATION 0x01
-#define UCI_PARAM_LEN_ANTENA_PAIR_SELECTION 0x01
-#define UCI_PARAM_LEN_MAC_CFG 0x01
-#define UCI_PARAM_LEN_RANGING_TIME_STRUCT 0x01
-#define UCI_PARAM_LEN_SLOTS_PER_RR 0x01
-#define UCI_PARAM_LEN_TX_POWER_ID 0x01
-#define UCI_PARAM_LEN_TX_ADAPTIVE_PAYLOAD_POWER 0x01
-#define UCI_PARAM_LEN_VENDOR_ID 0x02
-#define UCI_PARAM_LEN_STATIC_STS_IV 0x06
-#define UCI_PARAM_LEN_NUMBER_OF_STS_SEGMENTS 0x01
-#define UCI_PARAM_LEN_MAX_RR_RETRY 0x02
-#define UCI_PARAM_LEN_UWB_INITIATION_TIME 0x04
-#define UCI_PARAM_LEN_HOPPING_MODE 0x01
-#define UCI_PARAM_LEN_RESULT_REPORT_CONFIG 0x01
-#define UCI_PARAM_LEN_IN_BAND_TERMINATION_ATTEMPT_COUNT 0x01
-#define UCI_PARAM_LEN_SUB_SESSION_ID 0x04
-#define UCI_PARAM_LEN_BLOCK_STRIDE_LENGTH 0x01
-#define UCI_PARAM_LEN_UL_TDOA_TX_INTERVAL 0x04
-#define UCI_PARAM_LEN_UL_TDOA_RANDOM_WINDOW 0x04
-#define UCI_PARAM_LEN_UL_TDOA_DEVICE_ID 0x09
-#define UCI_PARAM_LEN_UL_TDOA_TX_TIMESTAMP 0x01
-
-#define MAX_VENDOR_INFO_LENGTH   1000 // vendor specific info of rangedata max length considering 24 measures for TDOA
-
-/*************************************************
- * Status codes
- ************************************************/
-/* Generic Status Codes */
-#define UCI_STATUS_OK 0x00
-#define UCI_STATUS_REJECTED 0x01
-#define UCI_STATUS_FAILED 0x02
-#define UCI_STATUS_SYNTAX_ERROR 0x03
-#define UCI_STATUS_INVALID_PARAM 0x04
-#define UCI_STATUS_INVALID_RANGE 0x05
-#define UCI_STATUS_INVALID_MSG_SIZE 0x06
-#define UCI_STATUS_UNKNOWN_GID 0x07
-#define UCI_STATUS_UNKNOWN_OID 0x08
-#define UCI_STATUS_READ_ONLY 0x09
-#define UCI_STATUS_COMMAND_RETRY 0x0A
-
-/* UWB Session Specific Status Codes*/
-#define UCI_STATUS_SESSSION_NOT_EXIST 0x11
-#define UCI_STATUS_SESSSION_DUPLICATE 0x12
-#define UCI_STATUS_SESSSION_ACTIVE 0x13
-#define UCI_STATUS_MAX_SESSSIONS_EXCEEDED 0x14
-#define UCI_STATUS_SESSION_NOT_CONFIGURED 0x15
-
-/* UWB Ranging Session Specific Status Codes */
-#define UCI_STATUS_RANGING_TX_FAILED 0x20
-#define UCI_STATUS_RANGING_RX_TIMEOUT 0x21
-#define UCI_STATUS_RANGING_RX_PHY_DEC_FAILED 0x22
-#define UCI_STATUS_RANGING_RX_PHY_TOA_FAILED 0x23
-#define UCI_STATUS_RANGING_RX_PHY_STS_FAILED 0x24
-#define UCI_STATUS_RANGING_RX_MAC_DEC_FAILED 0x25
-#define UCI_STATUS_RANGING_RX_MAC_IE_DEC_FAILED 0x26
-#define UCI_STATUS_RANGING_RX_MAC_IE_MISSING 0x27
-#define STS_LENGTH 0x35
-#define RSSI_REPORTING 0x36
-
-/* UWB Data Session Specific Status Codes */
-#define UCI_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED 0x30
-#define UCI_STATUS_DATA_RX_CRC_ERROR 0x31
-
-/*************************************************
- * Device Role config
- **************************************************/
-#define UWB_CONTROLLER 0x00
-#define UWB_CONTROLEE 0x01
-
-/*************************************************
- * Ranging Method config
- **************************************************/
-#define ONE_WAY_RANGING 0x00
-#define SS_TWR_RANGING 0x01
-#define DS_TWR_RANGING 0x02
-
-/*************************************************
- * Ranging Mesaurement type
- **************************************************/
-#define MEASUREMENT_TYPE_ULTDOA 0x00
-#define MEASUREMENT_TYPE_TWOWAY 0x01
-#define MEASUREMENT_TYPE_DLTDOA 0x02
-#define MEASUREMENT_TYPE_OWR_WITH_AOA 0x03
-
-#define EXTENDED_ADDRESS_LEN       0x08
-#define EXTENDED_PARAM_ID_MASK     0xF0
-
-/* Maximum size of UCI DATA Message the UWBS can receive */
-#define MAX_DATA_MSG_SIZE                   0x00
-#define MAX_DATA_PKT_PAYLOAD_SIZE           0x01
-
-
-/* Maximum Length of RrRdmList*/
-#define MAX_RRRDM_LIST_LENGTH               0XFF
-
-/*************************************************
- * Mac Addressing Mode Indicator
- **************************************************/
-#define SHORT_MAC_ADDRESS 0x00
-#define EXTENDED_MAC_ADDRESS 0x01
-#define EXTENDED_MAC_ADDRESS_AND_HEADER 0x02
-
-#define SESSION_ID_LEN 0x04
-#define SHORT_ADDRESS_LEN 0x02
-#define EXTENDED_ADDRESS_LEN 0x08
-#define MAX_NUM_OF_TDOA_MEASURES 24
-#define MAX_NUM_OF_DLTDOA_MEASURES 10
-#define MAX_NUM_OWR_AOA_MEASURES   1
-#define UCI_MAX_DATA_SIZE 4196
-
-#define MAX_NUM_RESPONDERS \
-  12  // max number of responders for contention based raning
-#define MAX_NUM_CONTROLLEES \
-  8  // max bumber of controlees for  time schedules rangng ( multicast)
-#define COUNTRY_CODE_ARRAY_LEN 2
-
-/* device status */
-typedef enum {
-  UWBS_STATUS_READY = 0x01,   /* UWBS is ready for  performing uwb session with
-                                 non SE use cases */
-  UWBS_STATUS_ACTIVE,         /* UWBS is busy running uwb session */
-  UWBS_STATUS_TIMEOUT = 0xFE, /* To notify timeout to UWB service layer */
-  UWBS_STATUS_ERROR = 0xFF    /* error occured in UWBS*/
-} eUWBS_DEVICE_STATUS_t;
-
-/* Session status */
-typedef enum {
-  UWB_SESSION_INITIALIZED,
-  UWB_SESSION_DEINITIALIZED,
-  UWB_SESSION_ACTIVE,
-  UWB_SESSION_IDLE,
-  UWB_UNKNOWN_SESSION = 0xFF
-} eSESSION_STATUS_t;
-
-/* Session status idle reason code */
-typedef enum {
-  UWB_SESSION_STATE_CHANGED = 0x00,
-  UWB_SESSION_MAX_RR_RETRY_COUNT_REACHED = 0x01,
-  UWB_SESSION_MAX_RANGING_MEASUREMENTS_REACHED = 0x02,
-  UWB_SESSION_SLOT_LENTGH_NOT_SUPPORTED = 0x20,
-  UWB_SESSION_SLOTS_PER_RR_NOT_SUFFICIENT = 0x21,
-  UWB_SESSION_MAC_ADDRESS_MODE_NOT_SUPPORTED = 0x22,
-  UWB_SESSION_INVALID_RANGING_INTERVAL = 0x23,
-  UWB_SESSION_INVALID_STS_CONFIG = 0x24,
-  UWB_SESSION_INVALID_RFRAME_CONFIG = 0x25
-} eSESSION_STATUS_REASON_CODES_t;
-
-#endif /* UWB_UCI_DEFS_H */
diff --git a/src/uci/include/uci_test_defs.h b/src/uci/include/uci_test_defs.h
deleted file mode 100755
index 3b1b70d..0000000
--- a/src/uci/include/uci_test_defs.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021 NXP.
- *
- * 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.
- */
-
-/******************************************************************************
- *
- *  This file contains the definition from UCI specification
- *
- ******************************************************************************/
-
-#ifndef UWB_UCI_TEST_DEFS_H
-#define UWB_UCI_TEST_DEFS_H
-
-#include <stdint.h>
-
-/* GID: Group Identifier (byte 0) */
-
-#define UCI_GID_TEST 0x0D /* 1101b UCI Test group */
-
-/**********************************************
- * UCI test group(UCI_GID_TEST)- 7: Opcodes
- **********************************************/
-#define UCI_MSG_TEST_SET_CONFIG 0
-#define UCI_MSG_TEST_GET_CONFIG 1
-#define UCI_MSG_TEST_PERIODIC_TX 2
-#define UCI_MSG_TEST_PER_RX 3
-#define UCI_MSG_TEST_TX 4
-#define UCI_MSG_TEST_RX 5
-#define UCI_MSG_TEST_LOOPBACK 6
-#define UCI_MSG_TEST_STOP_SESSION 7
-
-#define UCI_MSG_TEST_PERIODIC_TX_CMD_SIZE 0
-#define UCI_MSG_TEST_PER_RX_CMD_SIZE 0
-#define UCI_MSG_TEST_STOP_SESSION_CMD_SIZE 0
-#define UCI_MSG_TEST_RX_CMD_SIZE 0
-
-/**********************************************************
- * UCI test Parameter IDs : RF Test Configurations
- *********************************************************/
-#define UCI_TEST_PARAM_ID_NUM_PACKETS 0x00
-#define UCI_TEST_PARAM_ID_T_GAP 0x01
-#define UCI_TEST_PARAM_ID_T_START 0x02
-#define UCI_TEST_PARAM_ID_T_WIN 0x03
-#define UCI_TEST_PARAM_ID_RANDOMIZE_PSDU 0x04
-#define UCI_TEST_PARAM_ID_PHR_RANGING_BIT 0x05
-#define UCI_TEST_PARAM_ID_RMARKER_TX_START 0x06
-#define UCI_TEST_PARAM_ID_RMARKER_RX_START 0x07
-#define UCI_TEST_PARAM_ID_STS_INDEX_AUTO_INCR 0x08
-
-#endif
\ No newline at end of file
diff --git a/src/uwa/dm/uwa_dm_act.cc b/src/uwa/dm/uwa_dm_act.cc
deleted file mode 100755
index e1d13f9..0000000
--- a/src/uwa/dm/uwa_dm_act.cc
+++ /dev/null
@@ -1,1551 +0,0 @@
-
-/******************************************************************************
- *
- *  Copyright (C) 1999-2014 Broadcom Corporation
- *  Copyright 2018-2022 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  This file contains the action functions for device manager state
- *  machine.
- *
- ******************************************************************************/
-#include <string.h>
-
-#include "uci_hmsgs.h"
-#include "uci_log.h"
-#include "uwa_api.h"
-#include "uwa_dm_int.h"
-#include "uwa_sys.h"
-#include "uwa_sys_int.h"
-#include "uwb_api.h"
-#include "uwb_osal_common.h"
-
-static void uwa_dm_set_init_uci_params(void);
-
-/*******************************************************************************
-**
-** Function         uwa_dm_sys_enable
-**
-** Description      This function on enable
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_dm_sys_enable(void) { uwa_dm_set_init_uci_params(); }
-
-/*******************************************************************************
-**
-** Function         uwa_dm_set_init_uci_params
-**
-** Description      Set initial UCI configuration parameters
-**
-** Returns          void
-**
-*******************************************************************************/
-static void uwa_dm_set_init_uci_params(void) { return; }
-
-/*******************************************************************************
-**
-** Function         uwa_dm_disable_event
-**
-** Description      report disable event
-**
-** Returns          void
-**
-*******************************************************************************/
-static void uwa_dm_disable_event(void) {
-  /* Deregister DM from sys */
-  uwa_sys_deregister(UWA_ID_DM);
-
-  /* Notify app */
-  if (uwa_dm_cb.p_dm_cback != NULL) {
-    uwa_dm_cb.flags &= (uint32_t)(~UWA_DM_FLAGS_DM_IS_ACTIVE);
-    (*uwa_dm_cb.p_dm_cback)(UWA_DM_DISABLE_EVT, NULL);
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_uwb_response_cback
-**
-** Description      Call DM event hanlder with UWB response callback data
-**
-** Returns          void
-**
-*******************************************************************************/
-static void uwa_dm_uwb_response_cback(tUWB_RESPONSE_EVT event,
-                                      tUWB_RESPONSE* p_data) {
-  tUWA_DM_CBACK_DATA dm_cback_data;
-
-  UCI_TRACE_I("uwa_dm_uwb_response_cback:%s(0x%x)",
-              uwa_dm_uwb_revt_2_str(event).c_str(), event);
-  switch (event) {
-    case UWB_ENABLE_REVT: /* 0  Enable event */
-      /* UWB stack enabled. Enable uwa sub-systems */
-      /* Notify app */
-      uwa_dm_cb.flags &= UWA_DM_FLAGS_DM_IS_ACTIVE;
-      dm_cback_data.status = p_data->enable.status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_ENABLE_EVT, &dm_cback_data);
-      break;
-
-    case UWB_DISABLE_REVT: /* 1  Disable event */
-      uwa_dm_disable_event();
-      break;
-
-    case UWB_DEVICE_STATUS_REVT: /* device status notification */
-      dm_cback_data.dev_status.status = p_data->sDevice_status.status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_DEVICE_STATUS_NTF_EVT, &dm_cback_data);
-      break;
-
-    case UWB_GET_DEVICE_INFO_REVT: {
-      if (p_data->sGet_device_info.status == UWB_STATUS_OK) {
-        dm_cback_data.sGet_device_info.status = UWA_STATUS_OK;
-        dm_cback_data.sGet_device_info.uci_version =
-            p_data->sGet_device_info.uci_version;
-        dm_cback_data.sGet_device_info.mac_version =
-            p_data->sGet_device_info.mac_version;
-        dm_cback_data.sGet_device_info.phy_version =
-            p_data->sGet_device_info.phy_version;
-        dm_cback_data.sGet_device_info.uciTest_version =
-            p_data->sGet_device_info.uciTest_version;
-        dm_cback_data.sGet_device_info.vendor_info_len =
-            p_data->sGet_device_info.vendor_info_len;
-        memcpy(dm_cback_data.sGet_device_info.vendor_info,
-               p_data->sGet_device_info.vendor_info,
-               p_data->sGet_device_info.vendor_info_len);
-      } else {
-        dm_cback_data.sGet_device_info.status = UWA_STATUS_FAILED;
-      }
-
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_CORE_GET_DEVICE_INFO_RSP_EVT,
-                              &dm_cback_data);
-    } break;
-
-    case UWB_SET_CORE_CONFIG_REVT: /* 2  Set Config Response */
-      dm_cback_data.sCore_set_config.status = p_data->sCore_set_config.status;
-      dm_cback_data.sCore_set_config.num_param_id =
-          p_data->sCore_set_config.num_param_id;
-      dm_cback_data.sCore_set_config.tlv_size =
-          p_data->sCore_set_config.tlv_size;
-      if (dm_cback_data.sCore_set_config.tlv_size > 0) {
-        memcpy(dm_cback_data.sCore_set_config.param_ids,
-               p_data->sCore_set_config.param_ids,
-               p_data->sCore_set_config.tlv_size);
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_CORE_SET_CONFIG_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_GET_CORE_CONFIG_REVT: /* 3  Get Config Response */
-      dm_cback_data.sCore_get_config.status = p_data->sCore_get_config.status;
-      dm_cback_data.sCore_get_config.no_of_ids =
-          p_data->sCore_get_config.no_of_ids;
-      dm_cback_data.sCore_get_config.tlv_size =
-          p_data->sCore_get_config.tlv_size;
-      if (dm_cback_data.sCore_get_config.tlv_size > 0) {
-        memcpy(dm_cback_data.sCore_get_config.param_tlvs,
-               p_data->sCore_get_config.p_param_tlvs,
-               p_data->sCore_get_config.tlv_size);
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_CORE_GET_CONFIG_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_DEVICE_RESET_REVT: /* Device Reset Response */
-      if (p_data->sDevice_reset.status == UWB_STATUS_OK) {
-        dm_cback_data.sDevice_reset.status = p_data->sDevice_reset.status;
-      } else {
-        dm_cback_data.sDevice_reset.status = UWA_STATUS_FAILED;
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_DEVICE_RESET_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_CORE_GEN_ERR_STATUS_REVT: /* Generic error notification */
-    {
-      dm_cback_data.sCore_gen_err_status.status =
-          p_data->sCore_gen_err_status.status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_CORE_GEN_ERR_STATUS_EVT, &dm_cback_data);
-    } break;
-
-    case UWB_SESSION_INIT_REVT: /* Session init response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E(" Session Init request is failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_INIT_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_SESSION_DEINIT_REVT: /* session de-init response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E(" Session De Init request is failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_DEINIT_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_SESSION_STATUS_NTF_REVT: /* session status notification */
-    {
-      tUWA_SESSION_STATUS_NTF_REVT* p_session_ntf =
-          &dm_cback_data.sSessionStatus;
-      p_session_ntf->session_id = p_data->sSessionStatus.session_id;
-      p_session_ntf->state = p_data->sSessionStatus.state;
-      p_session_ntf->reason_code = p_data->sSessionStatus.reason_code;
-      if (UWB_SESSION_INITIALIZED == p_session_ntf->state) {
-        // Trigger session initialization HAL API.
-        tUWB_STATUS status;
-        status = UWB_HalSessionInit(dm_cback_data.sSessionStatus.session_id);
-        if (UWB_STATUS_OK == status) {
-          UCI_TRACE_I("HAL session init: success ,status=0x%X", status);
-        } else {
-          UCI_TRACE_E("HAL session init: status=0x%X. Deinitializing session", status);
-          p_session_ntf->state = UWB_SESSION_DEINITIALIZED;
-        }
-      }
-    }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_STATUS_NTF_EVT, &dm_cback_data);
-      break;
-
-    case UWB_SESSION_GET_COUNT_REVT: /* get session count response */
-      if (p_data->status == UWB_STATUS_OK) {
-        tUWA_SESSION_GET_COUNT* p_sGet_session_cnt =
-            &dm_cback_data.sGet_session_cnt;
-        p_sGet_session_cnt->status = p_data->sGet_session_cnt.status;
-        p_sGet_session_cnt->count = p_data->sGet_session_cnt.count;
-
-      } else {
-        UCI_TRACE_E("Get session count command failed");
-        dm_cback_data.status = UWA_STATUS_FAILED;
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_GET_COUNT_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_SESSION_GET_STATE_REVT: /*get session state response */
-      if (p_data->sGet_session_state.status == UWB_STATUS_OK) {
-        tUWA_SESSION_GET_STATE* p_sGet_session_state =
-            &dm_cback_data.sGet_session_state;
-        p_sGet_session_state->status = p_data->sGet_session_state.status;
-        p_sGet_session_state->session_state =
-            p_data->sGet_session_state.session_state;
-
-      } else {
-        UCI_TRACE_E("Get session state command failed");
-        dm_cback_data.status = UWA_STATUS_FAILED;
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_GET_STATE_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_SET_APP_CONFIG_REVT: /*set session app config response */
-      dm_cback_data.sApp_set_config.status = p_data->sApp_set_config.status;
-      dm_cback_data.sApp_set_config.num_param_id =
-          p_data->sApp_set_config.num_param_id;
-      dm_cback_data.sApp_set_config.tlv_size = p_data->sApp_set_config.tlv_size;
-      if (dm_cback_data.sApp_set_config.tlv_size > 0) {
-        memcpy(dm_cback_data.sApp_set_config.param_ids,
-               p_data->sApp_set_config.param_ids,
-               p_data->sApp_set_config.tlv_size);
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_SET_CONFIG_RSP_EVT,
-                              &dm_cback_data);
-      break;
-
-    case UWB_GET_APP_CONFIG_REVT: /*get session app config response */
-      dm_cback_data.sApp_get_config.status = p_data->sApp_get_config.status;
-      dm_cback_data.sApp_get_config.no_of_ids =
-          p_data->sApp_get_config.no_of_ids;
-      dm_cback_data.sApp_get_config.tlv_size = p_data->sApp_get_config.tlv_size;
-      if (dm_cback_data.sApp_get_config.tlv_size > 0) {
-        memcpy(dm_cback_data.sApp_get_config.param_tlvs,
-               p_data->sApp_get_config.p_param_tlvs,
-               p_data->sApp_get_config.tlv_size);
-      }
-      /* Return result of getAppConfig to the app */
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_GET_CONFIG_RSP_EVT,
-                              &dm_cback_data);
-      break;
-
-    case UWB_START_RANGE_REVT: /* range start response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E("Range start command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_RANGE_START_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_STOP_RANGE_REVT: /* range start response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E("Range stop command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_RANGE_STOP_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_RANGE_DATA_REVT: /* range data notification */
-    {
-      tUWA_RANGE_DATA_NTF* p_sRange_data = &dm_cback_data.sRange_data;
-      memset(p_sRange_data, 0, sizeof(tUWA_RANGE_DATA_NTF));
-      if (p_data->sRange_data.range_data_len != 0) {
-        memcpy((uint8_t*)p_sRange_data, (uint8_t*)&p_data->sRange_data,
-               sizeof(tUWA_RANGE_DATA_NTF));
-        (*uwa_dm_cb.p_dm_cback)(UWA_DM_RANGE_DATA_NTF_EVT, &dm_cback_data);
-      }
-    } break;
-
-    case UWB_GET_RANGE_COUNT_REVT: /* get ranging round count response */
-      if (p_data->status == UWB_STATUS_OK) {
-        tUWA_RANGE_GET_RNG_COUNT_REVT* p_sGet_range_cnt =
-            &dm_cback_data.sGet_range_cnt;
-        p_sGet_range_cnt->status = p_data->sGet_range_cnt.status;
-        p_sGet_range_cnt->count = p_data->sGet_range_cnt.count;
-      } else {
-        UCI_TRACE_E("Get range count command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_GET_RANGE_COUNT_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_CORE_GET_DEVICE_CAPABILITY_REVT: /* Core Get device capability
-                                                 Response */
-    {
-      dm_cback_data.sGet_device_capability.status =
-          p_data->sGet_device_capability.status;
-      dm_cback_data.sGet_device_capability.no_of_tlvs =
-          p_data->sGet_device_capability.no_of_tlvs;
-      dm_cback_data.sGet_device_capability.tlv_buffer_len =
-          p_data->sGet_device_capability.tlv_buffer_len;
-      if (dm_cback_data.sGet_device_capability.tlv_buffer_len > 0) {
-        memcpy(dm_cback_data.sGet_device_capability.tlv_buffer,
-               p_data->sGet_device_capability.tlv_buffer,
-               p_data->sGet_device_capability.tlv_buffer_len);
-      }
-      /* Return result of core get device capability to the app */
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_GET_CORE_DEVICE_CAP_RSP_EVT,
-                              &dm_cback_data);
-    } break;
-
-    case UWB_SESSION_UPDATE_MULTICAST_LIST_REVT: /* multi-cast list update
-                                                    response*/
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E(" Session update multicast list request is failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_MC_LIST_UPDATE_RSP_EVT,
-                              &dm_cback_data);
-      break;
-
-    case UWB_SESSION_UPDATE_MULTICAST_LIST_NTF_REVT: /* session update multicast
-                                                        list data notification
-                                                      */
-    {
-      tUWA_SESSION_UPDATE_MULTICAST_LIST_NTF* p_sMulticast_list_ntf =
-          &dm_cback_data.sMulticast_list_ntf;
-      memset(p_sMulticast_list_ntf, 0,
-             sizeof(tUWA_SESSION_UPDATE_MULTICAST_LIST_NTF));
-      memcpy((uint8_t*)p_sMulticast_list_ntf,
-             (uint8_t*)&p_data->sMulticast_list_ntf,
-             sizeof(tUWA_SESSION_UPDATE_MULTICAST_LIST_NTF));
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_MC_LIST_UPDATE_NTF_EVT,
-                              &dm_cback_data);
-    } break;
-
-    case UWB_SESSION_ACTIVE_ROUNDS_INDEX_UPDATE_REVT:
-      {
-        dm_cback_data.status = p_data->status;
-        tUWA_UPDATE_RANGE_ROUND_INDEX_REVT* p_resp_data = &dm_cback_data.sRange_round_index;
-        p_resp_data->status = p_data->sRange_round_index.status;
-        p_resp_data->len = p_data->sRange_round_index.len;
-        if(p_resp_data->len > 0){
-          memcpy(p_resp_data->rng_round_index, p_data->sRange_round_index.rng_round_index, p_data->sRange_round_index.len);
-        }
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_ACTIVE_ROUNDS_INDEX_UPDATE_REVT, &dm_cback_data);
-      break;
-
-    case UWB_SESSION_CONFIGURE_DT_ANCHOR_RR_RDM_REVT:
-      {
-        dm_cback_data.status = p_data->status;
-        tUWA_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_REVT* p_resp_data = &dm_cback_data.sConfigure_dt_anchor_rr_rdm_list;
-        p_resp_data->status = p_data->sConfigure_dt_anchor_rr_rdm_list.status;
-        p_resp_data->len = p_data->sConfigure_dt_anchor_rr_rdm_list.len;
-        if(p_resp_data->len > 0){
-          memcpy(p_resp_data->rng_round_indexs, p_data->sConfigure_dt_anchor_rr_rdm_list.rng_round_indexs, p_data->sConfigure_dt_anchor_rr_rdm_list.len);
-        }
-      }
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SESSION_CONFIGURE_DT_ANCHOR_RR_RDM_REVT, &dm_cback_data);
-      break;
-
-    case UWB_SET_COUNTRY_CODE_REVT: /* set country code response*/
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E(" Set country code request failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SET_COUNTRY_CODE_RSP_EVT,
-                              &dm_cback_data);
-      break;
-
-    case UWB_BLINK_DATA_TX_REVT: /* blink data send response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E(" Blink data tx request is failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SEND_BLINK_DATA_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_BLINK_DATA_TX_NTF_REVT: /* blink data tx notification */
-    {
-      tUWA_SEND_BLINK_DATA_NTF* p_sBlink_data_ntf =
-          &dm_cback_data.sBlink_data_ntf;
-      p_sBlink_data_ntf->repetition_count_status =
-          p_data->sSend_blink_data_ntf.repetition_count_status;
-
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SEND_BLINK_DATA_NTF_EVT, &dm_cback_data);
-    } break;
-
-    case UWB_SEND_DATA_STATUS_EVT:
-    {
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_SEND_DATA_STATUS_EVT, &dm_cback_data);
-    }
-    break;
-
-    case UWB_DATA_TRANSFER_STATUS_NTF_REVT:
-    {
-      tUWA_DATA_TRANSFER_STATUS_NTF_REVT* p_data_transmit = &dm_cback_data.sData_xfer_status;
-      p_data_transmit->session_id = p_data->sData_xfer_status.session_id;
-      p_data_transmit->sequence_num =  p_data->sData_xfer_status.sequence_num;
-      p_data_transmit->status = p_data->sData_xfer_status.status;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_DATA_TRANSFER_STATUS_NTF_EVT, &dm_cback_data);
-    }
-    break;
-
-    case UWB_DATA_RECV_REVT:
-    {
-       tUWA_RX_DATA_REVT* p_rcv_data = &dm_cback_data.sRcvd_data;
-       memset(p_rcv_data, 0, sizeof(tUWA_RX_DATA_REVT));
-       memcpy((uint8_t*)p_rcv_data, (uint8_t*)&p_data->sRcvd_data, sizeof(tUWA_RX_DATA_REVT));
-       (*uwa_dm_cb.p_dm_cback)(UWA_DM_DATA_RECV_EVT, &dm_cback_data);
-    }
-    break;
-
-    case UWB_CONFORMANCE_TEST_DATA: /* conformance test notification */
-    {
-      tUWA_CONFORMANCE_TEST_DATA* p_sConformance_data_ntf =
-          &dm_cback_data.sConformance_ntf;
-      p_sConformance_data_ntf->length = p_data->sConformance_test_data.length;
-      memcpy((uint8_t*)p_sConformance_data_ntf->data,
-             (uint8_t*)p_data->sConformance_test_data.data,
-             p_data->sConformance_test_data.length);
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_CONFORMANCE_NTF_EVT, &dm_cback_data);
-    } break;
-    case UWB_UWBS_RESP_TIMEOUT_REVT: /* event to notify response timeout */
-    {
-      dm_cback_data.status = UWB_STATUS_FAILED;
-      (*uwa_dm_cb.p_dm_cback)(UWA_DM_UWBS_RESP_TIMEOUT_EVT, &dm_cback_data);
-    } break;
-    case UWB_VENDOR_SPECIFIC_UCI_NTF_EVT:
-    {
-      dm_cback_data.vendor_specific_ntf.len = p_data->vendor_specific_ntf.len;
-      memcpy((uint8_t*)dm_cback_data.vendor_specific_ntf.data, p_data->vendor_specific_ntf.data, p_data->vendor_specific_ntf.len);
-      (*uwa_dm_cb.p_dm_cback)(UWA_VENDOR_SPECIFIC_UCI_NTF_EVT, &dm_cback_data);
-    } break;
-    default:
-      UCI_TRACE_E("unknown event.");
-      break;
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_uwb_test_response_cback
-**
-** Description      callback handles all RF test responses and notifications
-**
-** Returns          void
-**
-*******************************************************************************/
-static void uwa_dm_uwb_test_response_cback(tUWB_TEST_RESPONSE_EVT event,
-                                           tUWB_TEST_RESPONSE* p_data) {
-  tUWA_DM_TEST_CBACK_DATA dm_cback_data;
-
-  UCI_TRACE_I("uwa_dm_uwb_test_response_cback:%s(0x%x)",
-              uwa_test_dm_uwb_revt_2_str(event).c_str(), event);
-  switch (event) {
-    case UWB_TEST_SET_CONFIG_REVT: /* set test configs response */
-      dm_cback_data.sTest_set_config.status = p_data->sTest_set_config.status;
-      dm_cback_data.sTest_set_config.num_param_id =
-          p_data->sTest_set_config.num_param_id;
-      dm_cback_data.sTest_set_config.tlv_size =
-          p_data->sTest_set_config.tlv_size;
-      if (p_data->sTest_set_config.tlv_size > 0) {
-        memcpy(dm_cback_data.sTest_set_config.param_ids,
-               p_data->sTest_set_config.param_ids,
-               p_data->sTest_set_config.tlv_size);
-      }
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_SET_CONFIG_RSP_EVT,
-                                   &dm_cback_data);
-      break;
-
-    case UWB_TEST_GET_CONFIG_REVT: /* get test configs response */
-      dm_cback_data.sTest_get_config.status = p_data->sTest_get_config.status;
-      dm_cback_data.sTest_get_config.no_of_ids =
-          p_data->sTest_get_config.no_of_ids;
-      dm_cback_data.sTest_get_config.tlv_size =
-          p_data->sTest_get_config.tlv_size;
-      if (p_data->sTest_get_config.tlv_size > 0) {
-        memcpy(dm_cback_data.sTest_get_config.param_tlvs,
-               p_data->sTest_get_config.p_param_tlvs,
-               p_data->sTest_get_config.tlv_size);
-      }
-      /* Return result of getTestConfig to the app */
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_GET_CONFIG_RSP_EVT,
-                                   &dm_cback_data);
-      break;
-
-    case UWB_TEST_PERIODIC_TX_REVT: /* periodic tx response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E("per tx command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_PERIODIC_TX_RSP_EVT,
-                                   &dm_cback_data);
-      break;
-
-    case UWB_TEST_PER_RX_REVT: /* per rx response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E("per rx command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_PER_RX_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_TEST_LOOPBACK_REVT: /* rf loop back response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E("rf loop back command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_LOOPBACK_RSP_EVT,
-                                   &dm_cback_data);
-      break;
-
-    case UWB_TEST_RX_REVT: /* rx test response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E("rx test command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_RX_RSP_EVT, &dm_cback_data);
-      break;
-
-    case UWB_TEST_STOP_SESSION_REVT: /* per rx response */
-      if (p_data->status != UWB_STATUS_OK) {
-        UCI_TRACE_E("test stop command failed");
-      }
-      dm_cback_data.status = p_data->status;
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_STOP_SESSION_RSP_EVT,
-                                   &dm_cback_data);
-      break;
-
-    case UWB_TEST_PER_RX_DATA_REVT: /* PER test data notification */
-    {
-      tUWA_RF_TEST_DATA* p_per_rx_test_data = &dm_cback_data.rf_test_data;
-      if (p_data->sRf_test_result.length > 0) {
-        p_per_rx_test_data->length = p_data->sRf_test_result.length;
-        memcpy(&p_per_rx_test_data->data[0], &p_data->sRf_test_result.data[0],
-               p_per_rx_test_data->length);
-      }
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_PER_RX_NTF_EVT, &dm_cback_data);
-    } break;
-
-    case UWB_TEST_PERIODIC_TX_DATA_REVT: /* periodic Tx test data notification
-                                          */
-    {
-      tUWA_RF_TEST_DATA* p_rf_test_data = &dm_cback_data.rf_test_data;
-      if (p_data->sRf_test_result.length > 0) {
-        p_rf_test_data->length = p_data->sRf_test_result.length;
-        memcpy(&p_rf_test_data->data[0], &p_data->sRf_test_result.data[0],
-               p_rf_test_data->length);
-      }
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_PERIODIC_TX_NTF_EVT,
-                                   &dm_cback_data);
-    } break;
-
-    case UWB_TEST_LOOPBACK_DATA_REVT: /* loopback test data notification */
-    {
-      tUWA_RF_TEST_DATA* p_uwb_loopback_test_data = &dm_cback_data.rf_test_data;
-      if (p_data->sRf_test_result.length > 0) {
-        p_uwb_loopback_test_data->length = p_data->sRf_test_result.length;
-        memcpy(&p_uwb_loopback_test_data->data[0],
-               &p_data->sRf_test_result.data[0],
-               p_uwb_loopback_test_data->length);
-      }
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_LOOPBACK_NTF_EVT,
-                                   &dm_cback_data);
-    } break;
-
-    case UWB_TEST_RX_DATA_REVT: /* Rx test data notification */
-    {
-      tUWA_RF_TEST_DATA* p_uwb_rx_test_data = &dm_cback_data.rf_test_data;
-      if (p_data->sRf_test_result.length > 0) {
-        p_uwb_rx_test_data->length = p_data->sRf_test_result.length;
-        memcpy(&p_uwb_rx_test_data->data[0], &p_data->sRf_test_result.data[0],
-               p_uwb_rx_test_data->length);
-      }
-      (*uwa_dm_cb.p_dm_test_cback)(UWA_DM_TEST_RX_NTF_EVT, &dm_cback_data);
-    } break;
-
-    default:
-      UCI_TRACE_E("unknown event.");
-      break;
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_enable
-**
-** Description      Initializes the UWB device manager
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_enable(tUWA_DM_MSG* p_data) {
-  tUWA_DM_CBACK_DATA dm_cback_data;
-  UCI_TRACE_I("uwa_dm_enable ()");
-
-  /* Check if UWA is already enabled */
-  if (!(uwa_dm_cb.flags & UWA_DM_FLAGS_DM_IS_ACTIVE)) {
-    uwa_dm_cb.flags |=
-        (UWA_DM_FLAGS_DM_IS_ACTIVE | UWA_DM_FLAGS_ENABLE_EVT_PEND);
-
-    /* Store Enable parameters */
-    uwa_dm_cb.p_dm_cback = p_data->enable.p_dm_cback;
-    uwa_dm_cb.p_dm_test_cback = p_data->enable.p_dm_test_cback;
-    /* Enable UWB stack */
-    UWB_Enable(uwa_dm_uwb_response_cback, uwa_dm_uwb_test_response_cback);
-  } else {
-    UCI_TRACE_E("uwa_dm_enable: ERROR ALREADY ENABLED.");
-    dm_cback_data.status = UWA_STATUS_FAILED;
-    (*(p_data->enable.p_dm_cback))(UWA_DM_ENABLE_EVT, &dm_cback_data);
-  }
-
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_disable
-**
-** Description      Disables the UWB device manager
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_disable(tUWA_DM_MSG* p_data) {
-  UCI_TRACE_I("uwa_dm_disable (): graceful:%d", p_data->disable.graceful);
-
-  /* Disable all subsystems other than DM (DM will be disabled after all  */
-  /* the other subsystem have been disabled)                              */
-  uwa_sys_disable_subsystems(p_data->disable.graceful);
-
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_disable_complete
-**
-** Description      Called when all UWA subsytems are disabled.
-**
-**                  UWB core stack can now be disabled.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_dm_disable_complete(void) {
-  UCI_TRACE_I("uwa_dm_disable_complete ()");
-  /* Disable uwb core stack */
-  UWB_Disable();
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_get_device_info
-**
-** Description      Function to get the UWBS device information by issuing get
-**                  device UCI command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_get_device_info(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_get_device_info(): p_data is NULL)");
-    return false;
-  } else {
-    status = UWB_GetDeviceInfo();
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_get_device_info(): success ,status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_get_device_info(): failed ,status=0x%X", status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_set_core_config
-**
-** Description      Process set core config command
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_set_core_config(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  uint8_t buff[255];
-  uint8_t* p = buff;
-
-  tUWA_DM_CBACK_DATA dm_cback_data;
-
-  if (p_data->setconfig.length + 2 > 255) {
-    /* Total length of TLV must be less than 256 (1 byte) */
-    status = UWB_STATUS_FAILED;
-  } else {
-    UINT8_TO_STREAM(p, p_data->setconfig.param_id);
-    UINT8_TO_STREAM(p, p_data->setconfig.length);
-    ARRAY_TO_STREAM(p, p_data->setconfig.p_data, p_data->setconfig.length);
-
-    status = UWB_SetCoreConfig((uint8_t)(p_data->setconfig.length + 2), buff);
-  }
-
-  if (status != UWB_STATUS_OK) {
-    dm_cback_data.sCore_set_config.status = UWA_STATUS_INVALID_PARAM;
-    (*uwa_dm_cb.p_dm_cback)(UWA_DM_CORE_SET_CONFIG_RSP_EVT, &dm_cback_data);
-  }
-
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_get_core_config
-**
-** Description      Process get config command
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_get_core_config(tUWA_DM_MSG* p_data) {
-  UWB_GetCoreConfig(p_data->getconfig.num_ids, p_data->getconfig.p_pmids);
-
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_device_reset
-**
-** Description      Process core device reset command
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_device_reset(tUWA_DM_MSG* pResetConfig) {
-  tUWB_STATUS status;
-
-  if (pResetConfig == NULL) {
-    UCI_TRACE_E("uwa_dm_act_device_reset(): pResetConfig is NULL)");
-  } else {
-    status = UWB_DeviceResetCommand(pResetConfig->sDevice_reset.resetConfig);
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_device_reset(): success ,status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_device_reset(): failed ,status=0x%X", status);
-    }
-  }
-
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_send_session_init
-**
-** Description      send session init command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_send_session_init(tUWA_DM_MSG* p_data) {
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_send_session_init(): p_data is NULL)");
-    return false;
-  } else {
-    UWB_SessionInit(p_data->sessionInit.session_id,
-                    p_data->sessionInit.sessionType);
-  }
-  return true;
-}
-/*******************************************************************************
-**
-** Function         uwa_dm_act_send_session_deinit
-**
-** Description      send session de init command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_send_session_deinit(tUWA_DM_MSG* p_data) {
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_send_session_deinit(): p_data is NULL)");
-    return false;
-  } else {
-    UWB_SessionDeInit(p_data->sessionInit.session_id);
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_get_session_count
-**
-** Description      send get session count to get no of active sessions
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_get_session_count(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_get_session_count(): p_data is NULL)");
-    return false;
-  } else {
-    status = UWB_GetSessionCount();
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_get_session_count(): success ,status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_get_session_count(): failed ,status=0x%X",
-                  status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_app_set_config
-**
-** Description      Send set configurations command to set the app configuration
-**                  parameters
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_app_set_config(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-
-  if (p_data->sApp_set_config.length + 2 > 255) {
-    /* Total length of TLV must be less than 256 (1 byte) */
-    status = UWB_STATUS_FAILED;
-  } else {
-    status = UWB_SetAppConfig(
-        p_data->sApp_set_config.session_id, p_data->sApp_set_config.num_ids,
-        p_data->sApp_set_config.length, p_data->sApp_set_config.p_data);
-  }
-
-  if (status != UWB_STATUS_OK) {
-    UCI_TRACE_E("uwa_dm_act_app_set_config(): failed ,status=0x%X", status);
-  } else {
-    UCI_TRACE_I("uwa_dm_act_app_set_config(): success ,status=0x%X", status);
-  }
-
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_app_get_config
-**
-** Description      Send get configurations command to get the app configuration
-**                  parameters
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_app_get_config(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_app_get_config(): p_data is NULL)");
-  } else {
-    status = UWB_GetAppConfig(
-        p_data->sApp_get_config.session_id, p_data->sApp_get_config.num_ids,
-        p_data->sApp_get_config.length, p_data->sApp_get_config.p_pmids);
-
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_app_get_config(): success ,status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_app_get_config(): failed ,status=0x%X", status);
-    }
-  }
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_start_range_session
-**
-** Description      start the ranging session
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_start_range_session(tUWA_DM_MSG* p_data) {
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_start_range_session(): p_data is NULL)");
-  } else {
-    UWB_StartRanging(p_data->rang_start.session_id);
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_stop_range_session
-**
-** Description      stop the ranging session
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_stop_range_session(tUWA_DM_MSG* p_data) {
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_stop_range_session(): p_data is NULL");
-  } else {
-    UWB_StopRanging(p_data->rang_stop.session_id);
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_send_raw_vs
-**
-** Description      Send the raw vs command to the UCI command queue
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_send_raw_cmd(tUWA_DM_MSG* p_data) {
-  UWB_HDR* p_cmd = (UWB_HDR*)p_data;
-
-  p_cmd->offset = sizeof(tUWA_DM_API_SEND_RAW) - UWB_HDR_SIZE;
-  p_cmd->len = p_data->send_raw.cmd_params_len;
-  UWB_SendRawCommand(p_cmd, p_data->send_raw.p_cback);
-
-  return false;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_send_data_frame
-**
-** Description      send data frame over UWB
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_send_data_frame(tUWA_DM_MSG* p_data){
-  tUWB_STATUS status;
-
-  if(p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_test_stop_session(): p_data is NULL)");
-    return false;
-  } else {
-  status = UWB_SendData(
-        p_data->send_data_frame.session_id,
-        p_data->send_data_frame.p_addr, p_data->send_data_frame.dest_end_point,
-        p_data->send_data_frame.sequence_num, p_data->send_data_frame.data_len,
-        p_data->send_data_frame.p_data);
-  }
-  if(status == UWB_STATUS_OK) {
-    UCI_TRACE_D("uwa_dm_act_send_data_frame(): success , status=0x%X",status);
-  } else {
-    UCI_TRACE_E("uwa_dm_act_send_data_frame(): failed , status=0x%X",status);
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_update_active_range_round_index
-**
-** Description      Update Active Ranging Index Command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_update_active_range_round_index(tUWA_DM_MSG* p_data){
-  tUWB_STATUS status;
-
-  if(p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_update_active_range_round_index(): p_data is NULL)");
-    return false;
-  } else {
-    status = UWB_UpdateRangingRoundIndex(p_data->update_rng_index.dlTdoaRole, p_data->update_rng_index.session_id, p_data->update_rng_index.number_of_rng_index,
-                          p_data->update_rng_index.length, p_data->update_rng_index.p_rng_index);
-  }
-  if(status == UWB_STATUS_OK) {
-    UCI_TRACE_D("uwa_dm_act_update_active_range_round_index(): success , status=0x%X",status);
-  } else {
-    UCI_TRACE_E("uwa_dm_act_update_active_range_round_index(): failed , status=0x%X",status);
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_get_range_count
-**
-** Description      Send the get range count command to the ranging count
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_get_range_count(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_get_range_count(): p_data is NULL)");
-  } else {
-    status = UWB_GetRangingCount(p_data->sGet_rang_count.session_id);
-
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_get_range_count(): success ,status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_get_range_count(): failed ,status=0x%X", status);
-    }
-  }
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_get_session_status
-**
-** Description      Send the get session status command to get the session
-**                  status
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_get_session_status(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_get_session_status(): p_data is NULL)");
-  } else {
-    status = UWB_GetSessionStatus(p_data->sGet_session_status.session_id);
-
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_get_session_status(): success ,status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_get_session_status(): failed ,status=0x%X",
-                  status);
-    }
-  }
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_get_device_capability
-**
-** Description      send get capability info command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_get_device_capability(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_get_device_capability(): p_data is NULL)");
-  } else {
-    status = UWB_CoreGetDeviceCapability();
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_get_device_capability(): success ,status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_get_device_capability(): failed ,status=0x%X",
-                  status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_multicast_list_update
-**
-** Description      send controlee multicast list update command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_multicast_list_update(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_multicast_list_update(): p_data is NULL)");
-  } else {
-    status = UWB_MulticastListUpdate(
-        p_data->sMulticast_list.session_id, p_data->sMulticast_list.action,
-        p_data->sMulticast_list.no_of_controlee,
-        p_data->sMulticast_list.short_address_list,
-        p_data->sMulticast_list.subsession_id_list);
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_multicast_list_update(): success ,status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_multicast_list_update(): failed ,status=0x%X",
-                  status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_configure_dt_anchor_rr_rdm
-**
-** Description      Configure dt anchor rr rdm list command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_configure_dt_anchor_rr_rdm(tUWA_DM_MSG* p_data){
-  tUWB_STATUS status;
-  if (p_data->sConfigure_dt_anchor_rr_rdm_list.length + 2 > MAX_RRRDM_LIST_LENGTH) {
-    /* Total length of mac addr list must be less than 256 (1 byte) */
-    status = UWA_STATUS_FAILED;
-  } else {
-    status = UWB_ConfigureDTAnchorForRrRdmList(p_data->sConfigure_dt_anchor_rr_rdm_list.session_id, p_data->sConfigure_dt_anchor_rr_rdm_list.rr_rdm_count, p_data->sConfigure_dt_anchor_rr_rdm_list.length,
-      p_data->sConfigure_dt_anchor_rr_rdm_list.p_data);
-    if(UWB_STATUS_OK == status){
-      UCI_TRACE_D("uwa_dm_act_configure_dt_anchor_rr_rdm(): success ,status=0x%X",status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_configure_dt_anchor_rr_rdm(): failed ,status=0x%X",status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_set_country_code
-**
-** Description      send country code set command.
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_set_country_code(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_set_country_code(): p_data is NULL)");
-  } else {
-    status = UWB_SetCountryCode(p_data->sCountryCode.country_code);
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_set_country_code(): success ,status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_set_country_code(): failed ,status=0x%X", status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_send_blink_data
-**
-** Description      send blink data tx command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_send_blink_data(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_send_blink_data(): p_data is NULL)");
-  } else {
-    status = UWB_SendBlinkData(p_data->sSend_blink_data.session_id,
-                               p_data->sSend_blink_data.repetition_count,
-                               p_data->sSend_blink_data.app_data_len,
-                               p_data->sSend_blink_data.app_data);
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_send_blink_data(): success ,status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_send_blink_data(): failed ,status=0x%X", status);
-    }
-  }
-  return true;
-}
-/* APIs for RF Test Functionality */
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_test_set_config
-**
-** Description      Send set configurations command to set the test
-**                  configuration parameters
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_test_set_config(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-
-  if (p_data->sTest_set_config.length + 2 > UCI_MAX_PAYLOAD_SIZE) {
-    /* Total length of TLV must be less than 256 (1 byte) */
-    status = UWB_STATUS_FAILED;
-  } else {
-    status = UWB_SetTestConfig(
-        p_data->sTest_set_config.session_id, p_data->sTest_set_config.num_ids,
-        p_data->sTest_set_config.length, p_data->sTest_set_config.p_data);
-  }
-  if (status != UWB_STATUS_OK) {
-    UCI_TRACE_E("uwa_dm_act_test_set_config(): failed ,status=0x%X", status);
-  } else {
-    UCI_TRACE_I("uwa_dm_act_test_set_config(): success ,status=0x%X", status);
-  }
-
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_test_get_config
-**
-** Description      Send get configurations command to get the test
-**                  configuration parameters
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_test_get_config(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_test_get_config(): p_data is NULL)");
-  } else {
-    status = UWB_TestGetConfig(
-        p_data->sTest_get_config.session_id, p_data->sTest_get_config.num_ids,
-        p_data->sTest_get_config.length, p_data->sTest_get_config.p_pmids);
-
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_test_get_config(): success ,status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_test_get_config(): failed ,status=0x%X", status);
-    }
-  }
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_test_periodic_tx
-**
-** Description      Send periodic tx command to start periodic Tx test
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_test_periodic_tx(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_test_periodic_tx(): p_data is NULL)");
-  } else {
-    status = UWB_TestPeriodicTx(p_data->sPeriodic_tx.length,
-                                p_data->sPeriodic_tx.p_data);
-
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_test_periodic_tx(): success ,status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_test_periodic_tx(): failed ,status=0x%X", status);
-    }
-  }
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_test_per_rx
-**
-** Description      Send PER Rx command to start Packet error rate Rx test
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_test_per_rx(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_test_per_rx(): p_data is NULL)");
-  } else {
-    status = UWB_TestPerRx(p_data->sPer_rx.length, p_data->sPer_rx.p_data);
-
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_test_per_rx(): success ,status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_test_per_rx(): failed ,status=0x%X", status);
-    }
-  }
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_test_uwb_loopback
-**
-** Description      Send Rf loop back command
-**
-** Returns          true (message buffer to be freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_test_uwb_loopback(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_test_uwb_loopback(): p_data is NULL)");
-  } else {
-    status = UWB_TestUwbLoopBack(p_data->sUwb_loopback.length,
-                                 p_data->sUwb_loopback.p_data);
-
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_test_uwb_loopback(): success ,status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_test_uwb_loopback(): failed ,status=0x%X",
-                  status);
-    }
-  }
-  return (true);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_test_rx
-**
-** Description      Send Test Rx Command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_test_rx(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_test_rx(): p_data is NULL)");
-    return false;
-  } else {
-    status = UWB_TestRx();
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_test_rx(): success , status=0x%X", status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_test_rx(): failed , status=0x%X", status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_act_test_stop_session
-**
-** Description      send test stop session command
-**
-** Returns          FALSE (message buffer is NOT freed by caller)
-**
-*******************************************************************************/
-bool uwa_dm_act_test_stop_session(tUWA_DM_MSG* p_data) {
-  tUWB_STATUS status;
-  if (p_data == NULL) {
-    UCI_TRACE_E("uwa_dm_act_test_stop_session(): p_data is NULL)");
-    return false;
-  } else {
-    status = UWB_TestStopSession();
-    if (UWB_STATUS_OK == status) {
-      UCI_TRACE_I("uwa_dm_act_test_stop_session(): success , status=0x%X",
-                  status);
-    } else {
-      UCI_TRACE_E("uwa_dm_act_test_stop_session(): failed , status=0x%X",
-                  status);
-    }
-  }
-  return true;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_uwb_revt_2_str
-**
-** Description      convert uwb revt to string
-**
-*******************************************************************************/
-std::string uwa_dm_uwb_revt_2_str(tUWB_RESPONSE_EVT event) {
-  switch (event) {
-    case UWB_ENABLE_REVT:
-      return "UWB_ENABLE_REVT";
-
-    case UWB_DISABLE_REVT:
-      return "UWB_DISABLE_REVT";
-
-    case UWB_DEVICE_STATUS_REVT:
-      return "UWB_DEVICE_STATUS_REVT";
-
-    case UWB_GET_DEVICE_INFO_REVT:
-      return "UWB_GET_DEVICE_INFO_REVT";
-
-    case UWB_SET_CORE_CONFIG_REVT:
-      return "UWB_SET_CORE_CONFIG_REVT";
-
-    case UWB_GET_CORE_CONFIG_REVT:
-      return "UWB_GET_CORE_CONFIG_REVT";
-
-    case UWB_DEVICE_RESET_REVT:
-      return "UWB_DEVICE_RESET_REVT";
-
-    case UWB_CORE_GEN_ERR_STATUS_REVT:
-      return "UWB_CORE_GEN_ERR_STATUS_REVT";
-
-    case UWB_SESSION_INIT_REVT:
-      return "UWB_SESSION_INIT_REVT";
-
-    case UWB_SESSION_DEINIT_REVT:
-      return "UWB_SESSION_DEINIT_REVT";
-
-    case UWB_SESSION_STATUS_NTF_REVT:
-      return "UWB_SESSION_STATUS_NTF_REVT";
-
-    case UWB_SESSION_GET_COUNT_REVT:
-      return "UWB_SESSION_GET_COUNT_REVT";
-
-    case UWB_SESSION_GET_STATE_REVT:
-      return "UWB_SESSION_GET_STATE_REVT";
-
-    case UWB_GET_APP_CONFIG_REVT:
-      return "UWB_GET_APP_CONFIG_REVT";
-
-    case UWB_SET_APP_CONFIG_REVT:
-      return "UWB_SET_APP_CONFIG_REVT";
-
-    case UWB_START_RANGE_REVT:
-      return "UWB_START_RANGE_REVT";
-
-    case UWB_STOP_RANGE_REVT:
-      return "UWB_STOP_RANGE_REVT";
-
-    case UWB_RANGE_DATA_REVT:
-      return "UWB_RANGE_DATA_REVT";
-
-    case UWB_GET_RANGE_COUNT_REVT:
-      return "UWB_GET_RANGE_COUNT_REVT";
-
-    case UWB_CORE_GET_DEVICE_CAPABILITY_REVT:
-      return "UWB_CORE_GET_DEVICE_CAPABILITY_REVT";
-
-    case UWB_SESSION_UPDATE_MULTICAST_LIST_REVT:
-      return "UWB_SESSION_UPDATE_MULTICAST_LIST_REVT";
-
-    case UWB_SESSION_UPDATE_MULTICAST_LIST_NTF_REVT:
-      return "UWB_SESSION_UPDATE_MULTICAST_LIST_NTF_REVT";
-
-    case UWB_SET_COUNTRY_CODE_REVT:
-      return "UWB_SET_COUNTRY_CODE_REVT";
-
-    case UWB_BLINK_DATA_TX_REVT:
-      return "UWB_BLINK_DATA_TX_REVT";
-
-    case UWB_BLINK_DATA_TX_NTF_REVT:
-      return "UWB_BLINK_DATA_TX_NTF_REVT";
-
-    case UWB_DATA_RECV_REVT:
-      return "UWB_DATA_RECV_REVT";
-
-    case UWB_DATA_TRANSFER_STATUS_NTF_REVT:
-      return "UWB_DATA_TRANSFER_STATUS_NTF_REVT";
-
-    case UWB_SEND_DATA_STATUS_EVT:
-      return "UWB_SEND_DATA_STATUS_EVT";
-
-    case UWB_CONFORMANCE_TEST_DATA:
-      return "UWB_CONFORMANCE_TEST_DATA";
-
-    case UWB_VENDOR_SPECIFIC_UCI_NTF_EVT:
-      return "UWB_VENDOR_SPECIfIC_UCI_NTF_EVT";
-
-    default:
-      return "unknown revt";
-      break;
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_test_dm_uwb_revt_2_str
-**
-** Description      convert uwb revt to string for RF test events
-**
-*******************************************************************************/
-std::string uwa_test_dm_uwb_revt_2_str(tUWB_TEST_RESPONSE_EVT event) {
-  switch (event) {
-    case UWB_TEST_GET_CONFIG_REVT:
-      return "UWB_TEST_GET_CONFIG_REVT";
-
-    case UWB_TEST_SET_CONFIG_REVT:
-      return "UWB_TEST_SET_CONFIG_REVT";
-
-    case UWB_TEST_PERIODIC_TX_DATA_REVT:
-      return "UWB_TEST_PERIODIC_TX_DATA_REVT";
-
-    case UWB_TEST_PER_RX_DATA_REVT:
-      return "UWB_TEST_PER_RX_DATA_REVT";
-
-    case UWB_TEST_PERIODIC_TX_REVT:
-      return "UWB_TEST_PERIODIC_TX_REVT";
-
-    case UWB_TEST_PER_RX_REVT:
-      return "UWB_TEST_PER_RX_REVT";
-
-    case UWB_TEST_STOP_SESSION_REVT:
-      return "UWB_TEST_STOP_SESSION_REVT";
-
-    case UWB_TEST_LOOPBACK_DATA_REVT:
-      return "UWB_TEST_LOOPBACK_DATA_REVT";
-
-    case UWB_TEST_LOOPBACK_REVT:
-      return "UWB_TEST_LOOPBACK_REVT";
-
-    case UWB_TEST_RX_REVT:
-      return "UWB_TEST_RX_REVT";
-
-    case UWB_TEST_RX_DATA_REVT:
-      return "UWB_TEST_RX_DATA_REVT";
-
-    default:
-      return "unknown revt";
-      break;
-  }
-}
diff --git a/src/uwa/dm/uwa_dm_api.cc b/src/uwa/dm/uwa_dm_api.cc
deleted file mode 100755
index b58ccba..0000000
--- a/src/uwa/dm/uwa_dm_api.cc
+++ /dev/null
@@ -1,1041 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 2010-2014 Broadcom Corporation
- *  Copyright 2018-2022 NXP
- *
- *  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.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
- *  UWA interface for device management
- *
- ******************************************************************************/
-#include <string.h>
-
-#include "uci_log.h"
-#include "uwa_api.h"
-#include "uwa_dm_int.h"
-#include "uwa_sys.h"
-#include "uwa_sys_int.h"
-#include "uwb_osal_common.h"
-
-tHAL_UWB_CONTEXT hal_Initcntxt;
-
-/*****************************************************************************
-**  APIs
-*****************************************************************************/
-/*******************************************************************************
-**
-** Function         UWA_Init
-**
-** Description      This function initializes control blocks for UWA
-**
-**                  p_hal_entry_tbl points to a table of HAL entry points
-**
-**                  NOTE: the buffer that p_hal_entry_tbl points must be
-**                  persistent until UWA is disabled.
-**
-** Returns          none
-**
-*******************************************************************************/
-void UWA_Init(tHAL_UWB_ENTRY* p_hal_entry_tbl) {
-  UCI_TRACE_I(__func__);
-  hal_Initcntxt.hal_entry_func = p_hal_entry_tbl;
-  uwa_sys_init();
-  uwa_dm_init();
-  UWB_Init(&hal_Initcntxt);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_Enable
-**
-** Description      This function enables UWBS. Prior to calling UWA_Enable,
-**                  the UWBC must be powered up, and ready to receive commands.
-**                  This function enables the tasks needed by UWB, opens the UCI
-**                  transport, resets the UWB Subsystem, downloads patches to
-**                  the UWBS (if necessary), and initializes the UWB subsystems.
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_Enable(tUWA_DM_CBACK* p_dm_cback,
-                       tUWA_DM_TEST_CBACK* p_dm_test_cback) {
-  tUWA_DM_API_ENABLE* p_msg;
-
-  UCI_TRACE_I(__func__);
-
-  /* Validate parameters */
-  if (!p_dm_cback) {
-    UCI_TRACE_E("error null callback");
-    return (UWA_STATUS_FAILED);
-  }
-
-  if ((p_msg = (tUWA_DM_API_ENABLE*)phUwb_GKI_getbuf(
-           sizeof(tUWA_DM_API_ENABLE))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_ENABLE_EVT;
-    p_msg->p_dm_cback = p_dm_cback;
-    p_msg->p_dm_test_cback = p_dm_test_cback;
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_Disable
-**
-** Description      This function is called to shutdown UWBS. The tasks for UWB
-**                  are terminated, and clean up routines are performed. This
-**                  function is typically called during platform shut-down, or
-**                  when UWB is disabled from a settings UI. When the UWBS
-**                  shutdown procedure is completed, an UWA_DM_DISABLE_EVT is
-**                  returned to the application using the tUWA_DM_CBACK.
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_Disable(bool graceful) {
-  tUWA_DM_API_DISABLE* p_msg;
-
-  UCI_TRACE_I("UWA_Disable (graceful=%i)", graceful);
-
-  if ((p_msg = (tUWA_DM_API_DISABLE*)phUwb_GKI_getbuf(
-           sizeof(tUWA_DM_API_DISABLE))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_DISABLE_EVT;
-    p_msg->graceful = graceful;
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function:        UWA_GetDeviceInfo
-**
-** Description:     This function gets the UWB Subsystem Information
-**
-** Returns:         UCI version and manufacturer specific information
-**
-*******************************************************************************/
-tUWA_STATUS UWA_GetDeviceInfo() {
-  tUWA_DM_API_GET_DEVICE_INFO* p_msg;
-
-  UCI_TRACE_I("UWA_GetDeviceInfo ()");
-
-  p_msg = (tUWA_DM_API_GET_DEVICE_INFO*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_GET_DEVICE_INFO));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_GET_DEVICE_INFO_EVT;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SetCoreConfig
-**
-** Description      Set the configuration parameters to UWBS. The result is
-**                  reported with an UWA_DM_CORE_SET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_SetCoreConfig(tUWA_PMID param_id, uint8_t length,
-                              uint8_t* p_data) {
-  tUWA_DM_API_CORE_SET_CONFIG* p_msg;
-
-  UCI_TRACE_I("param_id:0x%X", param_id);
-
-  if ((p_msg = (tUWA_DM_API_CORE_SET_CONFIG*)phUwb_GKI_getbuf(
-           (uint16_t)(sizeof(tUWA_DM_API_CORE_SET_CONFIG) + length))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SET_CORE_CONFIG_EVT;
-
-    p_msg->param_id = param_id;
-    p_msg->length = length;
-    p_msg->p_data = (uint8_t*)(p_msg + 1);
-
-    /* Copy parameter data */
-    memcpy(p_msg->p_data, p_data, length);
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_GetCoreConfig
-**
-** Description      Get the configuration parameters from UWBS. The result is
-**                  reported with an UWA_DM_CORE_GET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_GetCoreConfig(uint8_t num_ids, tUWA_PMID* p_param_ids) {
-  tUWA_DM_API_CORE_GET_CONFIG* p_msg;
-
-  UCI_TRACE_I("UWA_GetCoreConfig (): num_ids: %i", num_ids);
-  if ((p_msg = (tUWA_DM_API_CORE_GET_CONFIG*)phUwb_GKI_getbuf((uint16_t)(
-           sizeof(tUWA_DM_API_CORE_GET_CONFIG) + num_ids))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_GET_CORE_CONFIG_EVT;
-    p_msg->num_ids = num_ids;
-    p_msg->p_pmids = (tUWA_PMID*)(p_msg + 1);
-    /* Copy the param IDs */
-    memcpy(p_msg->p_pmids, p_param_ids, num_ids);
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SendDeviceReset
-**
-** Description      Send Device Reset Command to UWBS. The result is
-**                  reported with an UWA_DM_DEVICE_RESET_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_SendDeviceReset(uint8_t resetConfig) {
-  tUWA_DM_API_DEVICE_RESET* p_msg;
-
-  UCI_TRACE_I("UWA_SendDeviceReset(): resetConfig:0x%X", resetConfig);
-
-  if ((p_msg = (tUWA_DM_API_DEVICE_RESET*)phUwb_GKI_getbuf(
-           (uint16_t)(sizeof(tUWA_DM_API_DEVICE_RESET)))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_DEVICE_RESET_EVT;
-    p_msg->resetConfig = resetConfig;
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SendSessionInit
-**
-** Description      This function is called to send session init command.
-**                  The result is reported with an UWA_DM_SESSION_INIT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback
-**
-**                  session id - value of particular session ID
-**                  session type - type of session to start ex: ranging,app etc
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendSessionInit(uint32_t session_id,
-                                       uint8_t sessionType) {
-  tUWA_DM_API_SESSION_INIT* p_msg;
-  p_msg = (tUWA_DM_API_SESSION_INIT*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_SESSION_INIT));
-
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SESSION_INIT_EVT;
-    p_msg->session_id = session_id;
-    p_msg->sessionType = sessionType;
-    uwa_sys_sendmsg(p_msg);
-
-    return UWA_STATUS_OK;
-  }
-
-  return UWA_STATUS_FAILED;
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SendSessionDeInit
-**
-** Description      This function is called to send session deinit command.
-**                  The result is reported with an UWA_DM_SESSION_DEINIT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback
-**
-**                  session id - value of particular session ID
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendSessionDeInit(uint32_t session_id) {
-  tUWA_DM_API_SESSION_DEINIT* p_msg;
-  p_msg = (tUWA_DM_API_SESSION_DEINIT*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_SESSION_DEINIT));
-
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SESSION_DEINIT_EVT;
-    p_msg->session_id = session_id;
-    uwa_sys_sendmsg(p_msg);
-
-    return UWA_STATUS_OK;
-  }
-
-  return UWA_STATUS_FAILED;
-}
-
-/*******************************************************************************
-**
-** Function         UWA_GetSessionCount
-**
-** Description      This function is called to send get session count command
-**                  The result is reported with an
-**                  UWA_DM_SESSION_GET_COUNT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully sent
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_GetSessionCount() {
-  tUWA_DM_API_GET_SESSION_COUNT* p_msg;
-
-  UCI_TRACE_I("UWA_GetSessionCount ()");
-
-  p_msg = (tUWA_DM_API_GET_SESSION_COUNT*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_GET_SESSION_COUNT));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SESSION_GET_COUNT_EVT;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SetAppConfig
-**
-** Description      Set the configuration parameters to UWBS. The result is
-**                  reported with an UWA_DM_SESSION_SET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_SetAppConfig(uint32_t session_id, uint8_t noOfParams,
-                             uint8_t paramLen, uint8_t appConfigParams[]) {
-  tUWA_DM_API_SET_APP_CONFIG* p_msg;
-
-  if ((p_msg = (tUWA_DM_API_SET_APP_CONFIG*)phUwb_GKI_getbuf((uint16_t)(
-           sizeof(tUWA_DM_API_SET_APP_CONFIG) + paramLen))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SET_APP_CONFIG_EVT;
-
-    p_msg->session_id = session_id;
-    p_msg->num_ids = noOfParams;
-    p_msg->length = paramLen;
-    p_msg->p_data = (uint8_t*)(p_msg + 1);
-
-    /* Copy parameter data */
-    memcpy(p_msg->p_data, appConfigParams, paramLen);
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_GetAppConfig
-**
-** Description      Get the configuration parameters from UWBS. The result is
-**                  reported with an UWA_DM_SESSION_GET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_GetAppConfig(uint32_t session_id, uint8_t noOfParams,
-                             uint8_t paramLen, tUWA_PMID* p_param_ids) {
-  tUWA_DM_API_GET_APP_CONFIG* p_msg;
-
-  UCI_TRACE_I("UWA_GetAppConfig (): num_ids: %i", noOfParams);
-  if ((p_msg = (tUWA_DM_API_GET_APP_CONFIG*)phUwb_GKI_getbuf((uint16_t)(
-           sizeof(tUWA_DM_API_GET_APP_CONFIG) + paramLen))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_GET_APP_CONFIG_EVT;
-    p_msg->session_id = session_id;
-    p_msg->num_ids = noOfParams;
-    p_msg->length = paramLen;
-    p_msg->p_pmids = (tUWA_PMID*)(p_msg + 1);
-
-    /* Copy the param IDs */
-    memcpy(p_msg->p_pmids, p_param_ids, paramLen);
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-
-/*******************************************************************************
-**
-** Function         UWA_UpdateRangingRoundIndex
-**
-** Description      Update the Ranging Round Index for the given session for
-**                  TDoA Feature,The result is reported with an
-**                  UWA_DM_SESSION_ACTIVE_ROUNDS_INDEX_UPDATE_REVT in the tUWA_DM_CBACK
-**                  callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_UpdateRangingRoundIndex(uint8_t dlTdoaRole, uint32_t session_id, uint8_t number_of_active_rngIndex,
-                                    uint8_t rng_round_index_len, uint8_t* p_rng_round_index) {
-  tUWA_DM_API_UPDATE_ACTIVE_RNG_INDEX* p_msg;
-
-  if ((p_msg = (tUWA_DM_API_UPDATE_ACTIVE_RNG_INDEX*)phUwb_GKI_getbuf(
-           (uint16_t)(sizeof(tUWA_DM_API_UPDATE_ACTIVE_RNG_INDEX) + rng_round_index_len))) != NULL)
-  {
-    p_msg->hdr.event = UWA_DM_API_UPDATE_ACTIVE_RNG_INDEX_EVT;
-    p_msg->session_id = session_id;
-    p_msg->dlTdoaRole = dlTdoaRole;
-    p_msg->number_of_rng_index = number_of_active_rngIndex;
-    p_msg->length = rng_round_index_len;
-    p_msg->p_rng_index = (uint8_t*)(p_msg + 1);
-
-    /* Copy the param IDs */
-    memcpy(p_msg->p_rng_index, p_rng_round_index, rng_round_index_len);
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_StartRangingSession
-**
-** Description      start the ranging session.
-**                  The result is reported with an UWA_DM_RANGE_START_RSP_EVT in
-**                  the tUWA_DM_CBACK callback
-**
-** Returns          UWA_STATUS_OK if ranging started successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_StartRangingSession(uint32_t session_id) {
-  tUWA_DM_API_RANGING_START* p_msg;
-
-  UCI_TRACE_I("UWA_StartRangingSession ():");
-
-  p_msg = (tUWA_DM_API_RANGING_START*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_RANGING_START));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_START_RANGE_EVT;
-    p_msg->session_id = session_id;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_StopRangingSession
-**
-** Description      stop the ranging session.
-**                  The result is reported with an UWA_DM_RANGE_STOP_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if ranging is stopped successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_StopRangingSession(uint32_t session_id) {
-  tUWA_DM_API_RANGING_STOP* p_msg;
-
-  UCI_TRACE_I("UWA_StopRangingSession ()");
-
-  p_msg = (tUWA_DM_API_RANGING_STOP*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_RANGING_STOP));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_STOP_RANGE_EVT;
-    p_msg->session_id = session_id;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_GetRangingCount
-**
-** Description      Get ranging count.
-**                  The result is reported with an
-**                  UWA_DM_GET_RANGE_COUNT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          ranging count if successful
-**                  0 otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_GetRangingCount(uint32_t session_id) {
-  tUWA_DM_API_GET_RANGING_COUNT* p_msg;
-
-  UCI_TRACE_I("UWA_GetRangeCount ()");
-
-  p_msg = (tUWA_DM_API_GET_RANGING_COUNT*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_GET_RANGING_COUNT));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_GET_RANGE_COUNT_EVT;
-    p_msg->session_id = session_id;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_GetSessionStatus
-**
-** Description      Get session status.
-**                  The result is reported with an
-**                  UWA_DM_SESSION_GET_STATE_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          session status if successful
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_GetSessionStatus(uint32_t session_id) {
-  tUWA_DM_API_GET_SESSION_STATUS* p_msg;
-
-  UCI_TRACE_I("UWA_GetSessionStatus ()");
-
-  p_msg = (tUWA_DM_API_GET_SESSION_STATUS*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_GET_SESSION_STATUS));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_GET_SESSION_STATUS_EVT;
-    p_msg->session_id = session_id;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_GetCoreGetDeviceCapability
-**
-** Description      Get core device capability info command.
-**                  The result is reported with an
-**                  UWA_DM_GET_CORE_DEVICE_CAP_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if successfully sent
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_GetCoreGetDeviceCapability() {
-  tUWA_DM_API_CORE_GET_DEVICE_CAPABILITY* p_msg;
-
-  UCI_TRACE_I("UWA_GetCoreGetDeviceCapability()");
-
-  p_msg = (tUWA_DM_API_CORE_GET_DEVICE_CAPABILITY*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_CORE_GET_DEVICE_CAPABILITY));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_CORE_GET_DEVICE_CAPABILITY_EVT;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_ControllerMulticastListUpdate
-**
-** Description      This function is called to send Controller Multicast List
-**                  Update.
-**                  The result is reported with an
-**                  UWA_DM_SESSION_MC_LIST_UPDATE_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_ControllerMulticastListUpdate(
-    uint32_t session_id, uint8_t action, uint8_t noOfControlees,
-    uint16_t* shortAddressList, uint32_t* subSessionIdList) {
-  tUWA_DM_API_SESSION_UPDATE_MULTICAST_LIST* p_msg;
-  p_msg = (tUWA_DM_API_SESSION_UPDATE_MULTICAST_LIST*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_SESSION_UPDATE_MULTICAST_LIST));
-
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SESSION_UPDATE_MULTICAST_LIST_EVT;
-    p_msg->session_id = session_id;
-    p_msg->action = action;
-    p_msg->no_of_controlee = noOfControlees;
-    if ((noOfControlees > 0) && (shortAddressList != NULL)) {
-      memcpy(p_msg->short_address_list, shortAddressList,
-             (noOfControlees * SHORT_ADDRESS_LEN));
-    }
-    if ((noOfControlees > 0) && (subSessionIdList != NULL)) {
-      memcpy(p_msg->subsession_id_list, subSessionIdList,
-             (noOfControlees * SESSION_ID_LEN));
-    }
-    uwa_sys_sendmsg(p_msg);
-
-    return UWA_STATUS_OK;
-  }
-  return UWA_STATUS_FAILED;
-}
-
-/*******************************************************************************
-**
-** Function         UWA_ConfigureDTAnchorForRrRdmList
-**
-** Description      This function is called to Configure DT Anchor RR RDM List Update.
-**                  The result is reported with an
-**                  UWA_SESSION_CONFIGURE_DT_ANCHOR_RR_RDM_REVT in the tUWA_DM_CBACK
-**                  callback.
-** Returns          UWA_STATUS_OK if command is successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_ConfigureDTAnchorForRrRdmList(uint32_t session_id, uint8_t noOfParams, uint8_t rrRdmConfigParamLen , uint8_t rrRdmConfigParam[]) {
-  tUWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST* p_msg;
-  p_msg = (tUWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST*)phUwb_GKI_getbuf(sizeof(tUWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST));
-
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_EVT;
-    p_msg->session_id = session_id;
-    p_msg->rr_rdm_count = noOfParams;
-    p_msg->length = rrRdmConfigParamLen;
-    p_msg->p_data= (uint8_t*)(p_msg + 1);
-
-    memcpy(p_msg->p_data, rrRdmConfigParam, (rrRdmConfigParamLen));
-
-    uwa_sys_sendmsg(p_msg);
-
-    return UWA_STATUS_OK;
-  }
-  return UWA_STATUS_FAILED;
-}
-
-/*******************************************************************************
-**
-** Function         UWA_ControllerSetCountryCode
-**
-** Description      This function is called to set country code.
-**                  The result is reported with an
-**                  UWA_DM_SET_COUNTRY_CODE_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_ControllerSetCountryCode(uint8_t* countryCodeArray) {
-  tUWA_DM_API_SET_COUNTRY_CODE * p_msg;
-  p_msg = (tUWA_DM_API_SET_COUNTRY_CODE *)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_SET_COUNTRY_CODE));
-
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SET_COUNTRY_CODE_EVT;
-    if (countryCodeArray != NULL) {
-      memcpy(p_msg->country_code, countryCodeArray, COUNTRY_CODE_ARRAY_LEN);
-    }
-    uwa_sys_sendmsg(p_msg);
-    return UWA_STATUS_OK;
-  }
-  return UWA_STATUS_FAILED;
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SendBlinkData
-**
-** Description      This function is called to send Blink Data Tx.
-**                  The result is reported with an
-**                  UWA_DM_SEND_BLINK_DATA_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendBlinkData(uint32_t session_id,
-                                     uint8_t repetition_count,
-                                     uint8_t app_data_len, uint8_t* app_data) {
-  tUWA_DM_API_SEND_BLINK_DATA* p_msg;
-  p_msg = (tUWA_DM_API_SEND_BLINK_DATA*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_SEND_BLINK_DATA));
-
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SEND_BLINK_DATA_EVT;
-    p_msg->session_id = session_id;
-    p_msg->repetition_count = repetition_count;
-    p_msg->app_data_len = app_data_len;
-    if ((app_data_len > 0) && (app_data != NULL)) {
-      memcpy(p_msg->app_data, app_data, app_data_len);
-    }
-
-    uwa_sys_sendmsg(p_msg);
-
-    return UWA_STATUS_OK;
-  }
-  return UWA_STATUS_FAILED;
-}
-
-/* UWA APIs for RF Test functionality */
-
-/*******************************************************************************
-**
-** Function         UWA_TestSetConfig
-**
-** Description      Set the configuration parameters to UWBS.
-**                     The result is  reported with an
-**                     UWA_DM_TEST_SET_CONFIG_RSP_EVT
-**                     in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_TestSetConfig(uint32_t session_id, uint8_t noOfParams,
-                              uint8_t paramLen, uint8_t testConfigParams[]) {
-  tUWA_DM_API_TEST_SET_CONFIG* p_msg;
-
-  if ((p_msg = (tUWA_DM_API_TEST_SET_CONFIG*)phUwb_GKI_getbuf((uint16_t)(
-           sizeof(tUWA_DM_API_TEST_SET_CONFIG) + paramLen))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_TEST_SET_CONFIG_EVT;
-
-    p_msg->session_id = session_id;
-    p_msg->num_ids = noOfParams;
-    p_msg->length = paramLen;
-    p_msg->p_data = (uint8_t*)(p_msg + 1);
-
-    /* Copy parameter data */
-    memcpy(p_msg->p_data, testConfigParams, paramLen);
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_TestGetConfig
-**
-** Description      Get the configuration parameters from UWBS.
-**                     The result is reported with an
-**                     UWA_DM_TEST_GET_CONFIG_RSP_EVT
-**                     in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_TestGetConfig(uint32_t session_id, uint8_t noOfParams,
-                              uint8_t paramLen, tUWA_PMID* p_param_ids) {
-  tUWA_DM_API_TEST_GET_CONFIG* p_msg;
-
-  UCI_TRACE_I("UWA_TestGetConfig (): num_ids: %i", noOfParams);
-  if ((p_msg = (tUWA_DM_API_TEST_GET_CONFIG*)phUwb_GKI_getbuf((uint16_t)(
-           sizeof(tUWA_DM_API_TEST_GET_CONFIG) + paramLen))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_TEST_GET_CONFIG_EVT;
-    p_msg->session_id = session_id;
-    p_msg->num_ids = noOfParams;
-    p_msg->length = paramLen;
-    p_msg->p_pmids = (tUWA_PMID*)(p_msg + 1);
-
-    /* Copy the param IDs */
-    memcpy(p_msg->p_pmids, p_param_ids, paramLen);
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_PeriodicTxTest
-**
-** Description      This function is called to trigger the periodic Tx Test.
-**                     The result is reported with an
-**                     UWA_DM_TEST_PERIODIC_TX_RSP_EVT
-**                     in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_PeriodicTxTest(uint16_t psduLen, uint8_t psduData[]) {
-  tUWA_DM_API_TEST_PERIODIC_TX* p_msg;
-
-  if ((p_msg = (tUWA_DM_API_TEST_PERIODIC_TX*)phUwb_GKI_getbuf((uint16_t)(
-           sizeof(tUWA_DM_API_TEST_PERIODIC_TX) + psduLen))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_TEST_PERIODIC_TX_EVT;
-    p_msg->length = psduLen;
-    p_msg->p_data = (uint8_t*)(p_msg + 1);
-    if ((psduLen > 0) && (psduData != NULL)) {
-      memcpy(p_msg->p_data, psduData, psduLen);
-    }
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_PerRxTest
-**
-** Description      This function is called to trigger the PER Rx  Tx Test
-**                     The result is reported with an UWA_DM_TEST_PER_RX_RSP_EVT
-**                     in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_PerRxTest(uint16_t psduLen, uint8_t psduData[]) {
-  tUWA_DM_API_TEST_PER_RX* p_msg;
-
-  if ((p_msg = (tUWA_DM_API_TEST_PER_RX*)phUwb_GKI_getbuf(
-           (uint16_t)(sizeof(tUWA_DM_API_TEST_PER_RX) + psduLen))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_TEST_PER_RX_EVT;
-    p_msg->length = psduLen;
-    p_msg->p_data = (uint8_t*)(p_msg + 1);
-    if ((psduLen > 0) && (psduData != NULL)) {
-      memcpy(p_msg->p_data, psduData, psduLen);
-    }
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_UwbLoopBackTest
-**
-** Description      This function is called to trigger the loop back Test.
-**                  The result is reported with an UWA_DM_TEST_LOOPBACK_RSP_EVT
-**                  in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_UwbLoopBackTest(uint16_t psduLen, uint8_t psduData[]) {
-  tUWA_DM_API_TEST_UWB_LOOPBACK* p_msg;
-
-  if ((p_msg = (tUWA_DM_API_TEST_UWB_LOOPBACK*)phUwb_GKI_getbuf((uint16_t)(
-           sizeof(tUWA_DM_API_TEST_UWB_LOOPBACK) + psduLen))) != NULL) {
-    p_msg->hdr.event = UWA_DM_API_TEST_UWB_LOOPBACK_EVT;
-    p_msg->length = psduLen;
-    p_msg->p_data = (uint8_t*)(p_msg + 1);
-    if ((psduLen > 0) && (psduData != NULL)) {
-      memcpy(p_msg->p_data, psduData, psduLen);
-    }
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_RxTest
-**
-** Description      This function is called to trigger the Rx Test.
-**                  The result is reported with an UWA_DM_TEST_RX_RSP_EVT in the
-**                  tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if Per Session stopped successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_RxTest() {
-  tUWA_DM_API_TEST_RX* p_msg;
-
-  UCI_TRACE_I("UWA_RxTest()");
-
-  p_msg = (tUWA_DM_API_TEST_RX*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_TEST_STOP_SESSION));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_TEST_RX_EVT;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_TestStopSession
-**
-** Description      This function is called to stop the ongoing test session.
-**                  The result is reported with an
-**                  UWA_DM_TEST_STOP_SESSION_RSP_EVT in the
-**                  tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if Per Session stopped successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_TestStopSession() {
-  tUWA_DM_API_TEST_STOP_SESSION* p_msg;
-
-  UCI_TRACE_I("UWA_TestStopSession()");
-
-  p_msg = (tUWA_DM_API_TEST_STOP_SESSION*)phUwb_GKI_getbuf(
-      sizeof(tUWA_DM_API_TEST_STOP_SESSION));
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_TEST_STOP_SESSION_EVT;
-    uwa_sys_sendmsg(p_msg);
-    return (UWA_STATUS_OK);
-  }
-  return (UWA_STATUS_FAILED);
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SendRawVsCommand
-**
-** Description      This function is called to send raw Vendor Specific
-**                  command to UWBS.
-**
-**                  cmd_params_len  - The command parameter len
-**                  p_cmd_params    - The command parameter
-**                  p_cback         - The callback function to receive the
-**                                    command
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_SendRawCommand(uint16_t cmd_params_len, uint8_t* p_cmd_params,
-                               tUWA_RAW_CMD_CBACK* p_cback) {
-  if (cmd_params_len == 0x00 || p_cmd_params == NULL || p_cback == NULL) {
-    return UWA_STATUS_INVALID_PARAM;
-  }
-  uint16_t size = (uint16_t)(sizeof(tUWA_DM_API_SEND_RAW) + cmd_params_len);
-  tUWA_DM_API_SEND_RAW* p_msg = (tUWA_DM_API_SEND_RAW*)phUwb_GKI_getbuf(size);
-
-  if (p_msg != NULL) {
-    p_msg->hdr.event = UWA_DM_API_SEND_RAW_EVT;
-    p_msg->p_cback = p_cback;
-    if (cmd_params_len && p_cmd_params) {
-      p_msg->cmd_params_len = cmd_params_len;
-      p_msg->p_cmd_params = (uint8_t*)(p_msg + 1);
-      memcpy(p_msg->p_cmd_params, p_cmd_params, cmd_params_len);
-    }
-    uwa_sys_sendmsg(p_msg);
-
-    return UWA_STATUS_OK;
-  }
-
-  return UWA_STATUS_FAILED;
-}
-
-/*******************************************************************************
-**
-** Function         UWA_SendUwbDataFrame
-**
-** Description      This function is called to send UWB data over UWB RF interafce  .
-**
-** Returns          UWA_STATUS_OK if data sucessfully accepeted by UWB subsystem
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-tUWA_STATUS UWA_SendUwbData(uint32_t session_id,
-                            uint8_t* p_addr, uint8_t dest_end_point, uint8_t sequence_num,
-                            uint16_t data_len,
-                            uint8_t* p_data) {
-  tUWA_DM_API_SEND_DATA_FRAME* p_msg;
-  UCI_TRACE_I("UWA_SendUwbDataFrame: data_len = %d", data_len);
-  if ((data_len == 0) || (p_data == nullptr) || (p_addr == nullptr))
-    return (UWA_STATUS_FAILED);
-
-  p_msg = (tUWA_DM_API_SEND_DATA_FRAME*)phUwb_GKI_getbuf(sizeof(tUWA_DM_API_SEND_DATA_FRAME) + data_len);
-  if (p_msg != nullptr) {
-    p_msg->hdr.event = UWA_DM_API_SEND_DATA_FRAME_EVT;
-    p_msg->session_id = session_id;
-    memcpy(p_msg->p_addr, p_addr, EXTENDED_ADDRESS_LEN);
-    p_msg->dest_end_point = dest_end_point;
-    p_msg->sequence_num = sequence_num;
-    p_msg->data_len = data_len;
-
-    p_msg->p_data = (uint8_t*)(p_msg + 1);
-    memcpy(p_msg->p_data, p_data, data_len);
-
-    uwa_sys_sendmsg(p_msg);
-
-    return (UWA_STATUS_OK);
-  }
-  return UWA_STATUS_FAILED;
-
-}
diff --git a/src/uwa/dm/uwa_dm_main.cc b/src/uwa/dm/uwa_dm_main.cc
deleted file mode 100755
index 7502e56..0000000
--- a/src/uwa/dm/uwa_dm_main.cc
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021-2022 NXP.
- *
- * 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.
- */
-
-/******************************************************************************
- *
- *  This is the main implementation file for the UWA device manager.
- *
- ******************************************************************************/
-#include <string>
-
-#include "uci_log.h"
-#include "uwa_api.h"
-#include "uwa_dm_int.h"
-#include "uwb_osal_common.h"
-
-/*****************************************************************************
-** Constants and types
-*****************************************************************************/
-static const tUWA_SYS_REG uwa_dm_sys_reg = {uwa_dm_sys_enable, uwa_dm_evt_hdlr,
-                                            uwa_dm_sys_disable};
-tUWA_DM_CB uwa_dm_cb = {};
-
-#define UWA_DM_NUM_ACTIONS (UWA_DM_MAX_EVT & 0x00ff)
-
-/* type for action functions */
-typedef bool (*tUWA_DM_ACTION)(tUWA_DM_MSG* p_data);
-
-/* action function list */
-const tUWA_DM_ACTION uwa_dm_action[] = {
-    /* device manager local device API events */
-    uwa_dm_enable,                    /* UWA_DM_API_ENABLE_EVT            */
-    uwa_dm_disable,                   /* UWA_DM_API_DISABLE_EVT           */
-    uwa_dm_act_get_device_info,       /* UWA_DM_API_GET_DEVICE_INFO_EVT  */
-    uwa_dm_set_core_config,           /* UWA_DM_API_SET_CORE_CONFIG_EVT   */
-    uwa_dm_get_core_config,           /* UWA_DM_API_GET_CORE_CONFIG_EVT   */
-    uwa_dm_act_device_reset,          /* UWA_DM_API_DEVICE_RESET_EVT      */
-    uwa_dm_act_send_session_init,     /* UWA_DM_API_SESSION_INIT_EVT      */
-    uwa_dm_act_send_session_deinit,   /* UWA_DM_API_SESSION_DEINIT_EVT    */
-    uwa_dm_act_get_session_count,     /* UWA_DM_API_SESSION_GET_COUNT_EVT */
-    uwa_dm_act_app_set_config,        /* UWA_DM_API_SET_APP_CONFIG_EVT    */
-    uwa_dm_act_app_get_config,        /* UWA_DM_API_GET_APP_CONFIG_EVT    */
-    uwa_dm_act_start_range_session,   /* UWA_DM_API_START_RANGE_EVT       */
-    uwa_dm_act_stop_range_session,    /* UWA_DM_API_STOP_RANGE_EVT        */
-    uwa_dm_act_send_raw_cmd,          /* UWA_DM_API_SEND_RAW_EVT          */
-    uwa_dm_act_get_range_count,       /* UWA_DM_API_GET_RANGE_COUNT_EVT   */
-    uwa_dm_act_get_session_status,    /* UWA_DM_API_GET_SESSION_STATUS_EVT   */
-    uwa_dm_act_get_device_capability, /* UWA_DM_API_CORE_GET_DEVICE_CAPABILITY_EVT
-                                       */
-    uwa_dm_act_multicast_list_update, /* UWA_DM_API_SESSION_UPDATE_MULTICAST_LIST_EVT */
-    uwa_dm_act_set_country_code,      /* UWA_DM_API_SET_COUNTRY_CODE_EVT */
-    uwa_dm_act_send_blink_data,       /* UWA_DM_API_SEND_BLINK_DATA_EVT */
-    /*  local API events for RF test functionality */
-    uwa_dm_act_test_set_config,   /* UWA_DM_API_TEST_SET_CONFIG_EVT  */
-    uwa_dm_act_test_get_config,   /* UWA_DM_API_TEST_GET_CONFIG_EVT  */
-    uwa_dm_act_test_periodic_tx,  /* UWA_DM_API_TEST_PERIODIC_TX_EVT    */
-    uwa_dm_act_test_per_rx,       /* UWA_DM_API_TEST_PER_RX_EVT     */
-    uwa_dm_act_test_uwb_loopback, /* UWA_DM_API_TEST_UWB_LOOPBACK_EVT */
-    uwa_dm_act_test_rx,           /* UWA_DM_API_TEST_RX_EVT */
-    uwa_dm_act_test_stop_session, /* UWA_DM_API_TEST_STOP_SESSION_EVT     */
-    /* API events for Data tranfer handling */
-    uwa_dm_act_send_data_frame,    /* UWA_DM_API_SEND_DATA_FRAME_EVT */
-    uwa_dm_act_configure_dt_anchor_rr_rdm, /* UWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_EVT */
-    uwa_dm_act_update_active_range_round_index /* UWA_DM_API_UPDATE_ACTIVE_RNG_INDEX_EVT */
-};
-
-/*****************************************************************************
-** Local function prototypes
-*****************************************************************************/
-std::string uwa_dm_evt_2_str(uint16_t event);
-/*******************************************************************************
-**
-** Function         uwa_dm_init
-**
-** Description      Initialises the UWB device manager
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_dm_init(void) {
-  UCI_TRACE_I(__func__);
-  /* register message handler on UWA SYS */
-  memset(&uwa_dm_cb, 0, sizeof(tUWA_DM_CB));
-  uwa_sys_register(UWA_ID_DM, &uwa_dm_sys_reg);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_evt_hdlr
-**
-** Description      Event handling function for DM
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-bool uwa_dm_evt_hdlr(UWB_HDR* p_msg) {
-  bool freebuf = true;
-  uint16_t event = p_msg->event & 0x00ff;
-
-  UCI_TRACE_I("event: %s (0x%02x)", uwa_dm_evt_2_str(event).c_str(), event);
-  /* execute action functions */
-  if (event < UWA_DM_NUM_ACTIONS) {
-    freebuf = (*uwa_dm_action[event])((tUWA_DM_MSG*)p_msg);
-  }
-  return freebuf;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_sys_disable
-**
-** Description      This function is called after all subsystems have been
-**                  disabled.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_dm_sys_disable(void) {
-  /* Disable the DM sub-system */
-  uwa_dm_disable_complete();
-}
-
-/*******************************************************************************
-**
-** Function         uwa_dm_uwb_revt_2_str
-**
-** Description      convert uwb revt to string
-**
-*******************************************************************************/
-std::string uwa_dm_evt_2_str(uint16_t event) {
-  switch (UWA_SYS_EVT_START(UWA_ID_DM) | event) {
-    case UWA_DM_API_ENABLE_EVT:
-      return "UWA_DM_API_ENABLE_EVT";
-
-    case UWA_DM_API_DISABLE_EVT:
-      return "UWA_DM_API_DISABLE_EVT";
-
-    case UWA_DM_API_GET_DEVICE_INFO_EVT:
-      return "UWA_DM_API_GET_DEVICE_INFO_EVT";
-
-    case UWA_DM_API_SET_CORE_CONFIG_EVT:
-      return "UWA_DM_API_SET_CORE_CONFIG_EVT";
-
-    case UWA_DM_API_GET_CORE_CONFIG_EVT:
-      return "UWA_DM_API_GET_CORE_CONFIG_EVT";
-
-    case UWA_DM_API_DEVICE_RESET_EVT:
-      return "UWA_DM_API_DEVICE_RESET_EVT";
-
-    case UWA_DM_API_SESSION_INIT_EVT:
-      return "UWA_DM_API_SESSION_INIT_EVT";
-
-    case UWA_DM_API_SESSION_DEINIT_EVT:
-      return "UWA_DM_API_SESSION_DEINIT_EVT";
-
-    case UWA_DM_API_SESSION_GET_COUNT_EVT:
-      return "UWA_DM_API_SESSION_GET_COUNT_EVT";
-
-    case UWA_DM_API_SET_APP_CONFIG_EVT:
-      return "UWA_DM_API_SET_APP_CONFIG_EVT";
-
-    case UWA_DM_API_GET_APP_CONFIG_EVT:
-      return "UWA_DM_API_GET_APP_CONFIG_EVT";
-
-    case UWA_DM_API_START_RANGE_EVT:
-      return "UWA_DM_API_START_RANGE_EVT";
-
-    case UWA_DM_API_STOP_RANGE_EVT:
-      return "UWA_DM_API_STOP_RANGE_EVT";
-
-    case UWA_DM_API_SEND_RAW_EVT:
-      return "UWA_DM_API_SEND_RAW_EVT";
-
-    case UWA_DM_API_GET_RANGE_COUNT_EVT:
-      return "UWA_DM_API_GET_RANGE_COUNT_EVT";
-
-    case UWA_DM_API_GET_SESSION_STATUS_EVT:
-      return "UWA_DM_API_GET_SESSION_STATUS_EVT";
-
-    case UWA_DM_API_TEST_SET_CONFIG_EVT:
-      return "UWA_DM_API_TEST_SET_CONFIG_EVT";
-
-    case UWA_DM_API_TEST_GET_CONFIG_EVT:
-      return "UWA_DM_API_TEST_GET_CONFIG_EVT";
-
-    case UWA_DM_API_TEST_PERIODIC_TX_EVT:
-      return "UWA_DM_API_TEST_PERIODIC_TX_EVT";
-
-    case UWA_DM_API_TEST_PER_RX_EVT:
-      return "UWA_DM_API_TEST_PER_RX_EVT";
-
-    case UWA_DM_API_TEST_STOP_SESSION_EVT:
-      return "UWA_DM_API_TEST_STOP_SESSION_EVT";
-
-    case UWA_DM_API_TEST_RX_EVT:
-      return "UWA_DM_API_TEST_RX_EVT";
-  }
-
-  return "Unknown or Vendor Specific";
-}
diff --git a/src/uwa/include/uwa_api.h b/src/uwa/include/uwa_api.h
deleted file mode 100755
index 0e14a4a..0000000
--- a/src/uwa/include/uwa_api.h
+++ /dev/null
@@ -1,969 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2022 NXP
- *
- *  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.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
- *  This is the public interface file for UWA, NXP's UWB application
- *  layer for mobile phones/IOT devices.
- *
- ******************************************************************************/
-#ifndef UWA_API_H
-#define UWA_API_H
-
-#include "uci_defs.h"
-#include "uwb_api.h"
-#include "uwb_gki.h"
-#include "uwb_hal_api.h"
-#include "uwb_target.h"
-
-/*****************************************************************************
-**  Constants and data types
-*****************************************************************************/
-
-/* UWA API return status codes */
-/* Command succeeded    */
-#define UWA_STATUS_OK UCI_STATUS_OK
-/* Command is rejected. */
-#define UWA_STATUS_REJECTED UCI_STATUS_REJECTED
-/* failed               */
-#define UWA_STATUS_FAILED UCI_STATUS_FAILED
-/* Syntax error         */
-#define UWA_STATUS_SYNTAX_ERROR UCI_STATUS_SYNTAX_ERROR
-/* Invalid Parameter    */
-#define UWA_STATUS_INVALID_PARAM UCI_STATUS_INVALID_PARAM
-/* Invalid Range    */
-#define UWA_STATUS_INVALID_RANGE UCI_STATUS_INVALID_RANGE
-/*Invalid payload size in UCI packet */
-#define UWA_STATUS_INVALID_MSG_SIZE UCI_STATUS_INVALID_MSG_SIZE
-/* Unknown GID          */
-#define UWA_STATUS_UNKNOWN_GID UCI_STATUS_UNKNOWN_GID
-/* Unknown OID          */
-#define UWA_STATUS_UNKNOWN_OID UCI_STATUS_UNKNOWN_OID
-/* Read only            */
-#define UWA_STATUS_READ_ONLY UCI_STATUS_READ_ONLY
-/* retry the command */
-#define UWA_STATUS_COMMAND_RETRY UCI_STATUS_COMMAND_RETRY
-
-/* UWA session Specific status code */
-/* session is not exist in UWBD */
-#define UWA_STATUS_SESSSION_NOT_EXIST UCI_STATUS_SESSSION_NOT_EXIST
-/* Session is already exist/duplicate */
-#define UWA_STATUS_SESSSION_DUPLICATE UCI_STATUS_SESSSION_DUPLICATE
-/* Session is in active state */
-#define UWA_STATUS_SESSSION_ACTIVE UCI_STATUS_SESSSION_ACTIVE
-/* Maximum sessions are reached */
-#define UWA_STATUS_MAX_SESSSIONS_EXCEEDED UCI_STATUS_MAX_SESSSIONS_EXCEEDED
-/*session not configured */
-#define UWA_STATUS_SESSION_NOT_CONFIGURED UCI_STATUS_SESSION_NOT_CONFIGURED
-
-/* UWA Ranging Session Specific Status Codes */
-/* Ranging tx failed */
-#define UWA_STATUS_RANGING_TX_FAILED UCI_STATUS_RANGING_TX_FAILED
-/* Ranging rx timeout */
-#define UWA_STATUS_RANGING_RX_TIMEOUT UCI_STATUS_RANGING_RX_TIMEOUT
-/* Physical layer decoding failed */
-#define UWA_STATUS_RANGING_RX_PHY_DEC_FAILED \
-  UCI_STATUS_RANGING_RX_PHY_DEC_FAILED
-/* Physical layer TOA failed */
-#define UWA_STATUS_RANGING_RX_PHY_TOA_FAILED \
-  UCI_STATUS_RANGING_RX_PHY_TOA_FAILED
-/* Physical layer STS failed */
-#define UWA_STATUS_RANGING_RX_PHY_STS_FAILED \
-  UCI_STATUS_RANGING_RX_PHY_STS_FAILED
-/* MAC decoding failed */
-#define UWA_STATUS_RANGING_RX_MAC_DEC_FAILED \
-  UCI_STATUS_RANGING_RX_MAC_DEC_FAILED
-/* MAC information decoding failed */
-#define UWA_STATUS_RANGING_RX_MAC_IE_DEC_FAILED \
-  UCI_STATUS_RANGING_RX_MAC_IE_DEC_FAILED
-/* MAC information missing */
-#define UWA_STATUS_RANGING_RX_MAC_IE_MISSING \
-  UCI_STATUS_RANGING_RX_MAC_IE_MISSING
-
-/* UWA Data Session Specific Status Codes */
-#define UWA_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED \
-  UCI_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED
-#define UWA_STATUS_DATA_RX_CRC_ERROR UCI_STATUS_DATA_RX_CRC_ERROR
-
-typedef uint8_t tUWA_STATUS;
-
-/* Handle for UWA registrations and connections */
-typedef uint16_t tUWA_HANDLE;
-#define UWA_HANDLE_INVALID (0xFFFF)
-
-/* UWA_DM callback events */
-
-#define UWA_DM_EVENT 0x00
-#define UWA_TEST_DM_EVENT 0xA0
-
-enum {
-  UWA_DM_ENABLE_EVT = UWA_DM_EVENT,    /* Result of UWA_Enable             */
-  UWA_DM_DISABLE_EVT,                  /* Result of UWA_Disable            */
-  UWA_DM_REGISTER_EXT_CB_EVT,          /* Result of UWA Register Ext Callback */
-  UWA_DM_UWBS_RESP_TIMEOUT_EVT,        /* Result of command response timeout */
-  UWA_DM_UWBS_ERROR_EVT,               /* Result of UWB error ntf */
-  UWA_DM_CORE_GET_DEVICE_INFO_RSP_EVT, /* Result of get device info */
-  UWA_DM_CORE_SET_CONFIG_RSP_EVT,     /* Result of UWA_SetCoreConfig          */
-  UWA_DM_CORE_GET_CONFIG_RSP_EVT,     /* Result of UWA_GetCoreConfig          */
-  UWA_DM_DEVICE_RESET_RSP_EVT,        /* Result of Core Dev Reset */
-  UWA_DM_DEVICE_STATUS_NTF_EVT,       /* Result of device status ntf */
-  UWA_DM_CORE_GEN_ERR_STATUS_EVT,     /* Result of core generic error status */
-  UWA_DM_SESSION_INIT_RSP_EVT,        /* Result of session Init cmd */
-  UWA_DM_SESSION_DEINIT_RSP_EVT,      /* Result of session Deinit cmd */
-  UWA_DM_SESSION_STATUS_NTF_EVT,      /* Result of session NTF  */
-  UWA_DM_SESSION_SET_CONFIG_RSP_EVT,  /* Result of setAppConfig */
-  UWA_DM_SESSION_GET_CONFIG_RSP_EVT,  /* Result of getAppConfig */
-  UWA_DM_SESSION_GET_COUNT_RSP_EVT,   /* Result of get session count */
-  UWA_DM_SESSION_GET_STATE_RSP_EVT,   /* Result of get session count */
-  UWA_DM_RANGE_START_RSP_EVT,         /* Result of range start cmd */
-  UWA_DM_RANGE_STOP_RSP_EVT,          /* Result of range start cmd */
-  UWA_DM_RANGE_DATA_NTF_EVT,          /* Result of range data ntf */
-  UWA_DM_GET_RANGE_COUNT_RSP_EVT,     /* Result of range get count */
-  UWA_DM_GET_CORE_DEVICE_CAP_RSP_EVT, /* Results of UWA_GetCoreDeviceCapability
-                                       */
-  UWA_DM_SESSION_MC_LIST_UPDATE_RSP_EVT, /* Session Update Multicast List resp
-                                            event*/
-  UWA_DM_SESSION_MC_LIST_UPDATE_NTF_EVT, /* Session Update Multicast List ntf
-                                            event*/
-  UWA_DM_SEND_BLINK_DATA_RSP_EVT,        /* Blink Data Tx event*/
-  UWA_DM_SEND_BLINK_DATA_NTF_EVT,        /* Blink Data Tx ntf event*/
-  UWA_DM_CONFORMANCE_NTF_EVT,            /* Conformance Test Ntf Event */
-  UWA_DM_SET_COUNTRY_CODE_RSP_EVT,       /* Country code update resp event */
-  UWA_VENDOR_SPECIFIC_UCI_NTF_EVT,       /* Proprietary Ntf Event */
-  UWA_DM_SEND_DATA_STATUS_EVT,           /* data status EVT */
-  UWA_DM_SEND_DATA_PACKET_RSP_EVT,       /* data reception status by UWBS */
-  UWA_DM_DATA_TRANSFER_STATUS_NTF_EVT,   /* data transfer status over UWB */
-  UWA_DM_DATA_RECV_EVT,                   /* Recieved data over UWB */
-  UWA_DM_SESSION_CONFIGURE_DT_ANCHOR_RR_RDM_REVT, /* Result of Configure DT Anchor RR RDM List Cmd */
-  UWA_DM_SESSION_ACTIVE_ROUNDS_INDEX_UPDATE_REVT, /* Result of Update Active Ranging Index Cmd */
-};
-
-/* UWA_DM callback events for UWB RF events */
-
-enum {
-  UWA_DM_TEST_SET_CONFIG_RSP_EVT =
-      UWA_TEST_DM_EVENT,            /* Results of set test config event*/
-  UWA_DM_TEST_GET_CONFIG_RSP_EVT,   /* Results of get test config event*/
-  UWA_DM_TEST_STOP_SESSION_RSP_EVT, /* Result of test session stop response */
-  UWA_DM_TEST_PERIODIC_TX_RSP_EVT,  /* Results of periodic tx response event*/
-  UWA_DM_TEST_PERIODIC_TX_NTF_EVT,  /* Results of periodic tx test NTF event*/
-  UWA_DM_TEST_PER_RX_RSP_EVT,       /* Results of per rx response event*/
-  UWA_DM_TEST_PER_RX_NTF_EVT,       /* Results of per rx test NTF  event*/
-  UWA_DM_TEST_LOOPBACK_RSP_EVT,     /* Rf Loop Back Test resp event*/
-  UWA_DM_TEST_LOOPBACK_NTF_EVT,     /* Rf Loop Back Test NTF event*/
-  UWA_DM_TEST_RX_RSP_EVT,           /* Rf RX Test resp event*/
-  UWA_DM_TEST_RX_NTF_EVT            /* Rf RX Test ntf event*/
-};
-
-/* UCI Parameter IDs */
-typedef uint8_t tUWA_PMID;
-
-/* Data for UWA_DM_DEVICE_STATUS_NTF_EVT */
-typedef struct {
-  uint8_t status; /* device status             */
-} tUWA_DEVICE_STATUS_NTF;
-
-/* Data for UWA_DM_CORE_GEN_ERR_STATUS_EVT */
-typedef struct {
-  uint8_t status; /* generic error             */
-} tUWA_CORE_GEN_ERR_STATUS_NTF;
-
-/* the data type associated with UWB_GET_DEVICE_INFO_REVT */
-typedef struct {
-  uint8_t status;
-  uint16_t uci_version;
-  uint16_t mac_version;
-  uint16_t phy_version;
-  uint16_t uciTest_version;
-  uint8_t vendor_info_len;
-  uint8_t vendor_info[UCI_MAX_FRAGMENT_BUFF_SIZE];
-} tUWA_GET_DEVICE_INFO_REVT;
-
-/* Data for UWA_DM_CORE_SET_CONFIG_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status;                   /* UWA_STATUS_OK if successful  */
-  uint8_t num_param_id;                 /* Number of rejected Param ID  */
-  tUWA_PMID param_ids[UWB_MAX_NUM_IDS]; /* Rejected Param ID            */
-  uint16_t tlv_size;                    /* The length of TLV */
-} tUWA_SET_CORE_CONFIG;
-
-/* Data for UWA_DM_CORE_GET_CONFIG_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status; /* UWA_STATUS_OK if successful              */
-  uint8_t no_of_ids;
-  uint8_t param_tlvs[UCI_MAX_PAYLOAD_SIZE]; /* TLV (Parameter ID-Len-Value byte
-                                               stream) */
-  uint16_t tlv_size; /* The length of TLV                        */
-} tUWA_GET_CORE_CONFIG;
-
-/* Data for UWA_DM_DEVICE_RESET_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status; /* UWA_STATUS_OK if successful  */
-} tUWA_DEVICE_RESET;
-
-/* Data for UWA_DM_SESSION_GET_COUNT_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status; /* device status             */
-  uint8_t count;      /* active session count      */
-} tUWA_SESSION_GET_COUNT;
-
-/* Data for UWA_DM_SESSION_GET_STATE_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status;    /* device status             */
-  uint8_t session_state; /* current session state      */
-} tUWA_SESSION_GET_STATE;
-
-/* Data for UWA_DM_SESSION_GET_CONFIG_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status; /* UWA_STATUS_OK if successful              */
-  uint8_t tlv_size;   /* The length of TLV                        */
-  uint8_t param_tlvs[UCI_MAX_PAYLOAD_SIZE]; /* TLV (Parameter ID-Len-Value byte
-                                               stream) */
-} tUWA_GET_SESSION_APP_CONFIG;
-
-/* Data for UWA_DM_SESSION_SET_CONFIG_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status;                   /* UWA_STATUS_OK if successful  */
-  uint8_t num_param_id;                 /* Number of rejected Param ID  */
-  tUWA_PMID param_ids[UWB_MAX_NUM_IDS]; /* Rejected Param ID            */
-} tUWA_SET_SESSION_APP_CONFIG;
-
-/* the data type associated with UWB_SESSION_STATUS_NTF_REVT */
-typedef struct {
-  uint32_t session_id;
-  uint8_t state;
-  uint8_t reason_code;
-} tUWA_SESSION_STATUS_NTF_REVT;
-
-/* Data for UWA_DM_RANGE_DATA_NTF_EVT */
-/* the data type associated with UWB_RANGE_DATA_REVT */
-typedef struct {
-  uint8_t mac_addr[8];
-  uint8_t status;
-  uint8_t nLos; /* non line of sight */
-  uint16_t distance;
-  uint16_t aoa_azimuth;
-  uint8_t aoa_azimuth_FOM;
-  uint16_t aoa_elevation;
-  uint8_t aoa_elevation_FOM;
-  uint16_t aoa_dest_azimuth;
-  uint8_t aoa_dest_azimuth_FOM;
-  uint16_t aoa_dest_elevation;
-  uint8_t aoa_dest_elevation_FOM;
-  uint8_t slot_index;
-  uint8_t rssi;
-  uint8_t rfu[11];
-} tUWA_TWR_RANGING_MEASR;
-
-typedef struct {
-  uint8_t mac_addr[8];
-  uint8_t message_control;
-  uint8_t frame_type;
-  uint8_t nLos; /* non line of sight */
-  uint16_t aoa_azimuth;
-  uint8_t aoa_azimuth_FOM;
-  uint16_t aoa_elevation;
-  uint8_t aoa_elevation_FOM;
-  uint32_t frame_number;
-  uint8_t rxTimeStamp[8];
-  uint8_t ulTdoa_device_id[8];
-  uint8_t txTimeStamp[8];
-} tUWA_TDoA_RANGING_MEASR;
-
-/* the data type associated with vendor notification */
-typedef struct {
-  uint16_t len;
-  uint8_t data[UCI_VENDOR_INFO_MAX_SIZE];
-}tUWA_VENDOR_SPECIFIC_NTF;
-
-typedef struct {
-  uint8_t mac_addr[8];
-  uint8_t status;
-  uint8_t nLos;
-  uint8_t frame_seq_num;
-  uint16_t block_index;
-  uint16_t aoa_azimuth;
-  uint8_t aoa_azimuth_FOM;
-  uint16_t aoa_elevation;
-  uint8_t aoa_elevation_FOM;
-} tUWA_OWR_WITH_AOA_RANGING_MEASR;
-
-typedef struct {
-  uint8_t mac_addr[8];
-  uint8_t status;
-  uint8_t message_type;
-  uint16_t message_control;
-  uint16_t block_index;
-  uint8_t round_index;
-  uint8_t nLos;
-  uint16_t aoa_azimuth;
-  uint8_t aoa_azimuth_FOM;
-  uint16_t aoa_elevation;
-  uint8_t aoa_elevation_FOM;
-  uint8_t txTimeStamp[8];
-  uint8_t rxTimeStamp[8];
-  uint16_t cfo_anchor;
-  uint16_t cfo;
-  uint32_t initiator_reply_time;
-  uint32_t responder_reply_time;
-  uint16_t initiator_responder_TOF;
-  uint8_t anchor_location[12];
-  uint8_t active_ranging_round[15];
-} tUWA_DLTDOA_RANGING_MEASR;
-
-typedef union {
-  tUWA_TWR_RANGING_MEASR twr_range_measr[MAX_NUM_RESPONDERS];
-  tUWA_TDoA_RANGING_MEASR tdoa_range_measr[MAX_NUM_OF_TDOA_MEASURES];
-  tUWA_DLTDOA_RANGING_MEASR dltdoa_range_measr[MAX_NUM_OF_DLTDOA_MEASURES];
-  tUWA_OWR_WITH_AOA_RANGING_MEASR owr_with_aoa_range_measr;
-} tUWA_RANGING_MEASR;
-
-typedef struct {
-  uint16_t ranging_data_len;
-  uint32_t seq_counter;
-  uint32_t session_id;
-  uint8_t rcr_indication;
-  uint32_t curr_range_interval;
-  uint8_t ranging_measure_type;
-  uint8_t rfu;
-  uint8_t mac_addr_mode_indicator;
-  uint8_t reserved[8];
-  uint8_t no_of_measurements;
-  tUWA_RANGING_MEASR ranging_measures;
-  tUWA_VENDOR_SPECIFIC_NTF vendor_specific_ntf;
-} tUWA_RANGE_DATA_NTF;
-
-/* the data type associated with UWB_GET_RANGE_COUNT_REVT */
-typedef struct {
-  uint8_t status;
-  uint32_t count;
-} tUWA_RANGE_GET_RNG_COUNT_REVT;
-
-/* Data for UWA_DM_GET_CORE_DEVICE_CAP_RSP_EVT */
-typedef struct {
-  tUWA_STATUS status; /* UWA_STATUS_OK if successful              */
-  uint8_t no_of_tlvs;
-  uint8_t tlv_buffer[UCI_MAX_PAYLOAD_SIZE]; /* TLV (Parameter ID-Len-Value byte
-                                               stream) */
-  uint16_t tlv_buffer_len; /* The length of TLV                        */
-} tUWA_GET_CORE_DEVICE_CAPABILITY;
-
-/* the data type associated with UWB_SESSION_UPDATE_MULTICAST_LIST_NTF */
-typedef struct {
-  uint32_t session_id;
-  uint8_t remaining_list;
-  uint8_t no_of_controlees;
-  uint16_t controlee_mac_address_list[MAX_NUM_CONTROLLEES];
-  uint32_t subsession_id_list[MAX_NUM_CONTROLLEES];
-  uint8_t status_list[MAX_NUM_CONTROLLEES];
-} tUWA_SESSION_UPDATE_MULTICAST_LIST_NTF;
-
-/* the data type associated with UWB_BLINK_DATA_TX_NTF */
-typedef struct {
-  uint8_t repetition_count_status; /* Status to indicate Repetition Count is
-                                      exhausted */
-} tUWA_SEND_BLINK_DATA_NTF;
-
-/* the data type associated with UWB_DATA_TRANSFER_STATUS_NTF_REVT */
-typedef struct {
-  uint32_t session_id;
-  uint8_t sequence_num;
-  uint8_t status;
-} tUWA_DATA_TRANSFER_STATUS_NTF_REVT;
-
-/* the data type associated with UWA_DM_DATA_RECV_REVT */
-typedef struct {
-  uint32_t session_id;
-  uint8_t status;
-  uint32_t sequence_num;
-  uint8_t address[EXTENDED_ADDRESS_LEN];
-  uint8_t source_end_point;
-  uint8_t dest_end_point;
-  uint16_t data_len;
-  uint8_t data[UCI_MAX_DATA_SIZE];
-} tUWA_RX_DATA_REVT;
-
-/* the data type associated with UWB_CONFORMANCE_TEST_DATA */
-typedef struct {
-  uint16_t length;
-  uint8_t data[CONFORMANCE_TEST_MAX_UCI_PKT_LENGTH];
-} tUWA_CONFORMANCE_TEST_DATA;
-
-/* the data type associated with UWB_SESSION_ACTIVE_ROUNDS_INDEX_UPDATE_REVT */
-typedef struct {
-  uint8_t status;
-  uint16_t len;
-  uint8_t rng_round_index[255];
-}tUWA_UPDATE_RANGE_ROUND_INDEX_REVT;
-
-/* the data type associated with UWB_SESSION_CONFIGURE_DT_ANCHOR_RR_RDM_REVT */
-typedef struct {
-  uint8_t status;
-  uint16_t len;
-  uint8_t rng_round_indexs[255];
-}tUWA_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_REVT;
-
-/* Union of all DM callback structures */
-typedef union {
-  tUWA_STATUS status;                /* UWA_DM_ENABLE_EVT        */
-  tUWA_DEVICE_STATUS_NTF dev_status; /*UWA_DM_DEVICE_STATUS_NTF_EVT */
-  tUWA_CORE_GEN_ERR_STATUS_NTF
-      sCore_gen_err_status;        /*UWA_DM_CORE_GEN_ERR_STATUS_EVT */
-  tUWA_DEVICE_RESET sDevice_reset; /* UWA_DM_DEVICE_RESET_RSP_EVT    */
-  tUWA_GET_DEVICE_INFO_REVT
-      sGet_device_info; /* UWA_DM_CORE_GET_DEVICE_INFO_RSP_EVT */
-  tUWA_SET_CORE_CONFIG sCore_set_config; /* UWA_DM_CORE_SET_CONFIG_RSP_EVT    */
-  tUWA_GET_CORE_CONFIG sCore_get_config; /* UWA_DM_CORE_GET_CONFIG_RSP_EVT    */
-  tUWA_GET_CORE_CONFIG
-      sApp_get_config; /* UWA_DM_SESSION_GET_CONFIG_RSP_EVT    */
-  tUWA_SET_CORE_CONFIG
-      sApp_set_config; /* UWA_DM_SESSION_SET_CONFIG_RSP_EVT    */
-  tUWA_SESSION_STATUS_NTF_REVT
-      sSessionStatus; /* UWA_DM_SESSION_STATUS_NTF_EVT */
-  tUWA_SESSION_GET_COUNT
-      sGet_session_cnt; /* UWA_DM_SESSION_GET_COUNT_RSP_EVT    */
-  tUWA_SESSION_GET_STATE
-      sGet_session_state;          /* UWA_DM_SESSION_GET_STATE_RSP_EVT    */
-  tUWA_RANGE_DATA_NTF sRange_data; /*UWA_DM_RANGE_DATA_NTF_EVT */
-  tUWA_RANGE_GET_RNG_COUNT_REVT
-      sGet_range_cnt; /*UWA_DM_GET_RANGE_COUNT_RSP_EVT */
-  tUWA_GET_CORE_DEVICE_CAPABILITY
-      sGet_device_capability; /*UWA_DM_GET_CORE_DEVICE_CAP_RSP_EVT*/
-  tUWA_SESSION_UPDATE_MULTICAST_LIST_NTF
-      sMulticast_list_ntf; /*UWA_DM_SESSION_MC_LIST_UPDATE_NTF_EVT*/
-  tUWA_SEND_BLINK_DATA_NTF sBlink_data_ntf; /*UWA_DM_SEND_BLINK_DATA_NTF_EVT*/
-  tUWA_DATA_TRANSFER_STATUS_NTF_REVT sData_xfer_status ; /*UWA_DATA_TRANSFER_STATUS_NTF_REVT*/
-  tUWA_RX_DATA_REVT sRcvd_data; /*UWA_DM_DATA_RECV_REVT */
-  tUWA_UPDATE_RANGE_ROUND_INDEX_REVT sRange_round_index; /*UWA_DM_UPDATE_RANGE_ROUND_INDEX_REVT */
-  tUWA_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_REVT sConfigure_dt_anchor_rr_rdm_list; /*UWA_SESSION_CONFIGURE_DT_ANCHOR_RR_RDM_REVT */
-  tUWA_CONFORMANCE_TEST_DATA sConformance_ntf; /* UWA_DM_CONFORMANCE_NTF_EVT */
-  tUWA_VENDOR_SPECIFIC_NTF vendor_specific_ntf; /*Vendor Specific ntf data */
-  void* p_vs_evt_data;                         /* Vendor-specific evt data */
-} tUWA_DM_CBACK_DATA;
-
-/* Data for UWA_DM_RF_TEST_DATA_EVT */
-typedef struct {
-  uint16_t length;
-  uint8_t data[UCI_MAX_PAYLOAD_SIZE];
-} tUWA_RF_TEST_DATA;
-
-/* Union of all DM callback structures */
-typedef union {
-  tUWA_STATUS status; /*  Response status for RF Test commands        */
-  tUWA_GET_CORE_CONFIG sTest_get_config; /* UWA_DM_TEST_GET_CONFIG_RSP_EVT    */
-  tUWA_SET_CORE_CONFIG sTest_set_config; /* UWA_DM_TEST_SET_CONFIG_RSP_EVT    */
-  tUWA_RF_TEST_DATA rf_test_data;        /*UWA_DM_RF_TEST_DATA_EVT*/
-} tUWA_DM_TEST_CBACK_DATA;
-
-/* UWA_DM callback */
-typedef void(tUWA_DM_CBACK)(uint8_t event, tUWA_DM_CBACK_DATA* p_data);
-typedef void(tUWA_DM_TEST_CBACK)(uint8_t event,
-                                 tUWA_DM_TEST_CBACK_DATA* p_data);
-
-/* UWA_RAW_CMD callback */
-typedef void(tUWA_RAW_CMD_CBACK)(uint8_t event, uint16_t param_len,
-                                 uint8_t* p_param);
-
-/*****************************************************************************
-**  External Function Declarations
-*****************************************************************************/
-
-/*******************************************************************************
-**
-** Function         UWA_Init
-**
-** Description      This function initializes control blocks for UWA
-**
-**                  p_hal_entry_tbl points to a table of HAL entry points
-**
-**                  NOTE: the buffer that p_hal_entry_tbl points must be
-**                  persistent until UWA is disabled.
-**
-**
-** Returns          none
-**
-*******************************************************************************/
-extern void UWA_Init(tHAL_UWB_ENTRY* p_hal_entry_tbl);
-
-/*******************************************************************************
-**
-** Function         UWA_Enable
-**
-** Description      This function enables UWB. Prior to calling UWA_Enable,
-**                  the UWBC must be powered up, and ready to receive commands.
-**                  This function enables the tasks needed by UWB, opens the UCI
-**                  transport, resets the UWB Subsystem, downloads patches to
-**                  the UWBC (if necessary), and initializes the UWB subsystems.
-**l
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_Enable(tUWA_DM_CBACK* p_dm_cback,
-                              tUWA_DM_TEST_CBACK* p_dm_test_cback);
-
-/*******************************************************************************
-**
-** Function         UWA_Disable
-**
-** Description      This function is called to shutdown UWB. The tasks for UWB
-**                  are terminated, and clean up routines are performed. This
-**                  function is typically called during platform shut-down, or
-**                  when UWB is disabled from a settings UI. When the UWB
-**                  shutdown procedure is completed, an UWA_DM_DISABLE_EVT is
-**                  returned to the application using the tUWA_DM_CBACK.
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_Disable(bool graceful);
-
-/*******************************************************************************
-**
-** Function:        UWA_GetDeviceInfo
-**
-** Description:     This function gets the UWB Subsystem Information
-**
-** Returns:         UCI version and manufacturer specific information
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_GetDeviceInfo();
-
-/*******************************************************************************
-**
-** Function         UWA_SetCoreConfig
-**
-** Description      Set the configuration parameters to UWBS. The result is
-**                  reported with an UWA_DM_CORE_SET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SetCoreConfig(tUWA_PMID param_id, uint8_t length,
-                                     uint8_t* p_data);
-
-/*******************************************************************************
-**
-** Function         UWA_GetCoreConfig
-**
-** Description      Get the configuration parameters from UWBS. The result is
-**                  reported with an UWA_DM_CORE_GET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_GetCoreConfig(uint8_t num_ids, tUWA_PMID* p_param_ids);
-
-/*******************************************************************************
-**
-** Function         UWA_SendDeviceReset
-**
-** Description      Send Device Reset Command to UWBS. The result is
-**                  reported with an UWA_DM_DEVICE_RESET_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendDeviceReset(uint8_t resetConfig);
-
-/*******************************************************************************
-**
-** Function         UWA_SendSessionInit
-**
-** Description      This function is called to send session init command.
-**                  The result is reported with an UWA_DM_SESSION_INIT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback
-**
-**                  session id - value of particular session ID
-**                  session type - type of session to start ex: ranging,app etc
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendSessionInit(uint32_t session_id,
-                                       uint8_t sessionType);
-
-/*******************************************************************************
-**
-** Function         UWA_SendSessionDeInit
-**
-** Description      This function is called to send session deinit command.
-**                  The result is reported with an UWA_DM_SESSION_DEINIT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback
-**
-**                  session id - value of particular session ID
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendSessionDeInit(uint32_t session_id);
-
-/*******************************************************************************
-**
-** Function         UWA_GetSessionCount
-**
-** Description      This function is called to send get session count command.
-**                  The result is reported with an
-**                  UWA_DM_SESSION_GET_COUNT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully sent
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_GetSessionCount();
-
-/*******************************************************************************
-**
-** Function         UWA_SetAppConfig
-**
-** Description      Set the configuration parameters to UWBS. The result is
-**                  reported with an UWA_DM_SESSION_SET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SetAppConfig(uint32_t session_id, uint8_t noOfParams,
-                                    uint8_t appConfigParamLen,
-                                    uint8_t AppConfigParmas[]);
-
-/*******************************************************************************
-**
-** Function         UWA_GetAppConfig
-**
-** Description      Get the configuration parameters from UWBS. The result is
-**                  reported with an UWA_DM_SESSION_GET_CONFIG_RSP_EVT in the
-**                  tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_GetAppConfig(uint32_t session_id, uint8_t num_ids,
-                                    uint8_t paramLen, tUWA_PMID* p_param_ids);
-
-/*******************************************************************************
-**
-** Function         UWA_StartRangingSession
-**
-** Description      start the ranging session.
-**                  The result is reported with an UWA_DM_RANGE_START_RSP_EVT in
-**                  the tUWA_DM_CBACK callback
-**
-** Returns          UWA_STATUS_OK if ranging started successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_StartRangingSession(uint32_t session_id);
-
-/*******************************************************************************
-**
-** Function         UWA_StopRangingSession
-**
-** Description      stop the ranging session.
-**                  The result is reported with an UWA_DM_RANGE_STOP_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if ranging is stopped successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_StopRangingSession(uint32_t session_id);
-
-/*******************************************************************************
-**
-** Function         UWA_GetRangingCount
-**
-** Description      Get ranging count.
-**                  The result is reported with an
-**                  UWA_DM_GET_RANGE_COUNT_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_GetRangingCount(uint32_t session_id);
-
-/*******************************************************************************
-**
-** Function         UWA_GetSessionStatus
-**
-** Description      Get session status.
-**                  The result is reported with an
-**                  UWA_DM_SESSION_GET_STATE_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_GetSessionStatus(uint32_t session_id);
-
-/*******************************************************************************
-**
-** Function         UWA_GetCoreGetDeviceCapability
-**
-** Description      Get core device capability info command.
-**                  The result is reported with an
-**                  UWA_DM_GET_CORE_DEVICE_CAP_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_GetCoreGetDeviceCapability(void);
-
-/*******************************************************************************
-**
-** Function         UWA_ControllerMulticastListUpdate
-**
-** Description      This function is called to send Controller Multicast List
-**                  Update.
-**                  The result is reported with an
-**                  UWA_DM_SESSION_MC_LIST_UPDATE_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_ControllerMulticastListUpdate(
-    uint32_t session_id, uint8_t action, uint8_t noOfControlees,
-    uint16_t* shortAddressList, uint32_t* subSessionIdList);
-
-/*******************************************************************************
-**
-** Function         UWA_ControllerSetCountryCode
-**
-** Description      This function is called to set country code.
-**                  The result is reported with an
-**                  UWA_DM_SET_COUNTRY_CODE_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_ControllerSetCountryCode(uint8_t* countryCodeArray);
-
-/*******************************************************************************
-**
-** Function         UWA_SendBlinkData
-**
-** Description      This function is called to send Blink Data Tx.
-**                  The result is reported with an
-**                  UWA_DM_SEND_BLINK_DATA_RSP_EVT
-**                  in the tUWA_DM_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendBlinkData(uint32_t session_id,
-                                     uint8_t repetition_count,
-                                     uint8_t app_data_len, uint8_t* app_data);
-
-/*                      UWA APIs for RF Test functionality */
-
-/*******************************************************************************
-**
-** Function         UWA_TestSetConfig
-**
-** Description      Set the configuration parameters to UWBS.
-**                     The result is  reported with an
-**                     UWA_DM_TEST_SET_CONFIG_RSP_EVT
-**                     in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_TestSetConfig(uint32_t session_id, uint8_t noOfParams,
-                                     uint8_t testConfigParamLen,
-                                     uint8_t testConfigParmas[]);
-
-/*******************************************************************************
-**
-** Function         UWA_TestGetConfig
-**
-** Description      Get the configuration parameters from UWBS.
-**                  The result is reported with an
-**                  UWA_DM_TEST_GET_CONFIG_RSP_EVT
-**                  in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_TestGetConfig(uint32_t session_id, uint8_t num_ids,
-                                     uint8_t paramLen, tUWA_PMID* p_param_ids);
-
-/*******************************************************************************
-**
-** Function         UWA_PeriodicTxTest
-**
-** Description      This function is called to trigger the periodic Tx Test.
-**                  The result is reported with an
-**                  UWA_DM_TEST_PERIODIC_TX_RSP_EVT
-**                  in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_PeriodicTxTest(uint16_t psduLen, uint8_t psduData[]);
-
-/*******************************************************************************
-**
-** Function         UWA_PerRxTest
-**
-** Description      This function is called to trigger the PER Rx Tx Test.
-**                  The result is reported with an UWA_DM_TEST_PER_RX_RSP_EVT
-**                  in the tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_PerRxTest(uint16_t psduLen, uint8_t psduData[]);
-
-/*******************************************************************************
-**
-** Function         UWA_UwbLoopBackTest
-**
-** Description      This function is called to trigger the loop back Test.
-**                  The result is reported with an UWA_DM_TEST_LOOPBACK_RSP_EVT
-*in the
-**                  tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if command is sent successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_UwbLoopBackTest(uint16_t psduLen, uint8_t psduData[]);
-
-/*******************************************************************************
-**
-** Function         UWA_RxTest
-**
-** Description      This function is called to trigger the loop back Test.
-**                  The result is reported with an UWA_DM_TEST_RX_EVT in the
-**                  tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if Per Session stopped successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_RxTest();
-
-/*******************************************************************************
-**
-** Function         UWA_TestStopSession
-**
-** Description      This function is called to stop the ongoing test session
-**                  The result is reported with an
-**                  UWA_DM_TEST_STOP_SESSION_RSP_EVT in the
-**                  tUWA_DM_TEST_CBACK callback.
-**
-** Returns          UWA_STATUS_OK if Per Session stopped successfully
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_TestStopSession(void);
-
-/*******************************************************************************
-**
-** Function         UWA_SendRawCommand
-**
-** Description      This function is called to send raw vendor specific
-**                  command to Helios.
-**
-**                  cmd_params_len  - The command parameter len
-**                  p_cmd_params    - The command parameter
-**                  p_cback         - The callback function to receive the
-**                                    command
-**
-** Returns          UWA_STATUS_OK if successfully initiated
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendRawCommand(uint16_t cmd_params_len,
-                                      uint8_t* p_cmd_params,
-                                      tUWA_RAW_CMD_CBACK* p_cback);
-
-/*******************************************************************************
-**
-** Function         UWA_SendUwbDataFrame
-**
-** Description      This function is called to send UWB data over UWB RF interafce  .
-**
-**                  data_len  - The data length
-**                  p_data    - pointer to data buffer
-**
-** Returns       UWA_STATUS_OK if data sucessfully accepeted by UWB subsystem
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_SendUwbData(uint32_t session_id,
-                                   uint8_t* p_addr, uint8_t dest_end_point, uint8_t sequence_num,
-                                   uint16_t data_len,
-                                   uint8_t* p_data);
-
-/*******************************************************************************
-**
-** Function         UWA_ConfigureDTAnchorForRrRdmList
-**
-** Description      This function is called to Configure DT anchor RR RDM List.
-**
-** Returns          tUWA_STATUS
-**
-*******************************************************************************/
-extern tUWA_STATUS UWA_ConfigureDTAnchorForRrRdmList(uint32_t session_id, uint8_t rr_rdm_count,
-                                    uint8_t rrRdmConfigParamLen, uint8_t rrRdmConfigParam[]);
-
-/*******************************************************************************
-**
-** Function         UWA_UpdateRangingRoundIndex
-**
-** Description      This function is called to update Ranging round index for TDoA feature.
-**
-** Returns          UWA_STATUS_OK if data sucessfully accepeted by UWB subsystem
-**                  UWA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-
-extern tUWA_STATUS UWA_UpdateRangingRoundIndex(uint8_t dlTdoaRole, uint32_t session_id,
-                                    uint8_t number_of_active_rngIndex, uint8_t rng_round_index_len,
-                                    uint8_t* p_rng_round_index);
-#endif /* UWA_API_H */
diff --git a/src/uwa/include/uwa_dm_int.h b/src/uwa/include/uwa_dm_int.h
deleted file mode 100755
index 160501e..0000000
--- a/src/uwa/include/uwa_dm_int.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021-2022 NXP.
- *
- * 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.
- */
-
-#ifndef UWA_DM_INT_H
-#define UWA_DM_INT_H
-
-#include <string.h>
-
-#include "uwa_api.h"
-#include "uwa_sys.h"
-#include "uwb_api.h"
-
-/*****************************************************************************
-**  Constants and data types
-*****************************************************************************/
-
-/* UWA_DM flags */
-/* DM is enabled                                                        */
-#define UWA_DM_FLAGS_DM_IS_ACTIVE 0x00000001
-#define UWA_DM_FLAGS_ENABLE_EVT_PEND 0x00000002
-
-/* DM events */
-enum {
-  /* device manager local device API events */
-  UWA_DM_API_ENABLE_EVT = UWA_SYS_EVT_START(UWA_ID_DM),
-  UWA_DM_API_DISABLE_EVT,
-  UWA_DM_API_GET_DEVICE_INFO_EVT,
-  UWA_DM_API_SET_CORE_CONFIG_EVT,
-  UWA_DM_API_GET_CORE_CONFIG_EVT,
-  UWA_DM_API_DEVICE_RESET_EVT,
-  UWA_DM_API_SESSION_INIT_EVT,
-  UWA_DM_API_SESSION_DEINIT_EVT,
-  UWA_DM_API_SESSION_GET_COUNT_EVT,
-  UWA_DM_API_SET_APP_CONFIG_EVT,
-  UWA_DM_API_GET_APP_CONFIG_EVT,
-  UWA_DM_API_START_RANGE_EVT,
-  UWA_DM_API_STOP_RANGE_EVT,
-  UWA_DM_API_SEND_RAW_EVT,
-  UWA_DM_API_GET_RANGE_COUNT_EVT,
-  UWA_DM_API_GET_SESSION_STATUS_EVT,
-  UWA_DM_API_CORE_GET_DEVICE_CAPABILITY_EVT,
-  UWA_DM_API_SESSION_UPDATE_MULTICAST_LIST_EVT,
-  UWA_DM_API_SET_COUNTRY_CODE_EVT,
-  UWA_DM_API_SEND_BLINK_DATA_EVT,
-  /*    UWB RF Test API events   */
-  UWA_DM_API_TEST_SET_CONFIG_EVT,
-  UWA_DM_API_TEST_GET_CONFIG_EVT,
-  UWA_DM_API_TEST_PERIODIC_TX_EVT,
-  UWA_DM_API_TEST_PER_RX_EVT,
-  UWA_DM_API_TEST_UWB_LOOPBACK_EVT,
-  UWA_DM_API_TEST_RX_EVT,
-  UWA_DM_API_TEST_STOP_SESSION_EVT,
-  /* UWB Data packet events */
-  UWA_DM_API_SEND_DATA_FRAME_EVT,
-  UWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_EVT,
-  UWA_DM_API_UPDATE_ACTIVE_RNG_INDEX_EVT,
-  UWA_DM_MAX_EVT
-};
-
-/* data type for UWA_DM_API_ENABLE_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  tUWA_DM_CBACK* p_dm_cback;
-  tUWA_DM_TEST_CBACK* p_dm_test_cback;
-} tUWA_DM_API_ENABLE;
-
-/* data type for UWA_DM_API_DISABLE_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  bool graceful;
-} tUWA_DM_API_DISABLE;
-
-/* data type for UWA_DM_API_SET_CORE_CONFIG_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  tUWA_PMID param_id;
-  uint8_t length;
-  uint8_t* p_data;
-} tUWA_DM_API_CORE_SET_CONFIG;
-
-/* data type for UWA_DM_API_SET_APP_CONFIG_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t num_ids;
-  uint8_t length;
-  uint8_t* p_data;
-} tUWA_DM_API_SET_APP_CONFIG;
-
-/* data type for UWA_DM_API_GET_CORE_CONFIG_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint8_t num_ids;
-  tUWA_PMID* p_pmids;
-} tUWA_DM_API_CORE_GET_CONFIG;
-
-/* data type for UWA_DM_API_GET_APP_CONFIG_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t num_ids;
-  uint8_t length;
-  uint8_t* p_pmids;
-} tUWA_DM_API_GET_APP_CONFIG;
-
-/* data type for UWA_DM_API_DEVICE_RESET_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint8_t resetConfig; /* Vendor Specific Reset Config*/
-} tUWA_DM_API_DEVICE_RESET;
-
-/* data type for UWA_DM_API_SEND_RAW_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  tUWA_RAW_CMD_CBACK* p_cback;
-  uint8_t oid;
-  uint16_t cmd_params_len;
-  uint8_t* p_cmd_params;
-} tUWA_DM_API_SEND_RAW;
-
-/* data type for UWA_DM_API_START_RANGE_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id; /* Session ID for which ranging shall start */
-} tUWA_DM_API_RANGING_START;
-
-/* data type for UWA_DM_API_STOP_RANGE_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id; /* Session ID for which ranging shall stop */
-} tUWA_DM_API_RANGING_STOP;
-
-/* data type for UWA_DM_API_SESSION_GET_COUNT_EVT */
-typedef struct {
-  UWB_HDR hdr;
-} tUWA_DM_API_GET_SESSION_COUNT;
-
-/* data type for UWA_DM_API_SESSION_GET_COUNT_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-} tUWA_DM_API_GET_RANGING_COUNT;
-
-/* data type for UWA_DM_API_SESSION_GET_STATUS_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-} tUWA_DM_API_GET_SESSION_STATUS;
-
-/* data type for UWA_DM_API_SESSION_INIT_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id; /* session_id for Particular Activity */
-  uint8_t sessionType; /* session type for Particular Activity */
-} tUWA_DM_API_SESSION_INIT;
-
-/* data type for UWA_DM_API_SESSION_DEINIT_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id; /* session_id for Particular activity */
-} tUWA_DM_API_SESSION_DEINIT;
-
-/* data type for UWA_DM_API_GET_DEVICE_INFO_EVT */
-typedef struct {
-  UWB_HDR hdr;
-} tUWA_DM_API_GET_DEVICE_INFO;
-
-/* data type for UWA_DM_API_CORE_GET_DEVICE_CAPABILITY_EVT */
-typedef struct {
-  UWB_HDR hdr;
-} tUWA_DM_API_CORE_GET_DEVICE_CAPABILITY;
-
-/* data type for UWA_DM_API_SESSION_UPDATE_MULTICAST_LIST_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t action;
-  uint8_t no_of_controlee;
-  uint16_t short_address_list[MAX_NUM_CONTROLLEES];
-  uint32_t subsession_id_list[MAX_NUM_CONTROLLEES];
-} tUWA_DM_API_SESSION_UPDATE_MULTICAST_LIST;
-
-/* data type for UWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t rr_rdm_count;
-  uint8_t length;
-  uint8_t* p_data;
-} tUWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST;
-
-/* data type for UWA_DM_API_SESSION_UPDATE_MULTICAST_LIST_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint8_t country_code[COUNTRY_CODE_ARRAY_LEN];
-} tUWA_DM_API_SET_COUNTRY_CODE;
-
-/* data type for UWA_DM_API_DM_API_SEND_BLINK_DATA_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t repetition_count;
-  uint8_t app_data_len;
-  uint8_t app_data[UCI_MAX_PAYLOAD_SIZE];
-} tUWA_DM_API_SEND_BLINK_DATA;
-
-/* data type for UWA_DM_API_SEND_DATA_FRAME_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t p_addr[EXTENDED_ADDRESS_LEN];
-  uint8_t dest_end_point;
-  uint8_t sequence_num;
-  uint16_t data_len;
-  uint8_t* p_data;
-} tUWA_DM_API_SEND_DATA_FRAME;
-
-/* data type for UWA_DM_API_UPDATE_ACTIVE_RNG_INDEX_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint8_t dlTdoaRole;
-  uint32_t session_id;
-  uint8_t number_of_rng_index;
-  uint8_t length;
-  uint8_t* p_rng_index;
-} tUWA_DM_API_UPDATE_ACTIVE_RNG_INDEX;
-
-/* data type for UWA_DM_API_TEST_SET_CONFIG_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t num_ids;
-  uint8_t length;
-  uint8_t* p_data;
-} tUWA_DM_API_TEST_SET_CONFIG;
-
-/* data type for UWA_DM_API_TEST_GET_CONFIG_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint32_t session_id;
-  uint8_t num_ids;
-  uint8_t length;
-  uint8_t* p_pmids;
-} tUWA_DM_API_TEST_GET_CONFIG;
-
-/* data type for UWA_DM_API_TEST_PERIODIC_TX_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint16_t length;
-  uint8_t* p_data;
-} tUWA_DM_API_TEST_PERIODIC_TX;
-
-/* data type for UWA_DM_API_TEST_PER_RX_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint16_t length;
-  uint8_t* p_data;
-} tUWA_DM_API_TEST_PER_RX;
-
-/* data type for UWA_DM_API_TEST_UWB_LOOPBACK_EVT */
-typedef struct {
-  UWB_HDR hdr;
-  uint16_t length;
-  uint8_t* p_data;
-} tUWA_DM_API_TEST_UWB_LOOPBACK;
-
-/* data type for UWA_DM_API_TEST_RX_EVT */
-typedef struct {
-  UWB_HDR hdr;
-} tUWA_DM_API_TEST_RX;
-
-/* data type for UWA_DM_API_TEST_STOP_SESSION_EVT */
-typedef struct {
-  UWB_HDR hdr;
-} tUWA_DM_API_TEST_STOP_SESSION;
-
-/* union of all data types */
-typedef union {
-  /* GKI event buffer header */
-  UWB_HDR hdr;
-  tUWA_DM_API_ENABLE enable;   /* UWA_DM_API_ENABLE_EVT           */
-  tUWA_DM_API_DISABLE disable; /* UWA_DM_API_DISABLE_EVT          */
-  tUWA_DM_API_GET_DEVICE_INFO
-      sGet_device_info;                   /* UWA_DM_API_GET_DEVICE_INFO      */
-  tUWA_DM_API_DEVICE_RESET sDevice_reset; /* UWA_DM_API_DEVICE_RESET_EVT */
-  tUWA_DM_API_CORE_SET_CONFIG setconfig;  /* UWA_DM_API_SET_CORE_CONFIG_EVT  */
-  tUWA_DM_API_CORE_GET_CONFIG getconfig;  /* UWA_DM_API_GET_CORE_CONFIG_EVT  */
-  tUWA_DM_API_SESSION_INIT sessionInit;   /* UWA_DM_API_SESSION_INIT         */
-  tUWA_DM_API_SESSION_DEINIT sessionDeInit; /* UWA_DM_API_SESSION_DEINIT */
-  tUWA_DM_API_GET_SESSION_COUNT
-      sGet_session_cnt; /* UWA_DM_API_SESSION_GET_COUNT_EVT*/
-  tUWA_DM_API_GET_APP_CONFIG
-      sApp_get_config; /* UWA_DM_API_GET_CORE_CONFIG_EVT       */
-  tUWA_DM_API_SET_APP_CONFIG
-      sApp_set_config; /* UWA_DM_API_SET_CORE_CONFIG_EVT       */
-  tUWA_DM_API_RANGING_START rang_start; /* UWA_DM_API_START_RANGE_EVT        */
-  tUWA_DM_API_RANGING_STOP rang_stop;   /* UWA_DM_API_STOP_RANGE_EVT         */
-  tUWA_DM_API_SEND_RAW send_raw;        /* UWA_DM_API_SEND_RAW_EVT         */
-  tUWA_DM_API_GET_RANGING_COUNT
-      sGet_rang_count; /* UWA_DM_API_GET_RANGE_COUNT_EVT         */
-  tUWA_DM_API_GET_SESSION_STATUS
-      sGet_session_status; /* UWA_DM_API_GET_SESSION_STATUS_EVT         */
-  tUWA_DM_API_CORE_GET_DEVICE_CAPABILITY
-      get_device_capability; /* UWA_DM_API_CORE_GET_DEVICE_CAPABILITY_EVT  */
-  tUWA_DM_API_TEST_UWB_LOOPBACK
-      sUwb_loopback; /* UWA_DM_API_TEST_UWB_LOOPBACK_EVT  */
-  tUWA_DM_API_SESSION_UPDATE_MULTICAST_LIST
-      sMulticast_list; /* UWA_DM_API_SESSION_UPDATE_MULTICAST_LIST_EVT */
-  tUWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST
-      sConfigure_dt_anchor_rr_rdm_list; /* UWA_DM_API_CONFIGURE_DT_ANCHOR_RR_RDM_LIST_EVT */
-  tUWA_DM_API_UPDATE_ACTIVE_RNG_INDEX
-      update_rng_index; /* UWA_DM_API_UPDATE_ACTIVE_RNG_INDEX_EVT */
-  tUWA_DM_API_SET_COUNTRY_CODE
-      sCountryCode; /* UWA_DM_API_SET_COUNTRY_CODE_EVT */
-  tUWA_DM_API_SEND_BLINK_DATA
-      sSend_blink_data; /* UWA_DM_API_SEND_BLINK_DATA_EVT */
-                        /*  data types for all UWB RF TEST events */
-  tUWA_DM_API_SEND_DATA_FRAME send_data_frame;      /* UWA_DM_API_SEND_DATA_FRAME_EVT */
-  tUWA_DM_API_TEST_GET_CONFIG
-      sTest_get_config; /* UWA_DM_API_TEST_GET_CONFIG_EVT       */
-  tUWA_DM_API_TEST_SET_CONFIG
-      sTest_set_config; /* UWA_DM_API_TEST_SET_CONFIG_EVT       */
-  tUWA_DM_API_TEST_PERIODIC_TX
-      sPeriodic_tx; /* UWA_DM_API_TEST_PERIODIC_TX_EVT            */
-  tUWA_DM_API_TEST_PER_RX sPer_rx; /* UWA_DM_API_TEST_PER_RX_EVT            */
-  tUWA_DM_API_TEST_RX sTest_rx;    /*UWA_DM_API_TEST_RX_EVT*/
-  tUWA_DM_API_TEST_STOP_SESSION
-      sTest_stop_session; /* UWA_DM_API_TEST_STOP_SESSION_EVT     */
-} tUWA_DM_MSG;
-
-typedef struct {
-  uint32_t flags; /* UWA_DM flags (see definitions for UWA_DM_FLAGS_*)    */
-  tUWA_DM_CBACK* p_dm_cback;           /* UWA DM callback */
-  tUWA_DM_TEST_CBACK* p_dm_test_cback; /* UWA DM callback for RF test events */
-  TIMER_LIST_ENT tle;
-} tUWA_DM_CB;
-
-tUWA_STATUS uwa_rw_send_raw_frame(UWB_HDR* p_data);
-void uwa_dm_disable_complete(void);
-
-/* UWA device manager control block */
-extern tUWA_DM_CB uwa_dm_cb;
-
-void uwa_dm_init(void);
-
-/* Action function prototypes */
-bool uwa_dm_enable(tUWA_DM_MSG* p_data);
-bool uwa_dm_disable(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_get_device_info(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_device_reset(tUWA_DM_MSG* p_data);
-bool uwa_dm_set_core_config(tUWA_DM_MSG* p_data);
-bool uwa_dm_get_core_config(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_send_session_init(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_send_session_deinit(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_get_session_count(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_app_set_config(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_app_get_config(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_start_range_session(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_stop_range_session(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_send_raw_cmd(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_get_range_count(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_get_session_status(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_get_device_capability(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_multicast_list_update(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_set_country_code(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_send_blink_data(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_send_data_frame(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_configure_dt_anchor_rr_rdm(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_update_active_range_round_index(tUWA_DM_MSG* p_data);
-
-/* Action function prototypes for all RF test functionality */
-bool uwa_dm_act_test_set_config(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_test_get_config(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_test_periodic_tx(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_test_per_rx(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_test_uwb_loopback(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_test_rx(tUWA_DM_MSG* p_data);
-bool uwa_dm_act_test_stop_session(tUWA_DM_MSG* p_data);
-
-/* Main function prototypes */
-bool uwa_dm_evt_hdlr(UWB_HDR* p_msg);
-void uwa_dm_sys_enable(void);
-void uwa_dm_sys_disable(void);
-
-std::string uwa_dm_uwb_revt_2_str(tUWB_RESPONSE_EVT event);
-std::string uwa_test_dm_uwb_revt_2_str(tUWB_RESPONSE_EVT event);
-
-#endif /* UWA_DM_INT_H */
diff --git a/src/uwa/include/uwa_sys.h b/src/uwa/include/uwa_sys.h
deleted file mode 100755
index 0df6634..0000000
--- a/src/uwa/include/uwa_sys.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-
-#ifndef UWA_SYS_H
-#define UWA_SYS_H
-
-#include "uwa_api.h"
-#include "uwb_gki.h"
-#include "uwb_target.h"
-
-/*****************************************************************************
-**  Constants and data types
-*****************************************************************************/
-
-/* SW sub-systems */
-enum {
-  UWA_ID_SYS, /* system manager                      */
-  UWA_ID_DM,  /* device manager                      */
-  UWA_ID_MAX
-};
-typedef uint8_t tUWA_SYS_ID;
-
-/* enable function type */
-typedef void(tUWA_SYS_ENABLE)(void);
-
-/* event handler function type */
-typedef bool(tUWA_SYS_EVT_HDLR)(UWB_HDR* p_msg);
-
-/* disable function type */
-typedef void(tUWA_SYS_DISABLE)(void);
-
-typedef void(tUWA_SYS_ENABLE_CBACK)(void);
-
-/* registration structure */
-typedef struct {
-  tUWA_SYS_ENABLE* enable;
-  tUWA_SYS_EVT_HDLR* evt_hdlr;
-  tUWA_SYS_DISABLE* disable;
-} tUWA_SYS_REG;
-
-/* system manager configuration structure */
-typedef struct {
-  uint16_t mbox_evt; /* GKI mailbox event */
-  uint8_t mbox;      /* GKI mailbox id */
-  uint8_t timer;     /* GKI timer id */
-} tUWA_SYS_CFG;
-
-/*****************************************************************************
-**  Global data
-*****************************************************************************/
-
-/*****************************************************************************
-**  Macros
-*****************************************************************************/
-
-/* Calculate start of event enumeration; id is top 8 bits of event */
-#define UWA_SYS_EVT_START(id) ((id) << 8)
-
-/*****************************************************************************
-**  Function declarations
-*****************************************************************************/
-extern void uwa_sys_init(void);
-extern void uwa_sys_event(UWB_HDR* p_msg);
-extern void uwa_sys_timer_update(void);
-extern void uwa_sys_disable_timers(void);
-
-extern void uwa_sys_register(uint8_t id, const tUWA_SYS_REG* p_reg);
-extern void uwa_sys_deregister(uint8_t id);
-extern void uwa_sys_check_disabled(void);
-extern bool uwa_sys_is_register(uint8_t id);
-extern void uwa_sys_disable_subsystems(bool graceful);
-extern void uwa_sys_enable_subsystems(void);
-
-extern bool uwa_sys_is_graceful_disable(void);
-extern void uwa_sys_sendmsg(void* p_msg);
-extern void uwa_sys_start_timer(TIMER_LIST_ENT* p_tle, uint16_t type,
-                                uint32_t timeout);
-extern void uwa_sys_stop_timer(TIMER_LIST_ENT* p_tle);
-
-extern void uwa_sys_cback_reg_enable_complete(tUWA_SYS_ENABLE_CBACK* p_cback);
-extern void uwa_sys_cback_notify_enable_complete(uint8_t id);
-
-#endif /* UWA_SYS_H */
diff --git a/src/uwa/include/uwa_sys_int.h b/src/uwa/include/uwa_sys_int.h
deleted file mode 100755
index c26d09c..0000000
--- a/src/uwa/include/uwa_sys_int.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-#ifndef UWA_SYS_INT_H
-#define UWA_SYS_INT_H
-
-#include "uwa_sys_ptim.h"
-
-/*****************************************************************************
-**  Constants and data types
-*****************************************************************************/
-
-/* uwa_sys flags */
-#define UWA_SYS_FL_INITIALIZED 0x00000001 /* uwa_sys initialized */
-
-/*****************************************************************************
-**  state table
-*****************************************************************************/
-
-/* system manager control block */
-typedef struct {
-  uint32_t flags; /* uwa_sys flags (must be first element of structure) */
-  tUWA_SYS_REG* reg[UWA_ID_MAX]; /* registration structures */
-  bool is_reg[UWA_ID_MAX];       /* registration structures */
-  tPTIM_CB ptim_cb;              /* protocol timer list */
-  tUWA_SYS_ENABLE_CBACK* p_enable_cback;
-  uint16_t enable_cplt_flags;
-  uint16_t enable_cplt_mask;
-
-  bool graceful_disable; /* TRUE if UWA_Disable () is called with TRUE */
-  bool timers_disabled;  /* TRUE if sys timers disabled */
-} tUWA_SYS_CB;
-
-/*****************************************************************************
-**  Global variables
-*****************************************************************************/
-
-/* system manager control block */
-extern tUWA_SYS_CB uwa_sys_cb;
-
-/* system manager configuration structure */
-extern tUWA_SYS_CFG* p_uwa_sys_cfg;
-
-#endif /* UWA_SYS_INT_H */
diff --git a/src/uwa/include/uwa_sys_ptim.h b/src/uwa/include/uwa_sys_ptim.h
deleted file mode 100755
index f96a36b..0000000
--- a/src/uwa/include/uwa_sys_ptim.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  Protocol timer services.
- *
- ******************************************************************************/
-#ifndef UWA_SYS_PTIM_H
-#define UWA_SYS_PTIM_H
-
-#include "uwb_gki.h"
-
-/*****************************************************************************
-**  Constants and data types
-*****************************************************************************/
-
-typedef struct {
-  TIMER_LIST_Q timer_queue; /* GKI timer queue */
-  int32_t period;           /* Timer period in milliseconds */
-  uint32_t last_gki_ticks;  /* GKI ticks since last time update called */
-  uint8_t timer_id;         /* GKI timer id */
-} tPTIM_CB;
-
-/*****************************************************************************
-**  Function Declarations
-*****************************************************************************/
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_init
-**
-** Description      Initialize a protocol timer service control block.
-**
-** Returns          void
-**
-*******************************************************************************/
-extern void uwa_sys_ptim_init(tPTIM_CB* p_cb, uint16_t period,
-                              uint8_t timer_id);
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_timer_update
-**
-** Description      Update the protocol timer list and handle expired timers.
-**
-** Returns          void
-**
-*******************************************************************************/
-extern void uwa_sys_ptim_timer_update(tPTIM_CB* p_cb);
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_start_timer
-**
-** Description      Start a protocol timer for the specified amount
-**                  of time in milliseconds.
-**
-** Returns          void
-**
-*******************************************************************************/
-extern void uwa_sys_ptim_start_timer(tPTIM_CB* p_cb, TIMER_LIST_ENT* p_tle,
-                                     uint16_t type, uint32_t timeout);
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_stop_timer
-**
-** Description      Stop a protocol timer.
-**
-** Returns          void
-**
-*******************************************************************************/
-extern void uwa_sys_ptim_stop_timer(tPTIM_CB* p_cb, TIMER_LIST_ENT* p_tle);
-
-#endif /* UWA_SYS_PTIM_H */
diff --git a/src/uwa/sys/uwa_sys_cback.cc b/src/uwa/sys/uwa_sys_cback.cc
deleted file mode 100755
index 8ff561b..0000000
--- a/src/uwa/sys/uwa_sys_cback.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  Registration/deregistration functions for inter-module callbacks
- *
- ******************************************************************************/
-
-#include "uci_log.h"
-#include "uwa_sys.h"
-#include "uwa_sys_int.h"
-#include "uwb_osal_common.h"
-
-/*******************************************************************************
-**
-** Function         uwa_sys_cback_reg_enable_complete
-**
-** Description      Called to register an initialization complete callback
-**                  function
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_cback_reg_enable_complete(tUWA_SYS_ENABLE_CBACK* p_cback) {
-  uwa_sys_cb.p_enable_cback = p_cback;
-  uwa_sys_cb.enable_cplt_flags = 0;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_cback_notify_enable_complete
-**
-** Description      Called by other UWA subsystems to notify initialization is
-**                  complete
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_cback_notify_enable_complete(uint8_t id) {
-  uwa_sys_cb.enable_cplt_flags |= (uint16_t)(0x0001 << id);
-
-  UCI_TRACE_I("enable_cplt_flags=0x%x, enable_cplt_mask=0x%x",
-              uwa_sys_cb.enable_cplt_flags, uwa_sys_cb.enable_cplt_mask);
-
-  if ((uwa_sys_cb.enable_cplt_flags == uwa_sys_cb.enable_cplt_mask) &&
-      (uwa_sys_cb.p_enable_cback)) {
-    uwa_sys_cb.p_enable_cback();
-    uwa_sys_cb.p_enable_cback = NULL;
-  }
-}
diff --git a/src/uwa/sys/uwa_sys_cfg.cc b/src/uwa/sys/uwa_sys_cfg.cc
deleted file mode 100755
index 64f9bf0..0000000
--- a/src/uwa/sys/uwa_sys_cfg.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  This file contains compile-time configurable constants for the UWA
- *  system manager.
- *
- ******************************************************************************/
-
-#include "uwa_sys.h"
-#include "uwb_gki.h"
-
-const tUWA_SYS_CFG uwa_sys_cfg = {
-    UWA_MBOX_EVT_MASK, /* GKI mailbox event */
-    UWA_MBOX_ID,       /* GKI mailbox id */
-    UWA_TIMER_ID,      /* GKI timer id */
-};
-
-tUWA_SYS_CFG* p_uwa_sys_cfg = (tUWA_SYS_CFG*)&uwa_sys_cfg;
diff --git a/src/uwa/sys/uwa_sys_main.cc b/src/uwa/sys/uwa_sys_main.cc
deleted file mode 100755
index 9241771..0000000
--- a/src/uwa/sys/uwa_sys_main.cc
+++ /dev/null
@@ -1,301 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  This is the main implementation file for the UWA system manager.
- *
- ******************************************************************************/
-#include <string.h>
-
-#include "uci_log.h"
-#include "uwa_api.h"
-#include "uwa_dm_int.h"
-#include "uwa_sys.h"
-#include "uwa_sys_int.h"
-#include "uwb_osal_common.h"
-
-/* protocol timer update period, in milliseconds */
-#ifndef UWA_SYS_TIMER_PERIOD
-#define UWA_SYS_TIMER_PERIOD 10
-#endif
-
-/* system manager control block definition */
-tUWA_SYS_CB uwa_sys_cb =
-    {}; /* uwa_sys control block. statically initialize 'flags' field to 0 */
-
-/*******************************************************************************
-**
-** Function         uwa_sys_init
-**
-** Description      UWA initialization; called from task initialization.
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_init(void) {
-  memset(&uwa_sys_cb, 0, sizeof(tUWA_SYS_CB));
-  uwa_sys_cb.flags |= UWA_SYS_FL_INITIALIZED;
-  uwa_sys_ptim_init(&uwa_sys_cb.ptim_cb, UWA_SYS_TIMER_PERIOD,
-                    p_uwa_sys_cfg->timer);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_event
-**
-** Description      BTA event handler; called from task event handler.
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_event(UWB_HDR* p_msg) {
-  uint8_t id;
-  bool freebuf = true;
-
-  UCI_TRACE_I("UWA got event 0x%04X", p_msg->event);
-
-  /* get subsystem id from event */
-  id = (uint8_t)(p_msg->event >> 8);
-
-  /* verify id and call subsystem event handler */
-  if ((id < UWA_ID_MAX) && (uwa_sys_cb.is_reg[id])) {
-    freebuf = (*uwa_sys_cb.reg[id]->evt_hdlr)(p_msg);
-  } else {
-    UCI_TRACE_W("UWA got unregistered event id %d", id);
-  }
-
-  if (freebuf) {
-    phUwb_GKI_freebuf(p_msg);
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_timer_update
-**
-** Description      Update the BTA timer list and handle expired timers.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_timer_update(void) {
-  if (!uwa_sys_cb.timers_disabled) {
-    uwa_sys_ptim_timer_update(&uwa_sys_cb.ptim_cb);
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_register
-**
-** Description      Called by other BTA subsystems to register their event
-**                  handler.
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_register(uint8_t id, const tUWA_SYS_REG* p_reg) {
-  uwa_sys_cb.reg[id] = (tUWA_SYS_REG*)p_reg;
-  uwa_sys_cb.is_reg[id] = true;
-
-  if ((id != UWA_ID_DM) && (id != UWA_ID_SYS))
-    uwa_sys_cb.enable_cplt_mask |= (uint16_t)(0x0001 << id);
-
-  UCI_TRACE_I("id=%i, enable_cplt_mask=0x%x", id, uwa_sys_cb.enable_cplt_mask);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_check_disabled
-**
-** Description      If all subsystems above DM have been disabled, then
-**                  disable DM. Called during UWA shutdown
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_check_disabled(void) {
-  /* Disable DM */
-  if (uwa_sys_cb.is_reg[UWA_ID_DM]) {
-    (*uwa_sys_cb.reg[UWA_ID_DM]->disable)();
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_deregister
-**
-** Description      Called by other BTA subsystems to de-register
-**                  handler.
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_deregister(uint8_t id) {
-  UCI_TRACE_I("uwa_sys: deregistering subsystem %i", id);
-
-  uwa_sys_cb.is_reg[id] = false;
-
-  /* If not deregistering DM, then check if any other subsystems above DM are
-   * still  */
-  /* registered. */
-  if (id != UWA_ID_DM) {
-    /* If all subsystems above UWA_DM have been disabled, then okay to disable
-     * DM */
-    uwa_sys_check_disabled();
-  } else {
-    /* DM (the final sub-system) is deregistering. Clear pending timer events in
-     * uwa_sys. */
-    uwa_sys_ptim_init(&uwa_sys_cb.ptim_cb, UWA_SYS_TIMER_PERIOD,
-                      p_uwa_sys_cfg->timer);
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_is_register
-**
-** Description      Called by other BTA subsystems to get registeration
-**                  status.
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-bool uwa_sys_is_register(uint8_t id) { return uwa_sys_cb.is_reg[id]; }
-
-/*******************************************************************************
-**
-** Function         uwa_sys_is_graceful_disable
-**
-** Description      Called by other BTA subsystems to get disable
-**                  parameter.
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-bool uwa_sys_is_graceful_disable(void) { return uwa_sys_cb.graceful_disable; }
-
-/*******************************************************************************
-**
-** Function         uwa_sys_enable_subsystems
-**
-** Description      Call on UWA Start up
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_enable_subsystems(void) {
-  uint8_t id;
-
-  UCI_TRACE_I("uwa_sys: enabling subsystems");
-
-  /* Enable all subsystems except SYS */
-  for (id = UWA_ID_DM; id < UWA_ID_MAX; id++) {
-    if (uwa_sys_cb.is_reg[id]) {
-      if (uwa_sys_cb.reg[id]->enable != NULL) {
-        /* Subsytem has a Disable fuuciton. Call it now */
-        (*uwa_sys_cb.reg[id]->enable)();
-      } else {
-        /* Subsytem does not have a Enable function. Report Enable on behalf of
-         * subsystem */
-        uwa_sys_cback_notify_enable_complete(id);
-      }
-    }
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_disable_subsystems
-**
-** Description      Call on UWA shutdown. Disable all subsystems above UWA_DM
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_disable_subsystems(bool graceful) {
-  UCI_TRACE_I("uwa_sys: disabling subsystems:%d", graceful);
-  uwa_sys_cb.graceful_disable = graceful;
-
-  /* Disable DM */
-  if (uwa_sys_cb.is_reg[UWA_ID_DM]) {
-    (*uwa_sys_cb.reg[UWA_ID_DM]->disable)();
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_sendmsg
-**
-** Description      Send a GKI message to BTA.  This function is designed to
-**                  optimize sending of messages to BTA.  It is called by BTA
-**                  API functions and call-in functions.
-**
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_sendmsg(void* p_msg) {
-  phUwb_GKI_send_msg(UWB_TASK, p_uwa_sys_cfg->mbox, p_msg);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_start_timer
-**
-** Description      Start a protocol timer for the specified amount
-**                  of time in milliseconds.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_start_timer(TIMER_LIST_ENT* p_tle, uint16_t type,
-                         uint32_t timeout) {
-  uwa_sys_ptim_start_timer(&uwa_sys_cb.ptim_cb, p_tle, type, timeout);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_stop_timer
-**
-** Description      Stop a BTA timer.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_stop_timer(TIMER_LIST_ENT* p_tle) {
-  uwa_sys_ptim_stop_timer(&uwa_sys_cb.ptim_cb, p_tle);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_disable_timers
-**
-** Description      Disable sys timer event handling
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_disable_timers(void) { uwa_sys_cb.timers_disabled = true; }
diff --git a/src/uwa/sys/uwa_sys_ptim.cc b/src/uwa/sys/uwa_sys_ptim.cc
deleted file mode 100755
index 628e39f..0000000
--- a/src/uwa/sys/uwa_sys_ptim.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 1999-2012 Broadcom Corporation
- *  Copyright 2018-2019 NXP
- *
- *  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.
- *
- ******************************************************************************/
-/******************************************************************************
- *
- *  Protocol timer services (taken from bta ptim)
- *
- ******************************************************************************/
-#include "uwa_sys_ptim.h"
-
-#include "uci_log.h"
-#include "uwa_sys.h"
-#include "uwa_sys_int.h"
-#include "uwb_gki.h"
-#include "uwb_osal_common.h"
-#include "uwb_target.h"
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_init
-**
-** Description      Initialize a protocol timer control block.  Parameter
-**                  period is the GKI timer period in milliseconds.  Parameter
-**                  timer_id is the GKI timer id.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_ptim_init(tPTIM_CB* p_cb, uint16_t period, uint8_t timer_id) {
-  phUwb_GKI_init_timer_list(&p_cb->timer_queue);
-  p_cb->period = period;
-  p_cb->timer_id = timer_id;
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_timer_update
-**
-** Description      Update the protocol timer list and handle expired timers.
-**                  This function is called from the task running the protocol
-**                  timers when the periodic GKI timer expires.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_ptim_timer_update(tPTIM_CB* p_cb) {
-  TIMER_LIST_ENT* p_tle;
-  UWB_HDR* p_msg;
-  uint32_t new_ticks_count;
-  uint32_t period_in_ticks;
-
-  /* To handle the case when the function is called less frequently than the
-     period
-     we must convert determine the number of ticks since the last update, then
-     convert back to milliseconds before updating timer list */
-  new_ticks_count = phUwb_GKI_get_tick_count();
-
-  /* Check for wrapped condition */
-  if (new_ticks_count >= p_cb->last_gki_ticks) {
-    period_in_ticks = (uint32_t)(new_ticks_count - p_cb->last_gki_ticks);
-  } else {
-    period_in_ticks = (uint32_t)(((uint32_t)0xffffffff - p_cb->last_gki_ticks) +
-                                 new_ticks_count + 1);
-  }
-
-  /* update timer list */
-  phUwb_GKI_update_timer_list(&p_cb->timer_queue,
-                              GKI_TICKS_TO_MS(period_in_ticks));
-
-  p_cb->last_gki_ticks = new_ticks_count;
-
-  /* while there are expired timers */
-  while ((p_cb->timer_queue.p_first) &&
-         (p_cb->timer_queue.p_first->ticks <= 0)) {
-    /* removed expired timer from list */
-    p_tle = p_cb->timer_queue.p_first;
-    UCI_TRACE_I("uwa_sys_ptim_timer_update expired: %p", p_tle);
-    phUwb_GKI_remove_from_timer_list(&p_cb->timer_queue, p_tle);
-
-    /* call timer callback */
-    if (p_tle->p_cback) {
-      (*p_tle->p_cback)(p_tle);
-    } else if (p_tle->event) {
-      p_msg = (UWB_HDR*)phUwb_GKI_getbuf(sizeof(UWB_HDR));
-      if (p_msg != NULL) {
-        p_msg->event = p_tle->event;
-        p_msg->layer_specific = 0;
-        uwa_sys_sendmsg(p_msg);
-      }
-    }
-  }
-
-  /* if timer list is empty stop periodic GKI timer */
-  if (p_cb->timer_queue.p_first == NULL) {
-    UCI_TRACE_I("ptim timer stop");
-    phUwb_GKI_stop_timer(p_cb->timer_id, 0);
-  }
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_start_timer
-**
-** Description      Start a protocol timer for the specified amount
-**                  of time in seconds.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_ptim_start_timer(tPTIM_CB* p_cb, TIMER_LIST_ENT* p_tle,
-                              uint16_t type, uint32_t timeout) {
-  UCI_TRACE_I("uwa_sys_ptim_start_timer %p", p_tle);
-
-  /* if timer list is currently empty, start periodic GKI timer */
-  if (p_cb->timer_queue.p_first == NULL) {
-    UCI_TRACE_I("ptim timer start");
-    p_cb->last_gki_ticks = phUwb_GKI_get_tick_count();
-    phUwb_GKI_start_timer(p_cb->timer_id, GKI_MS_TO_TICKS(p_cb->period), true);
-  }
-
-  phUwb_GKI_remove_from_timer_list(&p_cb->timer_queue, p_tle);
-
-  p_tle->event = type;
-  p_tle->ticks = timeout;
-
-  phUwb_GKI_add_to_timer_list(&p_cb->timer_queue, p_tle);
-}
-
-/*******************************************************************************
-**
-** Function         uwa_sys_ptim_stop_timer
-**
-** Description      Stop a protocol timer.
-**
-** Returns          void
-**
-*******************************************************************************/
-void uwa_sys_ptim_stop_timer(tPTIM_CB* p_cb, TIMER_LIST_ENT* p_tle) {
-  UCI_TRACE_I("uwa_sys_ptim_stop_timer %p", p_tle);
-
-  phUwb_GKI_remove_from_timer_list(&p_cb->timer_queue, p_tle);
-
-  /* if timer list is empty stop periodic GKI timer */
-  if (p_cb->timer_queue.p_first == NULL) {
-    UCI_TRACE_I("ptim timer stop");
-    phUwb_GKI_stop_timer(p_cb->timer_id, 0);
-  }
-}
diff --git a/src/uwb/include/uci_hmsgs.h b/src/uwb/include/uci_hmsgs.h
deleted file mode 100755
index 2ecbe04..0000000
--- a/src/uwb/include/uci_hmsgs.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021-2022 NXP.
- *
- * 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.
- */
-
-/******************************************************************************
- *
- *  defines UCI interface messages (for DH)
- *
- ******************************************************************************/
-#ifndef UWB_UCI_HMSGS_H
-#define UWB_UCI_HMSGS_H
-
-#include <stdbool.h>
-
-#include "uci_defs.h"
-#include "uwb_types.h"
-
-uint8_t uci_snd_get_device_info_cmd(void);
-uint8_t uci_snd_device_reset_cmd(uint8_t resetConfig);
-uint8_t uci_snd_core_set_config_cmd(uint8_t* p_param_tlvs, uint8_t tlv_size);
-uint8_t uci_snd_core_get_config_cmd(uint8_t* param_ids, uint8_t num_ids);
-uint8_t uci_snd_core_get_device_capability(void);
-uint8_t uci_snd_session_init_cmd(uint32_t session_id, uint8_t session_type);
-uint8_t uci_snd_session_deinit_cmd(uint32_t session_id);
-uint8_t uci_snd_get_session_count_cmd(void);
-uint8_t uci_snd_get_range_count_cmd(uint32_t session_id);
-uint8_t uci_snd_get_session_status_cmd(uint32_t session_id);
-uint8_t uci_snd_multicast_list_update_cmd(uint32_t session_id, uint8_t action,
-                                          uint8_t noOfControlees,
-                                          uint16_t* shortAddressList,
-                                          uint32_t* subSessionIdList);
-uint8_t uci_snd_set_country_code_cmd(uint8_t* country_code);
-uint8_t uci_snd_app_get_config_cmd(uint32_t session_id, uint8_t num_ids,
-                                   uint8_t length, uint8_t* param_ids);
-uint8_t uci_snd_app_set_config_cmd(uint32_t session_id, uint8_t num_ids,
-                                   uint8_t length, uint8_t* data);
-uint8_t uci_snd_range_start_cmd(uint32_t session_id);
-uint8_t uci_snd_range_stop_cmd(uint32_t session_id);
-uint8_t uci_snd_blink_data_cmd(uint32_t session_id, uint8_t repetition_count,
-                               uint8_t app_data_len, uint8_t* app_data);
-uint8_t uci_send_data_frame(uint32_t session_id,
-                            uint8_t* p_addr, uint8_t dest_end_point, uint8_t sequence_num,
-                            uint16_t data_len,
-                            uint8_t* p_data);
-uint8_t uci_send_range_round_index_update_cmd(uint8_t dlTdoaRole,
-    uint32_t session_id, uint8_t number_of_active_rngIndex,
-    uint8_t rng_round_index_len, uint8_t* p_rng_round_index);
-uint8_t uci_snd_configure_dt_anchor_for_rr_rdm_list_cmd(uint32_t session_id,
-                            uint8_t rr_rdm_count, uint8_t length, uint8_t* data);
-
-/*  APIs for UWB RF test functionality */
-uint8_t uci_snd_test_get_config_cmd(uint32_t session_id, uint8_t num_ids,
-                                    uint8_t length, uint8_t* param_ids);
-uint8_t uci_snd_test_set_config_cmd(uint32_t session_id, uint8_t num_ids,
-                                    uint8_t length, uint8_t* data);
-uint8_t uci_snd_test_periodic_tx_cmd(uint16_t length, uint8_t* data);
-uint8_t uci_snd_test_per_rx_cmd(uint16_t length, uint8_t* data);
-uint8_t uci_snd_test_uwb_loopback_cmd(uint16_t length, uint8_t* data);
-uint8_t uci_snd_test_stop_session_cmd(void);
-uint8_t uci_snd_test_rx_cmd(void);
-
-extern void uci_proc_session_management_rsp(uint8_t op_code, uint8_t* p_buf,
-                                            uint16_t len);
-extern void uci_proc_session_management_ntf(uint8_t op_code, uint8_t* p_buf,
-                                            uint16_t len);
-extern void uci_proc_device_management_ntf(uint8_t op_code, uint8_t* p_buf,
-                                           uint16_t len);
-extern void uci_proc_core_management_ntf(uint8_t op_code, uint8_t* p_buf,
-                                         uint16_t len);
-extern void uci_proc_rang_management_rsp(uint8_t op_code, uint8_t* p_buf,
-                                         uint16_t len);
-extern void uci_proc_rang_management_ntf(uint8_t op_code, uint8_t* p_buf,
-                                         uint16_t len);
-extern void uci_proc_android_rsp(uint8_t op_code, uint8_t* p_buf, uint16_t len);
-extern void uci_proc_test_management_ntf(uint8_t op_code, uint8_t* p_buf,
-                                         uint16_t len);
-extern void uci_proc_test_management_rsp(uint8_t op_code, uint8_t* p_buf,
-                                         uint16_t len);
-extern void uci_proc_raw_cmd_rsp(uint8_t* p_buf, uint16_t len);
-
-extern void uci_proc_data_control_ntf(uint8_t op_code, uint8_t* p_buf, uint16_t len);
-
-extern void uci_proc_app_data_management_ntf(uint8_t op_code, uint8_t* p_buf, uint16_t len);
-
-extern void uci_proc_vendor_specific_ntf(uint8_t gid, uint8_t* p_buf, uint16_t len);
-#endif /* UWB_UCI_MSGS_H */
diff --git a/src/uwb/include/uwb_api.h b/src/uwb/include/uwb_api.h
deleted file mode 100755
index e75e924..0000000
--- a/src/uwb/include/uwb_api.h
+++ /dev/null
@@ -1,1120 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Copyright 2021 NXP.
- *
- * 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,