> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man1/btsockstat.1.md).

# btsockstat.1

`btsockstat` — 显示 Bluetooth 套接字信息

## 名称

`btsockstat`

## 概要

`btsockstat [-nrh] [-M core] [-p protocol]`

## 描述

`btsockstat` 实用程序以符号形式显示各种与 Bluetooth 套接字相关的数据结构内容。根据所呈现信息对应选项的不同，输出格式有若干种。`btsockstat` 实用程序将结果输出到标准输出，错误信息输出到标准错误。

选项如下：

**`-h`** 显示用法信息并退出。

**`-M`** `core` 从指定的 core 文件而非默认的 **/dev/kmem** 中提取与名称列表关联的值。

**`-n`** 以数字形式显示 Bluetooth 地址。默认情况下，`btsockstat` 会尝试解析 Bluetooth 地址并以符号形式显示。

**`-p`** `protocol` 显示指定协议的活动套接字（协议控制块）列表。支持的协议有：`hci_raw`、`l2cap_raw`、`l2cap`、`rfcomm` 和 `rfcomm_s`。

**`-r`** 显示指定协议的活动路由条目（如果有）。

## 退出状态

`btsockstat` 实用程序成功时退出值为 0，发生错误时退出值大于 0。

## 参见

[ng\_btsocket(4)](https://github.com/FreeBSD-Ask/freebsd-man-sc/blob/main/man4/ng_btsocket.4.md)

## 作者

Maksim Yevmenkin <m_evmenkin@yahoo.com>

## 缺陷

很可能存在缺陷。如发现请报告。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man1/btsockstat.1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
