Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

BTPowerNotice Plugin

TrafficMonitor 蓝牙电量显示插件(第三方)

License: MIT

TrafficMonitor 的任务栏/主窗口中显示蓝牙耳机的实时电量信息,鼠标悬停也可查看。

效果

功能

  • 显示蓝牙耳机电量:左耳 / 右耳 / 充电盒
  • 鼠标悬停 tooltip 显示详细电量
  • 任务栏/主窗口可勾选显示
  • 后台线程自动刷新(10 秒间隔)
  • 支持耳机断连后自动重连

兼容性

项目 说明
平台 Windows 10 / 11 (x64)
TrafficMonitor 1.82+(插件 API v7)
耳机协议 Redmi AirDots 3 Pro / 兼容 Gadgetbridge 逆向协议的耳机
依赖 无(纯原生 DLL)

编译

# 需要: Visual Studio 2022 + Windows SDK 10.0.26100
msbuild BTPowerNoticePlugin/BTPowerNoticePlugin.vcxproj /p:Configuration=Release /p:Platform=x64

编译产物:BTPowerNoticePlugin.dll → 复制到 TrafficMonitor 的 plugins/ 目录。

使用

  1. Windows 蓝牙设置中配对耳机
  2. 启动 TrafficMonitor
  3. 右键菜单 → 其他功能插件管理 → 勾选"蓝牙电量插件"
  4. 右键菜单 → 显示项目 → 勾选"蓝牙电量"
  5. 鼠标悬停查看电量

技术架构

TrafficMonitor.exe (原生 MFC)
  └─ LoadLibrary → BTPowerNoticePlugin.dll (纯原生 C++)
                    ├─ Win32 Bluetooth API (RFCOMM / SDP)
                    ├─ SAFER+ 认证算法(独立实现)
                    └─ 自定义 FE DC BA 协议编解码

核心技术

  • 蓝牙 RFCOMM: Win32 Winsock AF_BTH
  • 设备发现: BluetoothFindFirstDevice API
  • 认证协议: SAFER+ (Gadgetbridge 逆向工程)
  • 电量数据: TLV 格式,index 0x07

协议

本插件基于 TrafficMonitor 插件开发指南 开发。

// PluginInterface.h © zhongyang219
// https://github.com/zhongyang219/TrafficMonitor/blob/master/include/PluginInterface.h

License

MIT

About

TrafficMonitor 蓝牙电量显示插件 — 纯原生 C++,零依赖

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages