Reply
Posts: 3
Registered: ‎08-02-2016

How to control CP2130(HID) from UWP application on Windows10?

[ Edited ]

Do you have any solve for the following problem?

 

We try to make UWP application with CP2130 and HID interface on Windows 10.

When we call  HidUart_GetNumDevices function, we have got the following result and we cannot control the HID from UWP application.

 

Using DLL : SLABHIDtoUART.dll

 

Source Code:

public partial class MainWindow : Window

    {

        public MainWindow()

        {

            InitializeComponent();

 

            string[] listHidPort = new string[0];

            StringBuilder deviceString = new StringBuilder(SLABHIDTOUART.HID_UART_DEVICE_STRLEN);

 

            //ushort usagePage = 0xFF00;

            //ushort usageId = 0x1;

            //ushort venderId = 0x10c4;

            //ushort productId = 0xea80;

            uint numDevices = 0;

 

            if (SLABHIDTOUART.HidUart_GetNumDevices(ref numDevices, 0, 0) == SLABHIDTOUART.HID_UART_SUCCESS)

            {

                listHidPort = new String[numDevices];

                for (uint i = 0; i < numDevices; i++)

                {

                    if (SLABHIDTOUART.HidUart_GetString(i, 0, 0, deviceString, SLABHIDTOUART.HID_UART_GET_SERIAL_STR) == SLABHIDTOUART.HID_UART_SUCCESS)

                    {

                        listHidPort[i] = "HID" + "(" + deviceString.ToString() + ")";

                        Console.WriteLine("SLABHIDTOUART[{0}] = {1}", i, listHidPort[i]);

                    }

                    else

                    {

                        Console.WriteLine("error");

                    }

                }

            }

        }

    }

 

Result:

[WPF]

error

error

error

error

SLABHIDTOUART[4] = HID(005B0B99)

 

[UWP]

error

error

error

error

error

Posts: 381
Registered: ‎09-04-2013

Re: How to control CP2130(HID) from UWP application on Windows10?

@Naoto CP2130 is a USB-to-SPI bridge using USB Bulk mode transactions, not a HID device.

Posts: 3
Registered: ‎08-02-2016

Re: How to control CP2130(HID) from UWP application on Windows10?

Dear Jiehui

 

I'm sorry but I said about CP2110 not CP2130.

Does it make sense?

Posts: 381
Registered: ‎09-04-2013

Re: How to control CP2130(HID) from UWP application on Windows10?

[ Edited ]

@Naoto Try to refer to the HidUartExample that is using the SLABHIDtoUART.dll.

This example can be found if you have installed the Interface Software Development Kit Packages (USBXpressHostSDK) which can be downloaded from link below.

 

https://www.silabs.com/products/development-tools/software/interface#software

 

 

Highlighted
Posts: 3
Registered: ‎08-02-2016

Re: How to control CP2130(HID) from UWP application on Windows10?

@Jiehui Thank you for your comment. 

 

We tried SLABHIDtoUART.dll as mentioned above.

However we have found that "HidUart_GetNumDevices" function has some problem.

 

Do you have any idea to execute above function without error?