MiniX自绘渲染跨平台框架
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 快速上手
  • Basic 基础

  • Account

  • UI 界面

  • Device 设备

  • Bluetooth 蓝牙

    • connectBluetooth 连接蓝牙设备
    • startBluetoothDiscovery 开始扫描附近蓝牙设备
      • stopBluetoothDiscovery 结束扫描附近蓝牙设备
      • getAllConnectedDeviceInfo 获取已发现的所有设备
      • readBlueToothData 读取蓝牙数据
      • sendBlueToothData 发送蓝牙数据
      • blueToothEnable 打开蓝牙
      • disConnectBluetooth 断开蓝牙连接
    • Wifi WiFi

    • HomeManage 家庭管理

    • RoomManage 房间管理

    • Media 媒体

    • Location 定位

    • Encryption 加/解密

    • FileStorage 文件/存储

    • Http 网络/请求

    • weather 天气信息

    • Siri

    • TelPhone

    # startBluetoothDiscovery ^6.8

    开始扫描附近蓝牙设备

    # 请求参数

    Prop Type Default Comment
    mac String N/A //安卓:蓝牙 Mac 地址;iOS:外设 uuid
    name String N/A 筛选的名字
    duration String N/A 扫描持续时间 单位秒

    # 引入接口模块

    import bridge from '@minix-iot/etsbridge-sdk'
    
    1

    # 接口调用示例

    let params = {
      name: 'QWQ001-', // 可选 筛选的名字
      mac: '1812', // 可选 筛选的mac
      duration: '5', //单位秒, 可选
    }
    bridge
      .startBluetoothDiscovery(params)
      .then((res) => {
        console.log(res)
      })
      .catch((err) => {
        console.log(err)
      })
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    # 返回参数

    • 成功时返回
    Prop Type Comment
    code Number -
    name String 名字
    rssi String -
    deviceId String -

    # 返回示例

    • 当扫描到的蓝牙设备(蓝牙信息)时,APP 通知插件结果
    • 扫描期间会多次通知,每发现一个记录通知一次
    // 通过receiveMessageFromApp事件返回。
    this.$bridge.addEventListener('receiveMessageFromApp', (res) => {
      console.log('startBluetoothDiscovery', JSON.stringify(res))
      this.$bridge.showToast({
        title: JSON.stringify(res),
        duration: 5,
      })
    })
    
    1
    2
    3
    4
    5
    6
    7
    8