ble_windows.go 656 B

1234567891011121314151617181920212223242526272829303132
  1. //go:build windows
  2. package ble
  3. import "fmt"
  4. type Client struct {
  5. deviceName string
  6. modeChan chan string
  7. stopChan chan struct{}
  8. connected bool
  9. currentMode string
  10. }
  11. func New(deviceName string) *Client {
  12. logWarn("Windows BLE 暂不支持,蓝牙功能已禁用 (winrt-go 缺少 enumeration 包)")
  13. return &Client{
  14. deviceName: deviceName,
  15. modeChan: make(chan string, 10),
  16. stopChan: make(chan struct{}),
  17. }
  18. }
  19. func (c *Client) SetMode(mode string) {
  20. logDebug("BLE SetMode 被调用但 Windows 暂不支持: %s", mode)
  21. }
  22. func (c *Client) Close() {
  23. close(c.stopChan)
  24. }
  25. var ErrUnsupported = fmt.Errorf("Windows BLE 暂不支持")