微信公众号--设备功能---添加产品----微信硬件授权

微信公众号--设备功能---添加产品----微信硬件授权

此处测试使用的是一款带蓝牙功能的设备,该设备添加在微信公众号中,用户扫描二维码绑定设备,二维码生成在接下来会进行讲解。

1、打开微信公共号

2、添加产品

3、设置开启状态提醒,这样每次进入微信公众号,就会自动去检测设备,连接设备

4、添加产品成功后,记住产品编号44871

5、打开微信公众平台接口调试工具

https://mp.weixin.qq.com/debug/cgi-bin/apiinfo

6、通过token+产品编号获取deviceid,保存好deviceid,

获取的qrticket是一个链接,将该链接转成二维码,(通过草料二维码工具生成:https://cli.im/url)

7、授权

参数:

  1.  
    {
  2.  
    "device_num":"1",
  3.  
    "device_list":[
  4.  
    {
  5.  
    "id":"deviceid",
  6.  
    "mac":"A81B6A76048E",
  7.  
    "connect_protocol":"3",
  8.  
    "auth_key":"",
  9.  
    "close_strategy":"1",
  10.  
    "conn_strategy":"1",
  11.  
    "crypt_method":"0",
  12.  
    "auth_ver":"0",
  13.  
    "manu_mac_pos":"-1",
  14.  
    "ser_mac_pos":"-1",
  15.  
    "ble_simple_protocol": "0"
  16.  
    }
  17.  
    ],
  18.  
    "op_type":"1",
  19.  
    "product_id": "44873"
  20.  
    }
原文地址:https://www.cnblogs.com/123hll/p/9396826.html