No no, events are not the answer.
For example, lets say you have a method that initialises the modem. As part of the initialisation procedure, the modem is asked to respond to an anonymous call, lets make the call 0x00. Once the modem has responded, you then initialise its identifier by sending lets just say 0x01 down the serial port.
SerialPort commPort = new SerialPort();
void InitialiseModem(string identifier)
{
byte[] data = new byte[1];
data[0] = 0x00;
this.comPort.Write(data, 0);
while(SerialPort.BytesToRead <= 0);
data[0] = 0x01;
this.comPort.Write(data, 0);
}
This is a synchronous method, i.e. it will block until the modem responds, the bad part is that if the modem never responds, you must implemet a mechanism to make sure you don't loop forever, it can easily be done with an if statement and a counter or timer of some sort.
To avoid locking up a GUI (I dont know if this is an issue) you should try and run the whole method inside another Thread. Using events is not a good idea for synchronous operations, unless there is a defined protocol that you can adhere to that is actually inherent to the modem firmware.
Dave