diff --git a/nearlink/README.md b/nearlink/README.md
new file mode 100644
index 0000000000..b0318fd5fe
--- /dev/null
+++ b/nearlink/README.md
@@ -0,0 +1,67 @@
+# NearLink
+
+- [Introduction](#section11660541593)
+- [Directory Structure](#section161941989596)
+- [Constraints](#section119744591305)
+- [Usage](#section1312121216216)
+ - [DLI APIs](#section129654513264)
+
+- [Repositories Involved](#section1371113476307)
+
+## Introduction
+
+The NearLink driver module provides APIs for accessing and using the NearLink short-range communication protocol, including DLI initialization, data sending and receiving, and closing the NearLink DLI.
+
+## Directory Structure
+
+```
+/foundation/drivers/peripheral/nearlink
+├── bundle.json # Component description and dependency configuration
+├── drivers_peripheral_nearlink.gni # Build feature parameter configuration
+├── dli # DLI module
+│ └── test # DLI test cases
+└── LICENSE # Copyright statement
+└── bundle.json # Component description file
+```
+
+## Constraints
+
+The NearLink driver module is written in C++ and based on the DLI framework. It supports the standard system only.
+
+## Usage
+
+NearLink DLI APIs are provided. The DLI APIs include initialization, sending and receiving DLI packets, and close.
+
+### DLI APIs
+
+- Initialize the NearLink HAL:
+
+```
+/* Initialize the NearLink HAL and register the callback. */
+int32_t SleHalInit(const sptr& callbackObj);
+```
+
+- Send a packet:
+
+```
+/* Send a packet to the chip. */
+int32_t SleSendHciPacket(const std::vector& data);
+```
+
+- Receive a packet:
+
+```
+/* Receive a packet from the chip. */
+int32_t hciPacketReceived(uint32_t type, const std::vector &data);
+```
+
+- Close the NearLink DLI:
+
+```
+/* Close the NearLink DLI and release resources. */
+int32_t Close();
+```
+
+## Repositories Involved
+
+drivers\_peripheral\_nearlink
diff --git a/nearlink/README_zh.md b/nearlink/README_zh.md
new file mode 100644
index 0000000000..01c17ad6a8
--- /dev/null
+++ b/nearlink/README_zh.md
@@ -0,0 +1,69 @@
+# 星闪组件
+
+- [简介](#section11660541593)
+- [目录](#section161941989596)
+- [约束](#section119744591305)
+- [说明](#section1312121216216)
+ - [DLI接口使用说明](#section129654513264)
+
+- [相关仓](#section1371113476307)
+
+## 简介
+
+星闪(NearLink)驱动组件为设备提供接入与使用星闪短距通信协议的相关接口,包括DLI初始化,数据收发以及关闭星闪DLI等。
+
+## 目录
+
+```
+/foundation/drivers/peripheral/nearlink
+├── bundle.json # 组件描述及依赖配置
+├── drivers_peripheral_nearlink.gni # 编译特性参数配置
+├── dli # DLI模块
+│ └── test # DLI测试用例
+└── LICENSE # 版权声明文件
+└── bundle.json # 部件描述文件
+```
+
+## 约束
+
+星闪驱动组件使用C++语言编写,基于DLI框架,仅支持标准系统。
+
+## 说明
+
+目前提供星闪DLI接口,DLI接口包括初始化、发送接收DLI数据包、关闭等功能。
+
+
+### DLI接口使用说明
+
+- 初始化星闪HAL:
+
+```
+/* 初始化星闪HAL,注册回调 */
+int32_t SleHalInit(const sptr& callbackObj);
+```
+
+- 发送数据包:
+
+```
+/* 向芯片发送数据包 */
+int32_t SleSendHciPacket(const std::vector& data);
+```
+
+- 接收数据包:
+
+```
+/* 接收来自芯片的数据包 */
+int32_t hciPacketReceived(uint32_t type, const std::vector &data);
+```
+
+
+- 关闭星闪DLI:
+
+```
+/* 关闭星闪DLI,释放资源 */
+int32_t Close();
+```
+
+## 相关仓
+
+drivers\_peripheral\_nearlink
diff --git a/nearlink/bundle.json b/nearlink/bundle.json
new file mode 100644
index 0000000000..d19ebeea56
--- /dev/null
+++ b/nearlink/bundle.json
@@ -0,0 +1,47 @@
+{
+ "name": "@ohos/drivers_peripheral_nearlink",
+ "description": "nearlink device driver",
+ "version": "4.1",
+ "license": "Apache License 2.0",
+ "publishAs": "code-segment",
+ "segment": {
+ "destPath": "drivers/peripheral/nearlink"
+ },
+ "dirs": {},
+ "scripts": {},
+ "component": {
+ "name": "drivers_peripheral_nearlink",
+ "subsystem": "hdf",
+ "features": [
+ "drivers_peripheral_nearlink_feature_support_send_disable_hci",
+ "drivers_peripheral_nearlink_reload_address"
+ ],
+ "adapted_system_type": ["standard"],
+ "rom": "",
+ "ram": "",
+ "deps": {
+ "components": [
+ "c_utils",
+ "hdf_core",
+ "hilog",
+ "drivers_interface_nearlink",
+ "samgr",
+ "ipc",
+ "ffrt",
+ "bounds_checking_function",
+ "init"
+ ],
+ "third_party": [
+ ]
+ },
+ "build": {
+ "sub_component": [
+ "//drivers/peripheral/nearlink/dli:nearlink_entry",
+ "//drivers/peripheral/nearlink/off_find:off_find_entry"
+ ],
+ "test": [
+ "//drivers/peripheral/nearlink/dli/test:nearlink_hdi_test"
+ ]
+ }
+ }
+}
diff --git a/nearlink/dli/BUILD.gn b/nearlink/dli/BUILD.gn
new file mode 100644
index 0000000000..a7e8055647
--- /dev/null
+++ b/nearlink/dli/BUILD.gn
@@ -0,0 +1,22 @@
+# Copyright (C) 2026 Huawei Device Co., Ltd.
+# 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 (defined(ohos_lite)) {
+ group("nearlink_entry") {
+ deps = []
+ }
+} else {
+ group("nearlink_entry") {
+ deps = [ "dli_service:hdf_nearlink_service" ]
+ }
+}
\ No newline at end of file
diff --git a/nearlink/dli/dli_service/BUILD.gn b/nearlink/dli/dli_service/BUILD.gn
new file mode 100644
index 0000000000..97d9a3fef3
--- /dev/null
+++ b/nearlink/dli/dli_service/BUILD.gn
@@ -0,0 +1,164 @@
+# Copyright (C) 2026 Huawei Device Co., Ltd.
+# 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.
+import("//build/config/components/hdi/hdi.gni")
+import("../../drivers_peripheral_nearlink.gni")
+
+
+ohos_shared_library("libsle_hci_interface_service_1.1") {
+ sanitize = {
+ cfi = true # Enable/disable control flow integrity detection
+ boundary_sanitize = true # Enable boundary san detection
+ cfi_cross_dso = true # Cross-SO CFI Checks
+ integer_overflow = true # Enable integer overflow detection
+ ubsan = true # Enable some Ubsan options
+ debug = false
+ }
+ branch_protector_ret = "pac_ret"
+
+ cflags = [
+ "-Os",
+ "-fdata-sections",
+ "-ffunction-sections",
+ "-fno-unwind-tables",
+ "-fno-asynchronous-unwind-tables",
+ "-fno-exceptions",
+ "-fno-rtti",
+ "-fPIC",
+ "-fno-common",
+ "-fstack-protector-strong",
+ "-fvisibility-inlines-hidden",
+ "-flto",
+ ]
+ cflags_cc = cflags
+ ldflags = [
+ "-Wl,--as-needed",
+ "-Wl,--gc-sections",
+ "-Wl,--no-whole-archive",
+ ]
+
+ include_dirs = [
+ ".",
+ "implement",
+ ]
+
+ sources = [
+ "sle_hci_interface_impl.cpp",
+ "implement/sle_address.cpp",
+ "implement/h4_protocol.cpp",
+ "implement/dli_protocol.cpp",
+ "implement/dli_watcher.cpp",
+ "implement/vendor_interface.cpp",
+ "implement/thread_util.cpp",
+ ]
+
+ defines = []
+
+ if (drivers_peripheral_nearlink_reload_address) {
+ defines += [ "RELOAD_ADDRESS" ]
+ }
+
+ if (is_standard_system) {
+ external_deps = [
+ "c_utils:utils",
+ "drivers_interface_nearlink:nearlink_hci_idl_headers",
+ "hdf_core:libhdf_host",
+ "hdf_core:libhdf_utils",
+ "hilog:libhilog",
+ "ipc:ipc_core",
+ "ffrt:libffrt",
+ ]
+ } else {
+ external_deps = [
+ "hilog:libhilog",
+ "ipc:ipc_core",
+ ]
+ }
+
+ external_deps += [ "init:libbegetutil" ]
+ install_images = [ chipset_base_dir ]
+ subsystem_name = "hdf"
+ part_name = "drivers_peripheral_nearlink"
+}
+
+ohos_shared_library("libnearlink_hci_hdi_driver") {
+ sanitize = {
+ cfi = true # Enable/disable control flow integrity detection
+ boundary_sanitize = true # Enable boundary san detection
+ cfi_cross_dso = true # Cross-SO CFI Checks
+ integer_overflow = true # Enable integer overflow detection
+ ubsan = true # Enable some Ubsan options
+ debug = false
+ }
+ branch_protector_ret = "pac_ret"
+
+ cflags = [
+ "-Os",
+ "-fdata-sections",
+ "-ffunction-sections",
+ "-fno-unwind-tables",
+ "-fno-asynchronous-unwind-tables",
+ "-fno-exceptions",
+ "-fno-rtti",
+ "-fPIC",
+ "-fno-common",
+ "-fstack-protector-strong",
+ "-fvisibility-inlines-hidden",
+ "-flto",
+ ]
+ cflags_cc = cflags
+ ldflags = [
+ "-Wl,--as-needed",
+ "-Wl,--gc-sections",
+ "-Wl,--no-whole-archive",
+ ]
+
+ include_dirs = [
+ ".",
+ ]
+
+ sources = [ "sle_dli_interface_driver.cpp" ]
+
+ if (is_standard_system) {
+ external_deps = [
+ "c_utils:utils",
+ "hdf_core:libhdf_host",
+ "hdf_core:libhdf_ipc_adapter",
+ "hdf_core:libhdf_utils",
+ "hdf_core:libhdi",
+ "hilog:libhilog",
+ "ipc:ipc_single",
+ ]
+ } else {
+ external_deps = [
+ "hilog:libhilog",
+ "ipc:ipc_single",
+ ]
+ }
+
+ external_deps += [
+ "drivers_interface_nearlink:libnearlink_hci_stub_1.0",
+ "drivers_interface_nearlink:libnearlink_hci_stub_1.1",
+ ]
+
+ shlib_type = "hdi"
+ install_images = [ chipset_base_dir ]
+ subsystem_name = "hdf"
+ part_name = "drivers_peripheral_nearlink"
+}
+
+group("hdf_nearlink_service") {
+ deps = [
+ ":libnearlink_hci_hdi_driver",
+ ":libsle_hci_interface_service_1.1",
+ ]
+}
diff --git a/nearlink/dli/dli_service/implement/dli_internal.h b/nearlink/dli/dli_service/implement/dli_internal.h
new file mode 100644
index 0000000000..9349f42932
--- /dev/null
+++ b/nearlink/dli/dli_service/implement/dli_internal.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2026 Huawei Device Co., Ltd.
+ * 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 OHOS_HDI_NEARLINK_DLI_INTERNAL_H
+#define OHOS_HDI_NEARLINK_DLI_INTERNAL_H
+
+namespace OHOS {
+namespace HDI {
+namespace Nearlink {
+namespace Dli {
+typedef enum {
+ DLI_PACKET_TYPE_UNKNOWN = 0,
+ DLI_PACKET_TYPE_SLE_CMD = 0xA1,
+ DLI_PACKET_TYPE_SLE_EVENT = 0xA2,
+ DLI_PACKET_TYPE_SLE_ACB_DATA = 0xA3,
+ DLI_PACKET_TYPE_SLE_ICB_DATA = 0xA4,
+ DLI_PACKET_TYPE_MAX,
+} DliPacketType;
+
+struct PacketHeader {
+ uint8_t headerSize;
+ uint8_t dataLengthOffset;
+ uint8_t dataLengthSize;
+};
+
+// opcode (DLI_SLE_Cmd_Complete_Evt opcode)
+const uint16_t SLE_DLI_COMMAND_COMPLETE_EVENT = 0x0002;
+} // namespace Dli
+} // namespace Nearlink
+} // namespace HDI
+} // namespace OHOS
+#endif /* OHOS_HDI_NEARLINK_DLI_INTERNAL_H */
\ No newline at end of file
diff --git a/nearlink/dli/dli_service/implement/dli_protocol.cpp b/nearlink/dli/dli_service/implement/dli_protocol.cpp
new file mode 100644
index 0000000000..57859380a6
--- /dev/null
+++ b/nearlink/dli/dli_service/implement/dli_protocol.cpp
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2026 Huawei Device Co., Ltd.
+ * 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
+#include
+#include
+#include "nearlink_hdf_log.h"
+#include "dli_protocol.h"
+namespace OHOS {
+namespace HDI {
+namespace Nearlink {
+namespace Dli {
+const PacketHeader DliProtocol::header_[DLI_PACKET_TYPE_MAX] = {
+ {.headerSize = 0, .dataLengthOffset = 0, .dataLengthSize = 0}, /* 0 */
+ {.headerSize = 4, .dataLengthOffset = 2, .dataLengthSize = 2}, /* 1 */
+ {.headerSize = 4, .dataLengthOffset = 2, .dataLengthSize = 2}, /* 2 */
+ {.headerSize = 4, .dataLengthOffset = 2, .dataLengthSize = 2}, /* 3 */
+ {.headerSize = 4, .dataLengthOffset = 2, .dataLengthSize = 2}, /* 4 */
+};
+
+const PacketHeader &DliProtocol::GetPacketHeaderInfo(DliPacketType packetType)
+{
+ if (packetType >= DLI_PACKET_TYPE_MAX) {
+ return header_[DLI_PACKET_TYPE_UNKNOWN];
+ }
+ return header_[DliProtocol::TypeConvert(packetType)];
+}
+
+ssize_t DliProtocol::Read(int fd, uint8_t *data, size_t length)
+{
+ const int bufsize = 256;
+ char buf[bufsize] = {0};
+ ssize_t ret = TEMP_FAILURE_RETRY(read(fd, data, length));
+ if (ret == -1) {
+ strerror_r(errno, buf, sizeof(buf));
+ HDF_LOGE("read failed");
+ ret = 0;
+ }
+ return ret;
+}
+
+ssize_t DliProtocol::Write(int fd, const uint8_t *data, size_t length)
+{
+ const int bufsize = 256;
+ char buf[bufsize] = {0};
+ ssize_t ret = 0;
+ do {
+ ret = TEMP_FAILURE_RETRY(write(fd, data, length));
+ } while (ret == -1 && errno == EAGAIN);
+
+ if (ret == -1) {
+ strerror_r(errno, buf, sizeof(buf));
+ HDF_LOGE("write failed");
+ } else if (static_cast(ret) != length) {
+ HDF_LOGE("write data %{public}zd less than %{public}zu.", ret, length);
+ }
+ return ret;
+}
+
+uint8_t DliProtocol::TypeConvert(DliPacketType packetType)
+{
+ switch (packetType) {
+ case DLI_PACKET_TYPE_SLE_EVENT:
+ return static_cast(DLI_PACKET_TYPE_SLE_EVENT) & 0x0F;
+ default:
+ HDF_LOGE("type convert error.");
+ return 0;
+ }
+}
+} // namespace Dli
+} // namespace Nearlink
+} // namespace HDI
+} // namespace OHOS
\ No newline at end of file
diff --git a/nearlink/dli/dli_service/implement/dli_protocol.h b/nearlink/dli/dli_service/implement/dli_protocol.h
new file mode 100644
index 0000000000..427747c64b
--- /dev/null
+++ b/nearlink/dli/dli_service/implement/dli_protocol.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2026 Huawei Device Co., Ltd.
+ * 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 OHOS_HDI_NEARLINK_DLI_PROTOCOL_H
+#define OHOS_HDI_NEARLINK_DLI_PROTOCOL_H
+
+#include
+#include
+
+#include
+#include "dli_internal.h"
+
+namespace OHOS {
+namespace HDI {
+namespace Nearlink {
+namespace Dli {
+class DliProtocol {
+public:
+ using DliDataCallback = std::function &data)>;
+
+ DliProtocol() = default;
+ virtual ~DliProtocol() = default;
+
+ virtual ssize_t SendPacket(const std::vector &packetData) = 0;
+
+ const PacketHeader& GetPacketHeaderInfo(DliPacketType packetType);
+
+protected:
+ static ssize_t Read(int fd, uint8_t *data, size_t length);
+ static ssize_t Write(int fd, const uint8_t *data, size_t length);
+ static uint8_t TypeConvert(DliPacketType packetType);
+ static const PacketHeader header_[DLI_PACKET_TYPE_MAX];
+};
+} // namespace Dli
+} // namespace Nearlink
+} // namespace HDI
+} // namespace OHOS
+#endif /* OHOS_HDI_NEARLINK_DLI_PROTOCOL_H */
\ No newline at end of file
diff --git a/nearlink/dli/dli_service/implement/dli_watcher.cpp b/nearlink/dli/dli_service/implement/dli_watcher.cpp
new file mode 100644
index 0000000000..34c9bccc09
--- /dev/null
+++ b/nearlink/dli/dli_service/implement/dli_watcher.cpp
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2026 Huawei Device Co., Ltd.
+ * 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
+#include
+#include
+#include
+#include "nearlink_hdf_log.h"
+#include "sle_hal_constant.h"
+#include "dli_watcher.h"
+
+namespace OHOS {
+namespace HDI {
+namespace Nearlink {
+namespace Dli {
+DliWatcher::DliWatcher()
+{}
+
+DliWatcher::~DliWatcher()
+{
+ Stop();
+}
+
+bool DliWatcher::AddFdToWatcher(int fd, DliDataCallback callback)
+{
+ std::lock_guard lock(fdsMutex_);
+ fds_[fd] = callback;
+ ThreadWakeup();
+ return true;
+}
+
+bool DliWatcher::RemoveFdToWatcher(int fd)
+{
+ std::lock_guard lock(fdsMutex_);
+ fds_.erase(fd);
+ ThreadWakeup();
+ return true;
+}
+
+bool DliWatcher::SetTimeout(std::chrono::milliseconds timeout, TimeoutCallback callback)
+{
+ std::chrono::seconds seconds = std::chrono::duration_cast(timeout);
+ std::lock_guard lock(timeoutMutex_);
+ timeoutTimer_.tv_sec = seconds.count();
+ timeoutTimer_.tv_usec = (timeout - seconds).count();
+ timeoutCallback_ = callback;
+ ThreadWakeup();
+ return true;
+}
+
+bool DliWatcher::Start()
+{
+ if (running_.exchange(true)) {
+ return true;
+ }
+
+ {
+ std::lock_guard lock(wakeupPipeMutex_);
+ if (pipe(wakeupPipe_) != 0) {
+ HDF_LOGE("DliWatcher create pipe failed.");
+ running_.exchange(false);
+ return false;
+ }
+ }
+
+ thread_ = std::thread(std::bind(&DliWatcher::WatcherThread, this));
+ if (!thread_.joinable()) {
+ HDF_LOGE("thread is not joinable.");
+ running_.exchange(false);
+ return false;
+ }
+
+ int policy = SLE_THREAD_POLICY;
+ sched_param params = {.sched_priority = SLE_THREAD_PRIORITY};
+ if (pthread_setschedparam(thread_.native_handle(), policy, ¶ms) != 0) {
+ HDF_LOGW("pthread_setschedparam failed tid[%{public}lu] policy[%{public}d]", thread_.native_handle(), policy);
+ }
+
+ return true;
+}
+
+bool DliWatcher::Stop()
+{
+ if (!running_.exchange(false)) {
+ return true;
+ }
+
+ ThreadWakeup();
+ thread_.join();
+
+ {
+ std::lock_guard lock(wakeupPipeMutex_);
+ close(wakeupPipe_[0]);
+ close(wakeupPipe_[1]);
+ }
+ HDF_LOGI("DliWatcher stop");
+ return true;
+}
+
+void DliWatcher::CheckFdReady(std::map& fds, fd_set &readFds)
+{
+ std::lock_guard lock(fdsMutex_);
+ for (auto &&fd : fds_) {
+ if (FD_ISSET(fd.first, &readFds)) {
+ fd.second(fd.first);
+ }
+ }
+}
+
+void DliWatcher::InitReadFds(fd_set &readFds, int &nfds)
+{
+ FD_ZERO(&readFds);
+ {
+ std::lock_guard lock(wakeupPipeMutex_);
+ FD_SET(wakeupPipe_[0], &readFds);
+ nfds = wakeupPipe_[0];
+ }
+ {
+ std::lock_guard lock(fdsMutex_);
+ for (auto &&fd : fds_) {
+ FD_SET(fd.first, &readFds);
+ nfds = std::max(fd.first, nfds);
+ }
+ }
+}
+
+void DliWatcher::HandleTimeout()
+{
+ TimeoutCallback callback;
+ {
+ std::lock_guard lock(timeoutMutex_);
+ callback = timeoutCallback_;
+ }
+ if (callback) {
+ callback();
+ }
+}
+
+void DliWatcher::HandleSelectEvent(fd_set &readFds)
+{
+ {
+ std::lock_guard lock(wakeupPipeMutex_);
+ if (FD_ISSET(wakeupPipe_[0], &readFds)) {
+ uint8_t buff = 0;
+ TEMP_FAILURE_RETRY(read(wakeupPipe_[0], &buff, sizeof(buff)));
+ }
+ }
+ if (running_) {
+ CheckFdReady(fds_, readFds);
+ }
+}
+
+void DliWatcher::WatcherThread()
+{
+ fd_set readFds;
+ int nfds;
+ timeval *timeout = nullptr;
+
+ while (running_) {
+ InitReadFds(readFds, nfds);
+ {
+ std::lock_guard lock(timeoutMutex_);
+ if (timeoutTimer_.tv_sec == 0 && timeoutTimer_.tv_usec == 0) {
+ timeout = nullptr;
+ } else {
+ timeout = &timeoutTimer_;
+ }
+ }
+ int ret = select(nfds + 1, &readFds, nullptr, nullptr, timeout);
+ if (ret < 0) {
+ continue;
+ } else if (ret == 0) {
+ HandleTimeout();
+ } else {
+ HandleSelectEvent(readFds);
+ }
+ }
+ HDF_LOGI("DliWatcher thread is stop!");
+}
+
+void DliWatcher::ThreadWakeup()
+{
+ std::lock_guard lock(wakeupPipeMutex_);
+ uint8_t buff = 0;
+ ssize_t ret = TEMP_FAILURE_RETRY(write(wakeupPipe_[1], &buff, sizeof(buff)));
+ if (ret == -1) {
+ HDF_LOGE("wake up failed err:%{public}s", strerror(errno));
+ }
+}
+} // namespace Dli
+} // namespace Nearlink
+} // namespace HDI
+} // namespace OHOS
\ No newline at end of file
diff --git a/nearlink/dli/dli_service/implement/dli_watcher.h b/nearlink/dli/dli_service/implement/dli_watcher.h
new file mode 100644
index 0000000000..8117ef49ce
--- /dev/null
+++ b/nearlink/dli/dli_service/implement/dli_watcher.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2026 Huawei Device Co., Ltd.
+ * 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 OHOS_HDI_NEARLINK_DLI_WATCHER_H
+#define OHOS_HDI_NEARLINK_DLI_WATCHER_H
+
+#include
+#include
+#include
+#include