1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

miracle-wfdctl: compare wfd-standby and wfd-idr-request by message body

This commit is contained in:
Derek Dai 2017-02-23 16:44:35 +08:00
parent dd6fbf70e2
commit 85c8988b38
No known key found for this signature in database
GPG key ID: E109CC97553EF009

View file

@ -293,18 +293,18 @@ static enum rtsp_message_id wfd_session_message_to_id(struct wfd_session *s,
return RTSP_M11_SET_CONNECTOR_TYPE; return RTSP_M11_SET_CONNECTOR_TYPE;
} }
if(!rtsp_message_read(m, "{<>}", "wfd_standby")) { if(!rtsp_message_read(m, "{<>}", "wfd_uibc_setting")) {
return RTSP_M15_ENABLE_UIBC;
}
if(!strncmp("wfd_standby", rtsp_message_get_body(m), 11)) {
return RTSP_M12_SET_STANDBY; return RTSP_M12_SET_STANDBY;
} }
if(!rtsp_message_read(m, "{<>}", "wfd_idr_request")) { if(!strncmp("wfd_idr_request", rtsp_message_get_body(m), 15)) {
return RTSP_M13_REQUEST_IDR; return RTSP_M13_REQUEST_IDR;
} }
if(!rtsp_message_read(m, "{<>}", "wfd_uibc_setting")) {
return RTSP_M15_ENABLE_UIBC;
}
if(WFD_SESSION_STATE_CAPS_EXCHANGING == s->state) { if(WFD_SESSION_STATE_CAPS_EXCHANGING == s->state) {
return RTSP_M4_SET_PARAMETER; return RTSP_M4_SET_PARAMETER;
} }
@ -401,6 +401,10 @@ static int wfd_session_handle_request(struct rtsp *bus,
id = wfd_session_message_to_id(s, m); id = wfd_session_message_to_id(s, m);
if(RTSP_M_UNKNOWN == id) { if(RTSP_M_UNKNOWN == id) {
if(m) {
log_debug("unable to map request to id: %s",
(char *) rtsp_message_get_raw(m));
}
r = -EPROTO; r = -EPROTO;
goto error; goto error;
} }