All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.seanproctor.onvifcamera.OnvifCommands.kt Maven / Gradle / Ivy

The newest version!
package com.seanproctor.onvifcamera

internal object OnvifCommands {
    /**
     * The header for SOAP 1.2 with digest authentication
     */
    private const val soapHeader = "" +
            "" +
            ""

    private const val envelopeEnd = ""

    internal const val profilesCommand = (
            soapHeader
                    + ""
                    + envelopeEnd
            )

    internal fun getStreamURICommand(profile: MediaProfile, protocol: String = "RTSP"): String {
        return (soapHeader
                + ""
                + "${profile.token}"
                + "${protocol}"
                + ""
                + envelopeEnd
                )
    }

    internal fun getSnapshotURICommand(profile: MediaProfile): String {
        return (soapHeader + ""
                + "${profile.token}"
                + "" + envelopeEnd)
    }

    internal fun probeCommand(messageId: String): String {
        return "" +
                "" +
                "" +
                "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe" +
                "uuid:$messageId" +
                "" +
                "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous" +
                "" +
                "urn:schemas-xmlsoap-org:ws:2005:04:discovery" +
                "" +
                "" +
                "" +
                "" +
                "dp0:NetworkVideoTransmitter" +
                "" +
                "" +
                "" +
                ""
    }

    internal const val deviceInformationCommand = (
            soapHeader
                    + ""
                    + ""
                    + envelopeEnd
            )

    internal const val servicesCommand = (
            soapHeader
                    + ""
                    + "false"
                    + ""
                    + envelopeEnd
            )

    internal const val getSystemDateAndTimeCommand = "" +
            "" +
            " " +
            "  " +
            " " +
            ""

    internal val getHostnameCommand = """
            
            
                
                    
                
            
            """.trimIndent()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy