fm/fmapp2/src/com/caf/fmradio/FMRadioService.java
public boolean scan(int pty)
   {
      boolean bCommandSent=false;
      if (mReceiver != null)
      {
         Log.d(LOGTAG, "scan:  PTY: " + pty);
         if(FmSharedPreferences.isRBDSStd())
         {
            /* RBDS : Validate PTY value?? */
            if( ((pty  > 0) && (pty  <= 23)) || ((pty  >= 29) && (pty  <= 31)) )
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCHRDS_MODE_SCAN_PTY,
                                                       FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                       FmReceiver.FM_RX_SEARCHDIR_UP,
                                                       pty,
                                                       0);
            }
            else
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCH_MODE_SCAN,
                                                FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                FmReceiver.FM_RX_SEARCHDIR_UP);
            }
         }
         else
         {
            /* RDS : Validate PTY value?? */
            if( (pty  > 0) && (pty  <= 31) )
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCHRDS_MODE_SCAN_PTY,
                                                          FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                          FmReceiver.FM_RX_SEARCHDIR_UP,
                                                          pty,
                                                          0);
            }
            else
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCH_MODE_SCAN,
                                                FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                FmReceiver.FM_RX_SEARCHDIR_UP);
            }
         }
      }
      return bCommandSent;
   }
/* Scan (Search for station with a "preview" of "n" seconds)
    * FM Stations. It always scans in the forward direction relative to the
    * current tuned station.
    * int pty: 0 or a reserved PTY value- Perform a "strong" station search of all stations.
    *          Valid/Known PTY - perform RDS Scan for that pty.
    *
    * @return true if Scan command was invoked successfully, false if not muted.
    *  Note: 1. Callback FmRxEvRadioTuneStatus will be called when tuned to various stations
    *           during the Scan.
    *        2. Callback FmRxEvSearchComplete will be called when the Search
    *        is complete
    *        3. Callback FmRxEvRadioTuneStatus will also be called when tuned to a station
    *        at the end of the Search or if the seach was cancelled.
    *
    */
Scan (Search for station with a "preview" of "n" seconds)
FM Stations. It always scans in the forward direction relative to the
current tuned station.
int pty: 0 or a reserved PTY value- Perform a "strong" station search of all stations.
Valid/Known PTY - perform RDS Scan for that pty.

@return true if Scan command was invoked successfully, false if not muted.
Note: 1. Callback FmRxEvRadioTuneStatus will be called when tuned to various stations
during the Scan.
2. Callback FmRxEvSearchComplete will be called when the Search
is complete
3. Callback FmRxEvRadioTuneStatus will also be called when tuned to a station
at the end of the Search or if the seach was cancelled.
Scan ( Search for station with a " preview " of " n " seconds ) FM Stations . It always scans in the forward direction relative to the current tuned station . int pty : 0 or a reserved PTY value - Perform a " strong " station search of all stations . Valid / Known PTY - perform RDS Scan for that pty . @return true if Scan command was invoked successfully false if not muted . Note : 1 . Callback FmRxEvRadioTuneStatus will be called when tuned to various stations during the Scan . 2 . Callback FmRxEvSearchComplete will be called when the Search is complete 3 . Callback FmRxEvRadioTuneStatus will also be called when tuned to a station at the end of the Search or if the seach was cancelled .
public boolean scan(int pty)
   {
      boolean bCommandSent=false;
      if (mReceiver != null)
      {
         Log.d(LOGTAG, "scan:  PTY: " + pty);
         if(FmSharedPreferences.isRBDSStd())
         {
            /* RBDS : Validate PTY value?? */
            if( ((pty  > 0) && (pty  <= 23)) || ((pty  >= 29) && (pty  <= 31)) )
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCHRDS_MODE_SCAN_PTY,
                                                       FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                       FmReceiver.FM_RX_SEARCHDIR_UP,
                                                       pty,
                                                       0);
            }
            else
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCH_MODE_SCAN,
                                                FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                FmReceiver.FM_RX_SEARCHDIR_UP);
            }
         }
         else
         {
            /* RDS : Validate PTY value?? */
            if( (pty  > 0) && (pty  <= 31) )
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCHRDS_MODE_SCAN_PTY,
                                                          FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                          FmReceiver.FM_RX_SEARCHDIR_UP,
                                                          pty,
                                                          0);
            }
            else
            {
               bCommandSent = mReceiver.searchStations(FmReceiver.FM_RX_SRCH_MODE_SCAN,
                                                FmReceiver.FM_RX_DWELL_PERIOD_2S,
                                                FmReceiver.FM_RX_SEARCHDIR_UP);
            }
         }
      }
      return bCommandSent;
   }
public boolean scan ( int pty ) { boolean bCommandSent = false ; if ( mReceiver != null ) { Log . d ( LOGTAG , "scan:  PTY: " + pty ) ; if ( FmSharedPreferences . isRBDSStd ( ) ) { /* RBDS : Validate PTY value?? */ if ( ( ( pty > 0 ) && ( pty <= 23 ) ) || ( ( pty >= 29 ) && ( pty <= 31 ) ) ) { bCommandSent = mReceiver . searchStations ( FmReceiver . FM_RX_SRCHRDS_MODE_SCAN_PTY , FmReceiver . FM_RX_DWELL_PERIOD_2S , FmReceiver . FM_RX_SEARCHDIR_UP , pty , 0 ) ; } else { bCommandSent = mReceiver . searchStations ( FmReceiver . FM_RX_SRCH_MODE_SCAN , FmReceiver . FM_RX_DWELL_PERIOD_2S , FmReceiver . FM_RX_SEARCHDIR_UP ) ; } } else { /* RDS : Validate PTY value?? */ if ( ( pty > 0 ) && ( pty <= 31 ) ) { bCommandSent = mReceiver . searchStations ( FmReceiver . FM_RX_SRCHRDS_MODE_SCAN_PTY , FmReceiver . FM_RX_DWELL_PERIOD_2S , FmReceiver . FM_RX_SEARCHDIR_UP , pty , 0 ) ; } else { bCommandSent = mReceiver . searchStations ( FmReceiver . FM_RX_SRCH_MODE_SCAN , FmReceiver . FM_RX_DWELL_PERIOD_2S , FmReceiver . FM_RX_SEARCHDIR_UP ) ; } } } return bCommandSent ; }
Scan (Search for station with a "preview" of "n" seconds)
 FM Stations.
Scan ( Search for station with a " preview " of " n " seconds ) FM Stations .