YGPS/src/com/mediatek/ygps/ClientSocket.java
private String calcCS(String command) {
        if (null == command || "".equals(command)) {
            return "";
        }
        byte[] ba = command.toUpperCase().getBytes();
        int temp = 0;
        for (byte b : ba) {
            temp ^= b;
        }
        return String.format("%1$02x", temp & MASK_8_BIT).toUpperCase();
    }
/**
     * Calculate check sum for PMTK command.
     *
     * @param command
     *            The command need to send
     * @return The check sum string
     */
Calculate check sum for PMTK command.
@param command
The command need to send
@return The check sum string
Calculate check sum for PMTK command . @param command The command need to send @return The check sum string
private String calcCS(String command) {
        if (null == command || "".equals(command)) {
            return "";
        }
        byte[] ba = command.toUpperCase().getBytes();
        int temp = 0;
        for (byte b : ba) {
            temp ^= b;
        }
        return String.format("%1$02x", temp & MASK_8_BIT).toUpperCase();
    }
private String calcCS ( String command ) { if ( null == command || "" . equals ( command ) ) { return "" ; } byte [ ] ba = command . toUpperCase ( ) . getBytes ( ) ; int temp = 0 ; for ( byte b : ba ) { temp ^= b ; } return String . format ( "%1$02x" , temp & MASK_8_BIT ) . toUpperCase ( ) ; }
Calculate check sum for PMTK command.
Calculate check sum for PMTK command .