PanelLink sample usage?

BeadaPanel versatile media display
Post Reply
voldermord
Posts: 4
Joined: Fri Jan 27, 2023 7:46 pm

PanelLink sample usage?

Post by voldermord » Fri Jan 27, 2023 7:51 pm

Hello,

I am trying to use PanelLink to display image onto the panel. I have tried and compiled the repo
https://github.com/NXElec/panelLink but I cannot figure out what is wrong? There is nothing displayed on the panel. Am I doing something wrong with the program parameters?

I have also read the document https://www.nxelec.com/documents/bp/Pan ... _Rev03.pdf

I know the panel is working in AIDA. However I would like to develop custom software if possible.

Appreciate any help. Thank you.

esky-sh
Posts: 1449
Joined: Sat Dec 20, 2008 4:21 am

Re: PanelLink sample usage?

Post by esky-sh » Sat Jan 28, 2023 6:06 pm

The code on github is little obsolete.

Code: Select all

BOOL QueryDeviceEndpoints(WINUSB_INTERFACE_HANDLE hDeviceHandle, PIPE_ID* pipeid)
{
	if (hDeviceHandle == INVALID_HANDLE_VALUE)
	{
		return FALSE;
	}

	BOOL bResult = TRUE;

	USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
	ZeroMemory(&InterfaceDescriptor, sizeof(USB_INTERFACE_DESCRIPTOR));

	WINUSB_PIPE_INFORMATION  Pipe;
	ZeroMemory(&Pipe, sizeof(WINUSB_PIPE_INFORMATION));


	bResult = WinUsb_QueryInterfaceSettings(hDeviceHandle, 0, &InterfaceDescriptor);

	if (bResult)
	{
		for (int index = 0; index < InterfaceDescriptor.bNumEndpoints; index++)
		{
			bResult = WinUsb_QueryPipe(hDeviceHandle, 0, index, &Pipe);

			if (bResult)
			{
				if (Pipe.PipeType == UsbdPipeTypeControl)
				{
					printf("Endpoint index: %d Pipe type: %d Control Pipe ID: %d.\n", index, Pipe.PipeType, Pipe.PipeId);
				}
				if (Pipe.PipeType == UsbdPipeTypeIsochronous)
				{
					printf("Endpoint index: %d Pipe type: %d Isochronous Pipe ID: %d.\n", index, Pipe.PipeType, Pipe.PipeId);
				}
				if (Pipe.PipeType == UsbdPipeTypeBulk)
				{
					if (USB_ENDPOINT_DIRECTION_IN(Pipe.PipeId))
					{
						printf("Endpoint index: %d Pipe type: %d Bulk In Pipe ID: %x.\n", index, Pipe.PipeType, Pipe.PipeId);
						pipeid->PipeInId = Pipe.PipeId;
					}
					if (USB_ENDPOINT_DIRECTION_OUT(Pipe.PipeId))
					{
						printf("Endpoint index: %d Pipe type: %d Bulk Out Pipe ID: %x.\n", index, Pipe.PipeType, Pipe.PipeId);
						pipeid->PipeOutId = Pipe.PipeId;
					}

				}
				if (Pipe.PipeType == UsbdPipeTypeInterrupt)
				{
					printf("Endpoint index: %d Pipe type: %d Interrupt Pipe ID: %d.\n", index, Pipe.PipeType, Pipe.PipeId);
				}
			}
			else
			{
				continue;
			}
		}
	}

done:
	return bResult;
}
pipeid->PipeOutId should be assigned to 1(first bulk out endpoint address) before function QueryDeviceEndpoints() return.
Here is an example

Code: Select all

BOOL QueryDeviceEndpoints(WINUSB_INTERFACE_HANDLE hDeviceHandle, PIPE_ID* pipeid)
{
	if (hDeviceHandle == INVALID_HANDLE_VALUE)
	{
		return FALSE;
	}

	BOOL bResult = TRUE;

	USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
	ZeroMemory(&InterfaceDescriptor, sizeof(USB_INTERFACE_DESCRIPTOR));

	WINUSB_PIPE_INFORMATION  Pipe;
	ZeroMemory(&Pipe, sizeof(WINUSB_PIPE_INFORMATION));


	bResult = WinUsb_QueryInterfaceSettings(hDeviceHandle, 0, &InterfaceDescriptor);

	if (bResult)
	{
		for (int index = 0; index < 2; index++)
		{
We will update github soon to reflect latest firmware.

voldermord
Posts: 4
Joined: Fri Jan 27, 2023 7:46 pm

Re: PanelLink sample usage?

Post by voldermord » Sat Jan 28, 2023 9:23 pm

That fixed it. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests