
Cross-platform USB HID/BLE smart mouse SDK with a C ABI for device events and audio. Windows x64/mac
Cross-platform USB HID/BLE smart mouse SDK with a C ABI for device events and audio. Windows x64/mac
| 资源 | 入口 |
|---|---|
| Windows 10 / 11 x64 · SDK 0.4.20 | 下载 Windows ZIP |
| macOS 11+ ARM64 · SDK 0.4.20 | 下载 Apple Silicon ZIP |
| 版本说明与全部发布 | GitHub Releases |
| 完整接入文档 v2.2 | 中文指南 · English guide |
| C 示例与公共接口 | 按场景选示例 · umouse_sdk.h |
| Linux / UOS / 麒麟 / 方德等平台包、兼容硬件与样机 | 获取方式与技术支持 |
git clone https://github.com/SonicloudTech/mouse-sdk.git
cd mouse-sdkuMouseSdk/include/umouse_sdk.h,且 SDK 动态库位于 uMouseSdk/ 下。仓库 packages/ 也保留这两个平台包。Windows x64: bat cl /I uMouseSdk\include demo\demo.c /Fe:umouse-demo.exe /link /LIBPATH:uMouseSdk uMouseSdk.lib set "PATH=%CD%\\\uMouseSdk;%PATH%" umouse-demo.exe macOS ARM64: sh cc -IuMouseSdk/include demo/demo.c -LuMouseSdk -luMouseSdk -Wl,-rpath,@executable_path/uMouseSdk -o umouse-demo ./umouse-demo Keep the relative location of the runtime library and the SDK main library. For Windows, see the README in the package for instructions on loading the DLL/VC runtime library. For macOS, Bluetooth access is required when using BLE for the first time, and the FFmpeg dynamic library is included in the package, so no additional installation is required. The example prints the SDK version; after the device is connected, the message [connected] is displayed, followed by output of device events and audio length, and the received PCM is saved as out.pcm. Press Enter to exit. The ability to read the version number only indicates that the library has been loaded; device connection and callback data are used to confirm the hardware link. The core call sequence is: **register callback → um_sdk_init() → business processing → um_sdk_close(). The SDK provides buttons, device events, and audio data; voice recognition and button business mapping are implemented by the application. For more steps and troubleshooting, see the complete access guide.
| 场景 | 示例 |
|---|---|
| 声云设备基础接入:按键、设备信息与 PCM 音频 | demo.c — FULL 模式最小示例 |
| 声云设备原始帧透传,自行解析协议 | demo2.c — RAW 模式、握手与通道切换 |
| 声云设备与自定义设备同时在线 | demo3.c — 多规则、多设备,FULL / RAW 共存 |
| 用自定义标识、握手和解析逻辑接入外部硬件 | demo4.c — 替换默认规则的完整示例 |
demo4.c 当前用声云设备的实际标识和协议演示接入流程;接入自有硬件时,需要替换 HW_* 配置、握手和解析逻辑。USB 自定义硬件的数据通道须位于所选接口的首个 HID 顶层集合或独占接口,并支持 Output Report 或 Feature Report 写入。完整前提与示例选择见示例说明;此路径不代表任意 USB / BLE 设备无需适配即可使用。
code 透传,不做业务映射。um_write_raw 双向传输。| 系统 | 架构 | USB | BLE | 交付方式 |
|---|---|---|---|---|
| Windows 10 / 11 | x64 | ✅ | ✅ | 公开下载 |
| macOS 11+ | ARM64(Apple Silicon) | ✅ | ✅ | 公开下载 |
| 统信 UOS | x86_64 / ARM64 | ✅ | ✅ | 联系获取 |
| 麒麟 Kylin | x86_64 / ARM64 | ✅ | ✅ | 联系获取 |
| 方德 FangDe | x86_64 / ARM64 | ✅ | ✅ | 联系获取 |
| 通用 Linux | x86_64 | ✅ | ✅ | 联系获取 |
| macOS(Intel) | x86_64 | ✅ | ✅ | 联系获取 |
SDK 内部源码以 CMake 工程跨系统、跨架构构建,公开接口使用统一的 C ABI 与 JSON 事件协议。本仓库公开的是交付包和接入资源,不含 SDK 完整源码;当前可直接下载 Windows x64 与 macOS ARM64 包,其余组合按上表联系获取。二进制按系统和架构分别构建,不能互换;Linux 各发行版也需选用匹配的包。
For hardware specifications, sample machines, complete protocols, Linux/WinRT and other architecture packages, commercial licenses, and technical support, please contact Anhui SoniCloud Intelligent Technology Co., Ltd. Please specify the target system and architecture, device model, expected quantity, and application scenario.
Is this a universal driver that supports any USB or Bluetooth mouse?
不是。FULL 模式处理兼容的声云设备;自有硬件需要通过 RAW 模式适配设备匹配、握手和帧解析。可从示例选择说明及 demo4.c 开始,具有 USB 或 BLE 连接本身并不足以接入。
可以通过公开 C ABI 调用:Python 使用 ctypes,Electron / Node.js 可使用 koffi 等 FFI 库,C# 使用 P/Invoke。应用进程架构必须匹配原生包;保持回调对象存活,如需保留回调缓冲区,应在回调返回前复制,并遵守接入指南的生命周期约定。仓库提供的独立可编译示例是 C 程序,并非每种语言都有打包应用。
检查进程架构、动态库搜索路径和下载包内的全部运行依赖。保留 SDK 随附的 FFmpeg 与 VC 运行库 DLL,并按包内 README 配置加载方式,不要只复制主 DLL。macOS 同样需要保留配套 dylib,使用 BLE 时允许蓝牙访问。
当前公开的 v0.4.20 发布包含 Windows x64 与 macOS ARM64 包。平台矩阵中的 Linux、UOS、麒麟、方德及其他组合通过技术支持获取。申请时说明准确的系统和架构;不同平台二进制不能互换。
SDK 提供设备事件和音频,应用负责语音识别与业务动作。需要 AI 智能体控制硬件鼠标时,使用独立的 mouse-mcp 服务器;它的公开发布包面向 Windows x64,并需要兼容硬件。SDK 二进制许可与 MIT 示例代码许可分别适用。
请通过 GitHub Issues 反馈,并附上目标系统与架构、设备型号、SDK 版本(um_sdk_version())、复现步骤及 um_sdk_init(1) 开启的相关日志。
AtomGit:荣获AtomGit 官方 G-Star 优质开源项目认证。