Home

Updated on Oct,12, 2001

Mobitex time

In the raw MPAK format, there is 3 bytes containg the Mobitex time. These bytes contains the number of minutes since the Epoch Mobitex time , that is 12:00 AM January 1, 1985, Mobitex local time. You will need to have a conversion to find the localtime. This conversion is covered in Developer's Guide for Mobitex and Rim Wireless Handheld. Anyway, Radio API makes thing simpler for developers. If you use the API RadioGetMpak( int tag, MPAK_HEADER * pMpak_Header, byte * pData) to read the MPAK, then this function converts the raw MPAK into two parts : the header will be copied to the memory address specified by pMpak_Header, and the data will be copied to the memory address specified by pData. The length of the data is the return value of the function itself. Remember that this is correct if pMpak_Header is not NULL.

Look at the definition of MPAK_HEADER

// MPAK_HEADER structure.  The OS places parsed MPAK header info into this
// structure, and uses this structure to build and MPAK.

typedef struct {
    long  Sender;               // sender MAN number
    long  Destination;          // Addressee MAN number
    int   MpakType;             // PSUBCOM mpak type, 0 for non PSUBCOM
    int   HPID;                 // MPAK HPID for HPDATA Mpaks
    int   Flags;                // MPAK flags component
    TIME  Timestamp;            // parsed Mobitex Time Stamp
    long  lTime;                // MPAK raw Mobitex Time Stamp
    int   TrafficState;         // MPAK traffic state
} MPAK_HEADER;
We can easily see that this is not the same as the raw Mobitex MPAK format. One of the different things is TIME Timestamp.

Let's check the definition of the structure TIME, it is in Rim.h of the SDK.

/* Time Type */
typedef struct              // USED FOR GET/SET DATE and TIME
{
    BYTE    second;
    BYTE    minute;
    BYTE    hour;
    BYTE    date;
    BYTE    month;
    BYTE    day;            // day of week, Sun=0, Mon=1, ..., Sat=6
    WORD    year;
    BYTE    TimeZone;
} TIME;
This structure clearly gives more useful information for the data/time than the original number from raw Mobitex network.

I use this as a way to synchonize the time of the Rim devices with the server: the custom server sends the Rim devices an empty MPAK, and the Rim device application will use RimSetDate( &m_header.Timestamp ) and RimSetTime( &m_header.Timestamp ) to set the correct date and time.

Home