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?
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”
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);
yes - threw the very same exception I think.
I’m gonna use another modem that has an RS232 port instead.
Thank you very much for your help.
GHI support really rocks