Skip to main content

Retrieve cellular connection state information


Device (from impOS™ 40)


Name Type Description
callback Function A function to be called when the cellular connection data has been gathered




This method requests current connection state information from the cellular modem integrated into imps that feature cellular interfaces. It takes as its argument a function which will be called when this information has been retrieved. Gathering this data can take a significant period of time, so operates asynchronously to prevent your application from being blocked while the information is collated. The information is only available once the imp’s cellular modem is powered on.

The cellular connection information is provided in a string — for example, "4G,6300,20,10,10,FDD,262,02,BF75,0345103,350,90,-94,-7,CONN" — and so the callback function should include a single parameter, cellinfo, which will receive the string. For more information on the data contained in the string, which varies according to the connected network type (2G, 3G, 4G, etc), please see The Cinterion ELS61-E AT Command Set, section 8.11.2.

Example Code

// Request cellular connection info {
    // Parse string 'cellinfo' - comma-separated values
    local cellData = split(cellinfo, ",");

    // Log the network type
    local ACT = cellData[0];
    server.log("Connected to a " + ACT + " network");

    if (ACT == "4G") {
        // Log the cell ID
        server.log("Global Cell ID: " + cellData[9]);