zoukankan      html  css  js  c++  java
  • 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

     

  • 相关阅读:
    [HAOI2016]食物链
    [TJOI2011]序列
    P2548 [AHOI2004]智能探险车
    [JSOI2008]最大数
    模板之dinic
    Excim的NOIP2017游记
    数列排序
    Car的旅行路线
    [HAOI2006]均分数据
    [luogu2210] Haywire
  • 原文地址:https://www.cnblogs.com/attilax/p/15197055.html
Copyright © 2011-2022 走看看