Parse ESN

     

    Have you ever tried to parse the ESN value returned by RadioGetInfo? Its not trivial to convert it into the form we are familiar with. This function does just that. This only works for Mobitex based devices.

    void RimGetESN(int &part1,int &part2,int &part3)
    {
    RADIO_INFO radio_info;
    int esn_1, esn_2, esn_3;

    RadioGetDetailedInfo( &radio_info );
    part1 = radio_info.ESN >> 24;
    esn_1 = radio_info.ESN >> 16;
    esn_2 = radio_info.ESN >> 8;
    esn_3 = radio_info.ESN;
    // MODEL NUMBER
    part2 = esn_1;
    part2 >>= 2;
    part2 &= 0x003F;
    // ID NUMBER
    part3 = ((long)esn_1 & 0x00000003L) << 16 |
    ((long)esn_2 & 0x000000FFL) << 8 |
    ((long)esn_3 & 0x000000FFL);
    }

Website design: Sessionware  Copyright ©2001 Bill Foust.  The BlackBerry and RIM families of related marks, images and symbols are the exclusive properties and trade-marks of Research In Motion Limited and are used by permission.  Trademarks and product names listed on this site are the sole property of their respective owners.  This page last updated on May 05, 2005