ble_stub.go 629 B

1234567891011121314151617181920212223242526272829303132
  1. //go:build !linux && !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("BLE 不支持当前平台,蓝牙功能已禁用")
  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 被调用但平台不支持: %s", mode)
  21. }
  22. func (c *Client) Close() {
  23. close(c.stopChan)
  24. }
  25. var ErrUnsupported = fmt.Errorf("BLE 不支持当前平台")