code.pfad.fr/gohmekit@v0.2.1/hapip/characteristic/tlv8_structs.go (about) 1 package characteristic 2 3 // // // // // 4 // SupportedVideoStreamConfiguration 5 // // // // // 6 7 type SupportedVideoStreamConfigurationResponse struct { 8 Codecs []struct { 9 Type byte `tlv8:"1"` 10 Parameters []VideoCodecParameters `tlv8:"2"` 11 Attributes []VideoAttributes `tlv8:"3"` 12 } `tlv8:"1"` 13 } 14 15 type VideoCodecParameters struct { 16 ProfileID byte `tlv8:"1"` 17 Level byte `tlv8:"2"` 18 PacketizationMode byte `tlv8:"3"` 19 CvoEnabled bool `tlv8:"4"` 20 CvoID byte `tlv8:"5"` // in range [1:14] 21 } 22 type VideoAttributes struct { 23 Width uint16 `tlv8:"1"` 24 Height uint16 `tlv8:"2"` 25 Framerate byte `tlv8:"3"` 26 } 27 28 // // // // // 29 // SupportedAudioStreamConfiguration 30 // // // // // 31 32 type SupportedAudioStreamConfigurationResponse struct { 33 Codecs []struct { 34 Type byte `tlv8:"1"` 35 Parameters []AudioCodecParameters `tlv8:"2"` 36 } `tlv8:"1"` 37 ComfortNoise bool `tlv8:"2"` 38 } 39 40 type AudioCodecParameters struct { 41 Channels uint8 `tlv8:"1"` 42 ConstantBitrate bool `tlv8:"2"` 43 SampleRate byte `tlv8:"3"` 44 RTPTime uint8 `tlv8:"4"` // 20ms, 30ms, 40 ms & 60ms 45 } 46 47 // // // // // 48 // StreamingStatus 49 // // // // // 50 51 type StreamingStatusResponse struct { 52 Status byte `tlv8:"1"` 53 } 54 55 // // // // // 56 // SelectedRTPStreamConfiguration 57 // // // // // 58 59 type SelectedRTPStreamConfigurationRequest struct { 60 Session struct { 61 Identifier []byte `tlv8:"1"` 62 Command byte `tlv8:"2"` 63 } `tlv8:"1"` 64 VideoParameters struct { 65 CodecType byte `tlv8:"1"` 66 CodecParameters VideoCodecParameters `tlv8:"2"` 67 Attributes VideoAttributes `tlv8:"3"` 68 RTP RTPParameters `tlv8:"4"` 69 } `tlv8:"2"` 70 AudioParameters struct { 71 CodecType byte `tlv8:"1"` 72 CodecParameters AudioCodecParameters `tlv8:"2"` 73 RTP RTPParameters `tlv8:"3"` 74 ComfortNoise bool `tlv8:"4"` 75 } `tlv8:"3"` 76 } 77 78 type RTPParameters struct { 79 Type byte `tlv8:"1"` 80 SSRC uint32 `tlv8:"2"` 81 MaxBitrate uint16 `tlv8:"3"` 82 MinRTCPInterval float32 `tlv8:"4"` 83 MaxMTU uint16 `tlv8:"5"` // only for video 84 ComfortNoiseType byte `tlv8:"6"` // only for audio 85 } 86 87 type SelectedRTPStreamConfigurationResponse SelectedRTPStreamConfigurationRequest 88 89 // // // // // 90 // SetupEndpoints 91 // // // // // 92 93 type SetupEndpointsRequest struct { 94 SessionID []byte `tlv8:"1"` 95 ControllerAddr Address `tlv8:"3"` 96 VideoSRTP SRTP `tlv8:"4"` 97 AudioSRTP SRTP `tlv8:"5"` 98 } 99 100 type Address struct { 101 IPv6 bool `tlv8:"1"` 102 IP string `tlv8:"2"` 103 VideoRtpPort uint16 `tlv8:"3"` 104 AudioRtpPort uint16 `tlv8:"4"` 105 } 106 107 type SRTP struct { 108 // Crypto Suite 109 // 110 // - 0: AES_CM_128_HMAC_SHA1_80 111 // - 1: AES_256_CM_HMAC_SHA1_80 112 // - 2: Disabled 113 CryptoSuite byte `tlv8:"1"` 114 MasterKey []byte `tlv8:"2"` // 16 (AES_CM_128) or 32 (AES_256_CM) 115 MasterSalt []byte `tlv8:"3"` // 14 byte 116 } 117 118 type SetupEndpointsResponse struct { 119 SessionID []byte `tlv8:"1"` 120 Status byte `tlv8:"2"` 121 AccessoryAddr Address `tlv8:"3"` // AccessoryAddr.IPv6 must be the same as ControllerAddr.IPv6 122 VideoSRTP SRTP `tlv8:"4"` 123 AudioSRTP SRTP `tlv8:"5"` 124 VideoSSRC uint32 `tlv8:"6"` 125 AudioSSRC uint32 `tlv8:"7"` 126 } 127 128 // // // // // 129 // SupportedRTPConfiguration 130 // // // // // 131 132 type SupportedRTPConfigurationResponse []struct { 133 CryptoSuite byte `tlv8:"2"` 134 Separator struct{} `tlv8:"0"` 135 } 136 137 func NewSupportedRTPConfigurationResponse(cryptoSuite ...byte) SupportedRTPConfigurationResponse { 138 r := make(SupportedRTPConfigurationResponse, 0, len(cryptoSuite)) 139 for _, c := range cryptoSuite { 140 r = append(r, struct { 141 CryptoSuite byte "tlv8:\"2\"" 142 Separator struct{} "tlv8:\"0\"" 143 }{ 144 CryptoSuite: c, 145 }) 146 } 147 return r 148 } 149 150 type LogsResponse struct{} // TODO 151 type SupportedCameraRecordingConfigurationResponse struct{} // TODO 152 type SupportedVideoRecordingConfigurationResponse struct{} // TODO 153 type SupportedAudioRecordingConfigurationResponse struct{} // TODO 154 155 type DisplayOrderRequest struct{} // TODO 156 type DisplayOrderResponse struct{} // TODO 157 type PairSetupRequest struct{} // TODO 158 type PairSetupResponse struct{} // TODO 159 type PairVerifyResponse struct{} // TODO 160 type PairVerifyRequest struct{} // TODO 161 type PairingPairingsRequest struct{} // TODO 162 type PairingPairingsResponse struct{} // TODO 163 type SelectedCameraRecordingConfigurationResponse struct{} // TODO 164 type SelectedCameraRecordingConfigurationRequest struct{} // TODO 165 166 type LockControlPointRequest struct{} // TODO