首页 > 编程语言 >How to use Raspberry Pi scan bluetooth devices All In One

How to use Raspberry Pi scan bluetooth devices All In One

时间:2023-05-17 23:33:35浏览次数:54  
标签:use scan python devices bluetooth https print Pi com

How to use Raspberry Pi scan bluetooth devices All In One

蓝牙

$ sudo pip3 install pybluez

#!/usr/bin/env python3

import bluetooth

def scan():
    print("Scanning for bluetooth devices:")
    devices = bluetooth.discover_devices(lookup_names = True, lookup_class = True)
    number_of_devices = len(devices)
    print(number_of_devices,"devices found")
    for addr, name, device_class in devices:
        print("\n")
        print("Device:")
        print("Device Name: %s" % (name))
        print("Device MAC Address: %s" % (addr))
        print("Device Class: %s" % (device_class))
        print("\n")
    return

https://geektechstuff.com/2020/06/01/python-and-bluetooth-part-1-scanning-for-devices-and-services-python/

https://forums.raspberrypi.com/viewtopic.php?t=329762

from bluetooth import *

print "performing inquiry..."

nearby_devices = discover_devices(lookup_names = True)

print "found %d devices" % len(nearby_devices)

for name, addr in nearby_devices:
     print " %s - %s" % (addr, name)

https://stackoverflow.com/questions/21000680/how-to-find-visible-bluetooth-devices-in-python

http://www.robertprice.co.uk/robblog/2007/01/programming_bluetooth_using_python-shtml/

https://github.com/karulis/pybluez

http://karulis.github.io/pybluez/

https://github.com/EnableTech/raspberry-bluetooth-demo

demos


(

标签:use,scan,python,devices,bluetooth,https,print,Pi,com
From: https://www.cnblogs.com/xgqfrms/p/17410677.html

相关文章

  • 什么是 Angular Ivy Partial compilation mode
    compilingwithAngularsourcesinIvypartialcompilationmode.AngularIvypartialcompilationmode是AngularIvy编译器的一种模式,它是为了优化Angular应用程序的性能而引入的。在这种模式下,编译器只会重新编译那些发生变化的部分,而不会重新编译整个应用程序。这种......
  • How to use micro:bit V2 to control built-in sensors All In One
    Howtousemicro:bitV2tocontrolbuilt-insensorsAllInOnemicro:bitV2&PythonMakeCodeMakeCodeformicro:bithttps://makecode.microbit.org/https://www.microsoft.com/zh-cn/makecodeAdafruitCircuitPlaygroundExpresshttps://makecode.a......
  • RapidVideOCR(视频硬字幕提取工具)新增exe版
    引言考虑到提取视频字幕的小伙伴大多不是程序员行当,为了降低使用门槛,特此推出界面版的RapidVideOCRDesktop.RapidVideOCRDesktop需要搭配VideoSubFinder使用。它们两个关系如下图所示:flowchartLRA(VideoSubFinder)--提取字幕关键帧-->B(RapidVideOCR)--OCR-->C......
  • APIO真题选做
    [APIO2020]粉刷墙壁​ 将长度为\(n\)的墙壁涂色,共有\(k\)种颜色,第\(i\)段墙壁期望的颜色为\(c_i\)。有\(m\)个粉刷公司,第\(i\)个粉刷公司可以涂\(a_i\)种颜色(是给定的)。现在可以提出若干个形如\(x\;y\;(0\lex<m,0\ley\len-m)\)的要求,只有当对于所有的\(0\le......
  • Day01 web应用模式与api接口
    1Web应用模式#前后端混合开发 -后端人员,既要写后端,django,又要写前端#前后端分离 -后端人员,只写后端,写一个个的API接口-前端人员,只写前端-最后项目写完,前后端联调2API接口#为了在团队内部形成共识、防止个人习惯差异引起的混乱,我们需要找到一种大家都觉得......
  • ASP.NET Core Swagger接入使用IdentityServer4 的 WebApi
    写在前面是这样的,我们现在接口使用了Ocelot做网关,Ocelot里面集成了基于IdentityServer4的开发的授权中心用于对Api资源的保护。问题来了,我们的Api用了SwaggerUI做接口的自文档,那就蛋疼了,你接入了IdentityServer4的Api,用SwaggerUI调试、调用接口的话,妥妥的401,未授权啊。那有小伙伴就......
  • 《Typora+PicGo +Github + jsDelivr + TinyPNG打造稳定快速、高效免费图床》的体验
    《Typora+PicGo+Github+jsDelivr+TinyPNG打造稳定快速、高效免费图床》前言我目前已完成Typora+PicGo图床配置以及PicGo上传失败的解决办法。不过看了EvanXu的这个图床后,发现还可以改进。原先我用的typora+PicGo+Gitter打造图床,而EvanXu的方法是用GItHub做仓库,用jsDelivr做C......
  • 【Azure 服务总线】如何批量删除Azure Service Bus中的Topics(数量较多,需要过滤后批量
    问题描述AzureServiceBus的门户操作页面上,是否可以批量删除其中的Topics呢? 问题解答AzureServiceBus门户或ServiceBusExplorer工具没有提供批量删除Topic的方法。但是可以自己写脚本删除,并且可以在删除的时候自定义过滤条件。以Python举例:第一步:在本地安装PythonServiceB......
  • 电流信号输入输出板,风电控制器控制板,光伏PID抑制器,逆变器总控板,公司DSP项目,如下:
    电流信号输入输出板,风电控制器控制板,光伏PID抑制器,逆变器总控板,公司DSP项目,如下:1)4通道-10mA~10mA电流信号采集,4路-40mA~40mA电流信号采集,1路-40mA~40mA电流信号输出。采用TMS320F28035控制,CAN通讯,提供原理图,PCB,元器件明细表。2)风力发电控制板,主要涉及电压电流信号采集,PWM波输出,风......
  • iPictrue:图片标注提示
    iPictrue是一款基于jQuery,能在图片上的任意位置标注提示信息的插件,使用iPictrue可以让图片内容更丰富,提高互动性,适用于一些需要注释图片信息的应用如产品结构图等,它还支持图片、链接等html内容。HTML首先在页面中加入jquery库以及iPicture插件,以及css样式文件。<linkrel="styl......