Added Buffer Value Logic
This commit is contained in:
@@ -46,6 +46,6 @@ object Constants {
|
||||
const val password = "SMI@12345"
|
||||
|
||||
const val KIT_NUMBER = "KitNumber"
|
||||
|
||||
const val KIT_COUNT = "KitCount"
|
||||
const val BUFFER_VALUE = "BufferValue"
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||
@@ -83,6 +84,21 @@ class HemoCubeFragment : Fragment() {
|
||||
isOnline = isNetworkAvailable
|
||||
}
|
||||
}
|
||||
|
||||
if (checkBufferValue()) {
|
||||
TODO("Call S command")
|
||||
//We have to store the buffer value like this
|
||||
with(sharedPreference.edit()) {
|
||||
putInt(Constants.BUFFER_VALUE, 2000)
|
||||
apply()
|
||||
}
|
||||
} else {
|
||||
TODO("Call B command")
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkBufferValue(): Boolean {
|
||||
return sharedPreference.getInt(Constants.BUFFER_VALUE, 0) > 0
|
||||
}
|
||||
|
||||
private fun setupButtonClickListeners() {
|
||||
|
||||
Reference in New Issue
Block a user