файл.
я есть ноль в последовательном порте после того, как я открываю SerialDevice в C # на Windows IoT Core 10, работающем на Raspberry Pi 3.
Вот код:
string aqs = SerialDevice.GetDeviceSelector();
DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(aqs);
List<DeviceInformation> list = devices.ToList();
DeviceInformation di = list.First();
serialPort = await SerialDevice.FromIdAsync(di.Id);
serialPort
являетсяnull
.
di.Id
равна:Id "\\\\?\\ACPI#BCM2836#0#{86e0d1e0-8089-11d0-9ce4-08003e301f73}" string
list.Count
равный1
Вот две записи из/api/devicemanager/devices
GET
запрос, связанный сUART
:
{
"Class": "Ports",
"Description": "BCM283x Mini UART Serial Device",
"ID": "ACPI\\BCM2836\\0",
"Manufacturer": "Microsoft",
"ParentID": "ACPI_HAL\\PNP0C08\\0",
"ProblemCode": 0,
"StatusCode": 25182218
},
{
"Class": "System",
"Description": "ARM PL011 UART Device Driver",
"ID": "ACPI\\BCM2837\\4",
"Manufacturer": "Microsoft",
"ParentID": "ACPI_HAL\\PNP0C08\\0",
"ProblemCode": 0,
"StatusCode": 25165834
},
Я пытался замкнуть Rx и Tx и не замкнуть накоротко, это не работает
ОБНОВИТЬ
Если я разделю данный идентификатор, у меня естьInvalid data
исключение.
string aqs = SerialDevice.GetDeviceSelector();
DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(aqs);
List<DeviceInformation> list = devices.ToList();
DeviceInformation di = list.First();
string id = "{86e0d1e0-8089-11d0-9ce4-08003e301f73}";
try { serialPort = await SerialDevice.FromIdAsync(id); } catch(Exception e) { Debug.WriteLine(e.Message); }
id = "\\\\?\\ACPI#BCM2836#0#";
try { serialPort = await SerialDevice.FromIdAsync(id); } catch(Exception e) { Debug.WriteLine(e.Message); }
id = di.Id;
try { serialPort = await SerialDevice.FromIdAsync(id); } catch(Exception e) { Debug.WriteLine(e.Message); }
if (serialPort == null) { Debug.WriteLine("No device"); return; }
Выход:
Исключение: «System.Exception» в mscorlib.ni.dll
Данные неверны. (Исключение из HRESULT: 0x8007000D)
Данные неверны. (Исключение из HRESULT: 0x8007000D)
Нет устройства