How to get the processor serial number of Raspberry PI 2 with Windows IOT

徘徊边缘 提交于 2019-12-10 01:59:07

问题


I need to get the processor serial number of a Raspberry Pi2 that is running windows 10 IoT.


回答1:


Usually this is within the Windows.System.Profile.HardwareIdentification namespace. Unfortunately, that's one of the unsupported namespaces with Win10 IoT Core.

Instead, to identify the metal, I'm using info from the network adaptor(s):

    public static HashSet<string> NetworkIds()
    {
        var result = new HashSet<string>();

        var networkProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles().ToList();

        foreach (var net in networkProfiles)
        {
            result.Add(net.NetworkAdapter.NetworkAdapterId.ToString());
        }

        return result;
    }

Of course, this is not completely error proof, but, so far, the only way I can see to get a reasonably reliable device ID.




回答2:


I've extracted a code sample from the Microsoft's IoT Sample (IoTCoreDefaultApp) that might helpful to you to extract device information (unfortunately, processor serial number never exposed for programming).

How to get Windows IoT device's information:




回答3:


Use this code to get device information.

            Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInfo= new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();



回答4:


The serial number can be found in /proc/cpuinfo

or you can use Basic Bash piping ie, cat /proc/cpuinfo | grep Serial | cut -d ':' -f 2



来源:https://stackoverflow.com/questions/33960375/how-to-get-the-processor-serial-number-of-raspberry-pi-2-with-windows-iot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!