static String toHex4String(int pValue)
{

    String s = Integer.toString(pValue, 16);

    //force length to be four characters

    if (s.length() == 0) {return "0000" + s;}
    else
    if (s.length() == 1) {return "000" + s;}
    else
    if (s.length() == 2) {return "00" + s;}
    else
    if (s.length() == 3) {return "0" + s;}
    else{
        return s;
    }

}//end of Log::toHex4String