You can determine which device it is by reading the "Family" code.

Issue a READROM command ($33).
Then read back 1 byte.

$10 = DS18S20 or DS1820
$28 = DS18B20