Skip to content

Instantly share code, notes, and snippets.

@wwj718
Last active September 26, 2018 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwj718/a6bcf832b6170b932a7264d37bdaee9a to your computer and use it in GitHub Desktop.
Save wwj718/a6bcf832b6170b932a7264d37bdaee9a to your computer and use it in GitHub Desktop.
# python3.6 ubtrobot alpha1p
from serial.tools.list_ports import comports as list_serial_ports
ports = list_serial_ports()
for i in ports:
print(i[0])
print(i[1])
print(i[2])
# 00010039_PID 是确定的吗
'''
COM1
通信端口 (COM1)
ACPI\PNP0501\1
COM3
Bluetooth 链接上的标准串行 (COM3)
BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\8&2B048E4D&0&000000000000_00000000
COM4
Bluetooth 链接上的标准串行 (COM4)
BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_VID&00010039_PID&5050\8&2B048E4D&0&881B9906E566_C00000000
'''
import serial
port = "COM4"
ser = serial.Serial(port)
print(ser.name)
cmd = [0xFB,0xBF,0x0b,0x03, 0xd7,0xf3,0xb3,0xf6,0xc8,0xad ,0xf6,0xED]
ser.write(serial.to_bytes(cmd))
@wwj718
Copy link
Author

wwj718 commented Sep 5, 2018

shenyu 电脑上: 设备 BTHENUM{00001101-0000-1000-8000-00805f9b34fb}_VID&00010039_PID&5050\7&3613bd8e&0&881B9906E566_C00000000 需要进一步安装。

@wwj718
Copy link
Author

wwj718 commented Sep 5, 2018

确认是蓝牙和00010039_PID就行

@wwj718
Copy link
Author

wwj718 commented Sep 26, 2018

新的机器人 BTHENUM{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\8&2B048E4D&0&000000000000_00000000

规则: https://msdn.microsoft.com/en-us/library/windows/hardware/ff536681(v=vs.85).aspx

蓝牙驱动程序堆栈根据以下模板生成硬件ID:

BTHENUM \ { ServiceGUID } _VID& nnnnnnnn

BTHENUM \ { ServiceGUID } _VID& nnnnnnnn _PID& nnnn

BTHENUM \ { ServiceGUID } _LOCALMFG& nnnn

@wwj718
Copy link
Author

wwj718 commented Sep 26, 2018

新的机器人 win7

COM6
Bluetooth 链接上的标准串行 (COM6)
BTHENUM{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\9&1C8BD124&0&000000000000_00000000
COM8
Bluetooth 链接上的标准串行 (COM8)
BTHENUM{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\9&1C8BD124&0&000000000000_00000001
COM5
Bluetooth 链接上的标准串行 (COM5)
BTHENUM{00001101-0000-1000-8000-00805F9B34FB}_VID&00010039_PID&5050\9&1C8BD124&0&881B9906E566_C00000000
COM7
Bluetooth 链接上的标准串行 (COM7)
BTHENUM{00001101-0000-1000-8000-00805F9B34FB}_VID&00010039_PID&5050\9&1C8BD124&0&881B9908AF2D_C00000000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment