Gif attached of canvass.
extenderSocket8 is connected to a WiFly device. socket 8 has a serial port defined using pins 4 and 5 for Tx/Rx and . Pin 3 and 6 are digital outputs connected to the WiFly.
Note that extenderSocket8 is NOT a real extender module. It is a ribbon cable connection to a GHI prototype pc board.
Everything works OK with and without the extenderSocket4 in place.
// GT.Interfaces.DigitalOutput WiFlyReset;
// GT.Interfaces.DigitalOutput WiFlyADhoc;
// GT.Interfaces.DigitalOutput XBeeReset;
// Gadgeteer.Modules.GHIElectronics.Extender extenderSocket8;
// Gadgeteer.Modules.GHIElectronics.XBee xBeeSocket4;
// Gadgeteer.Modules.GHIElectronics.Extender extenderSocket4;
// extenderSocket4 = new GTM.GHIElectronics.Extender(4);
// xBeeSocket4 = new GTM.GHIElectronics.XBee(extenderSocket4.ExtenderSocketNumber);
// extenderSocket8 = new GTM.GHIElectronics.Extender(8);
// WiFlyReset = extenderSocket8.SetupDigitalOutput(GT.Socket.Pin.Three, true);
// WiFlyADhoc = extenderSocket8.SetupDigitalOutput(GT.Socket.Pin.Six, false);
// Serial2 is used for programming the WiFly. Commands sent from a windows form.
// Using Socket 8 to GHI prototype board. serial2 to WiFly serial pins.
// Pin 1 3.3VDC, Pin 2 5VDC, Pin 3 GPIO (Interrupt), Pin 4 TX, Pin 5 RX, Pin 6 GPIO, Pin 7,8,9 NC, Pin 10 GND
// serial2 = new GT.Interfaces.Serial(GT.Socket.GetSocket(8, false, null, null),
// 9600, // Using default for device. I have no need for high speed.
// GT.Interfaces.Serial.SerialParity.None,
// GT.Interfaces.Serial.SerialStopBits.One,
// 8,
// GT.Interfaces.Serial.HardwareFlowControl.NotRequired, null);
Code I used based on your sample.
// var socket = GT.Socket.GetSocket(4, true, xBeeSocket4, null);
// var pin = GT.Socket.Pin.Four;
// var XBeeReset = new GT.Interfaces.DigitalOutput(socket, pin, true, xBeeSocket4); // OutputPort(pin, true);
EDIT:
I receive the exception even if the WiFly module is removed from the spider socket 8.