USBH_SerialUSB + HandShake.RequestToSend

Hi!

I am currently trying to connect my FEZ Domino with a Airlink GL6110 USB modem via USB (obviously)

Therefore I want to use the PPP implementation of GHIElectronics.

In the manual for the modem there is written that hardware flowcontrol is required.

Therefore I set the USBH_SerialUSB.Handshake property to Handsharke.RequestToSend like in the example below:


if (device.TYPE != USBH_DeviceType.Serial_CDC)
                return;

            modem = new USBH_SerialUSB(device, Constants.BAUDRATE, Constants.PARITY, Constants.DATABITS, Constants.STOPBITS);

            // Till this point TCP/IP stack is hooked previously Enabled interface (Ethernet by default)
            PPP.Enable(modem);
            modem.Handshake = Handshake.RequestToSend; // This is to avoid data loss during PPP communication.
            modem.Open();

Unfortunately I get a “System.Exception” thrown at the point I want to set the Handshake property.
Can it be that this is not supported yet by GHI or that there is a bug?

Or am I doing something wrong?

Please help! :o

There is no ppp on domino, only large devices

Really?

However I just tried the same code on my ChipworkX running the latest firmware.

Throws the same exception at the same point!!!

And even worse: Although the default value of Handshake is “None”, I also get an exception thrown if I SET the Handshake to “None”

so any access to that property results in a weird Exception being thrown. That seriously must be a bug right?

So to be precise all of the following results in an exception being thrown without any Message:


modem = new USBH_SerialUSB(device, Constants.BAUDRATE, Constants.PARITY, Constants.DATABITS, Constants.STOPBITS);

            // Till this point TCP/IP stack is hooked previously Enabled interface (Ethernet by default)
            PPP.Enable(modem);
            // either...
            modem.Handshake = Handshake.RequestToSend; // This is to avoid data loss during PPP communication.
            // or...
            modem.Handshake = Handshake.None;
            // or...
            modem.Handshake = Handshake.XOnXOff;
            // results in an exception. the following line is never reached.
            modem.Open();

I also uploaded the exception image.

The message is:
“Exception was thrown: System.Exception”

The stacktrace is:
“GHIElectronics.NETMF.USBHost.USBH_SerialUSB::SetHandshake
GHIElectronics.NETMF.USBHost.USBH_SerialUSB::set_Handshake
PPP_Example_4._0.Program::RunDemo
PPP_Example_4._0.Program::DeviceConnectedEvent
GHIElectronics.NETMF.USBHost.USBH_DeviceConnectionEventHandler::Invoke
GHIElectronics.NETMF.USBHost.USBHostController::nativeEventDispatcher_OnInterrupt
GHIElectronics.NETMF.System.InternalEvent::nativeEventDispatcher_OnInterrupt”

What is going wrong there?

Not supported per documentation:
http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/html/117a2c77-36bd-362d-f014-7c730be6a2fe.htm

We can add it for next release. Please try this after you open the COM port to set hardware handshaking:
USBH_RawDevice r = new USBH_RawDevice(device);
r.SendSetupTransfer(0x21, 0x22, 3, device.INTERFACE_INDEX);

Thanks for that tip, however it didn’t work either.

Seems USB is still a work in progress area, right? Should have chosen an RS232 modem.

Thanks anyway

USB is complete but like any software out there, there is always additional features that can be added…new versions…new enhancements

How did it not work? Did it throw exceptions?

yes - threw the very same exception I think.
I’m gonna use another modem that has an RS232 port instead. :slight_smile:
Thank you very much for your help.
GHI support really rocks :slight_smile: