• Atitit 搜索蓝牙设备 powershell的实现 java noede.js python 先用脚本语言python nodejs,不好实现。。Java 也不好实现。。 Netcore可以,


    Atitit 搜索蓝牙设备 powershell的实现  java noede.js python

     

    先用脚本语言python nodejs,不好实现。。Java 也不好实现。。

    Netcore可以,但是找不到config

     

    只好使用powershell了。。

     

     

     

    "halo"

    [reflection.assembly]::LoadFile("C:workspaceluetoothPrjInTheHand.Net.Personal.dll")

    Add-Type –Path "C:workspaceluetoothPrjInTheHand.Net.Personal.dll"

    Add-Type -AssemblyName mscorlib

    #Add-Type -AssemblyName "C:workspaceluetoothPrjInTheHand.Net.Personal"

    $Blueclient = New-Object InTheHand.Net.Sockets.BluetoothClient

     

    # $BuleRadio = BluetoothRadio.PrimaryRadio;

    $Devices = $Blueclient.DiscoverDevices();

    $Devices

     

     

    返回

     

    PS C:WindowsSystem32WindowsPowerShellv1.0> C:WindowsSysWOW64WindowsPowerShellv1.0无标题1.ps1

    halo

     

    GAC    Version        Location                                                                                                                                                                                    

    ---    -------        --------                                                                                                                                                                                    

    False  v2.0.50727     C:workspaceluetoothPrjInTheHand.Net.Personal.dll                                                                                                                                       

     

    DeviceAddress     : D467D39B9344

    DeviceName        : OPPO A7x

    ClassOfDevice     : 5A020C

    Rssi              : -2147483648

    InstalledServices : {00001105-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb, 0000110c-0000-1000-8000-00805f9b34fb, 0000110e-0000-1000-8000-00805f9b34fb...}

    Connected         : False

    Remembered        : True

    Authenticated     : True

    LastSeen          : 2019/9/20 17:03:13

    LastUsed          : 2019/9/12 16:14:28

     

    22

     

     

     

    _______________________________________________________________________________________________________________________________________________________________________________________________________________

     

     

    Atitit 蓝牙开发 搜索蓝牙设备 java noede.js python

     

    先查询跨语言类库wmi 结果貌似没有

    没有shell工具

    java资料bluecove

    Node.js但是需要替换驱动麻烦。。

    搜索Python库看看

    需要安装替换vc sdk ,pass

    Powershell 试试看  貌似没有提示不好做

     

    安装vscode  net包管理器插件paket,然后下载蓝牙库32feet.NET

     

    C:Usersaaa.ATTILAXPC188.vscodeextensionsionide.ionide-paket-1.12.0inpaket.exe add nuget 32feet.NET

     

     

     

    using System;

    using System.Collections.Generic;

    using InTheHand.Net;

    using InTheHand.Net.Bluetooth;

    using InTheHand.Net.Sockets;

    using Newtonsoft.Json;

    using System.Configuration;

    using System.IO;

    using System.Reflection;

     

    namespace eee

    {

        class Program

        {

            static void Main(string[] args)

            {

     

                     //  #pragma comment(lib, "dllSystem.Configuration.dll");

                      var path = new FileInfo(Assembly.GetExecutingAssembly().Location);

                     var a = Assembly.LoadFile(Path.Combine(path.DirectoryName"lib\System.Configuration.dll"));

                    //InTheHand.Net.Sockets.BluetoothClient

                     Console.WriteLine(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5);

                   

                    BluetoothClient Blueclient = new BluetoothClient();

                    Dictionary<stringBluetoothAddressdeviceAddresses = new Dictionary<stringBluetoothAddress>();

     

               //     Newtonsoft.JsonConvert

                    BluetoothRadio BuleRadio = BluetoothRadio.PrimaryRadio;

                    BuleRadio.Mode = RadioMode.Connectable;

                    BluetoothDeviceInfo[] Devices = Blueclient.DiscoverDevices();

                    //  System.Configuration.dll

                    Console.WriteLine(    Newtonsoft.Json.JsonConvert.SerializeObject(Devices) );

                    Console.WriteLine("Hello World!");

            }

        }

    }

     

     

     

    用C#调用蓝牙编程 - ZWmaqing - 博客园.mhtml

    如何在C#中仅发现打印机蓝牙设备? - 问答 - 云+社区 - 腾讯云.mhtml

     

  • 相关阅读:
    Angular项目在npm install之后用ng serve启动发生错误
    (TODO)Angular的通道
    使用React+redux+Node.js+MongoDB开发(二)--使用redux
    Angular中使用DomSanitizer防范跨站脚本攻击类(XSS)的安全问题
    使用React+redux+Node.js+MongoDB开发(一)
    数组的数字和非数字下标的区别
    echarts绘制饼图时的一点特殊设置
    Angular项目中迭代生成的树,激活选中的节点,并将节点数据发送到父节点
    Ubuntu 设定壁纸自动切换的shell脚本
    Navicat for mysql linux 破解方法
  • 原文地址:https://www.cnblogs.com/attilax/p/15197055.html
Copyright © 2020-2023  润新知