Skip to content

Instantly share code, notes, and snippets.

@rvi
Last active March 19, 2018 10:08
Show Gist options
  • Save rvi/36f84451f6cbc53fba4871803fd6c96e to your computer and use it in GitHub Desktop.
Save rvi/36f84451f6cbc53fba4871803fd6c96e to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity(), OnvifListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
currentDevice = OnvifDevice("IP_ADDRESS:PORT", "login", "pwd")
currentDevice.listener = this
currentDevice.getServices()
}
override fun requestPerformed(response: OnvifResponse) {
Log.d("ONVIF","Request ${response.request.type} performed.")
Log.d("ONVIF","Succeeded: ${response.success},
message: ${response.parsingUIMessage}”)
if (response.request.type == GetServices) {
currentDevice.getDeviceInformation()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment