Monday, February 23, 2009

GM862 GSM and GPS Module Class

image Else is using a GM862 GSM and GPS module from SparkFun in his Dare to Dream Different Challenge project. The GM862 is using AT commands (comparable with XBee modules) and could be easily used on .NET Micro Framework devices. He as uploaded an example program on his page.

Here are some source code lines he is using for to talk with the modules:

// Initialize GSM/GPS Device
GM862 = new GM862GPS("COM1");

// Make sure GM862 is in command state
GM862.Escape();

// Wait until GM862 is ready
while (true) {
    try {
        GM862.ExecuteCommand("ATE1", 500);
    } catch {
        System.Threading.Thread.Sleep(1000);
        continue;
    }
    break;
}

// Store new pinRequest Handler
lock (GM862)    {
        GM862.getRequestedPIN = GM862_pinRequest;
}

No comments: