diff options
author | Brant Thomsen <brant.thomsen@harman.com> | 2017-07-19 10:59:43 -0600 |
---|---|---|
committer | Brant Thomsen <brant.thomsen@harman.com> | 2017-07-19 10:59:43 -0600 |
commit | c4a6891e1177698f70445cd9b170b5b97e5e8939 (patch) | |
tree | fab3187233813bd7152353966446524348019b4a | |
parent | b9305069bc3d0064f2174261df15459d9484d577 (diff) | |
parent | f8aa9b79950736257f82e81f191d1e2befc441e6 (diff) | |
download | Open-AVB-c4a6891e1177698f70445cd9b170b5b97e5e8939.tar.gz |
Merge branch 'avb_endpoint' of ssh://git.ctg-server.hmg.ad.harman.com:2222/clones/Open-AVB into feature-avtp-pipeline-avdecc
8 files changed, 23 insertions, 6 deletions
diff --git a/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c b/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c index 53bc2fa4..3b950f4b 100644 --- a/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c +++ b/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c @@ -891,6 +891,7 @@ void openavbAcmpSMListenerSet_doFastConnect(const openavb_tl_data_cfg_t *pListen // Update the descriptor.
pDescriptor->fast_connect_status = OPENAVB_FAST_CONNECT_STATUS_IN_PROGRESS;
memcpy(pDescriptor->fast_connect_talker_entity_id, talker_entity_id, 8);
+ CLOCK_GETTIME(OPENAVB_CLOCK_REALTIME, &pDescriptor->fast_connect_start_time);
// Create a fake CONNECT_RX_COMMAND to kick off the fast connect process.
// The FAST_CONNECT flag is used to indicate internally that the controller didn't initiate this.
@@ -941,7 +942,18 @@ void openavbAcmpSMListenerSet_talkerTestFastConnect( if (pDescriptor->stream &&
pDescriptor->fast_connect_status == OPENAVB_FAST_CONNECT_STATUS_TIMED_OUT &&
memcmp(pDescriptor->fast_connect_talker_entity_id, entity_id, 8) == 0) {
+ //
// We found a Talker matching the one we have been looking for.
+ //
+
+ // See if it is time to connect yet.
+ struct timespec currenttime;
+ CLOCK_GETTIME(OPENAVB_CLOCK_REALTIME, ¤ttime);
+ if (openavbTimeTimespecCmp(¤ttime, &pDescriptor->fast_connect_start_time) < 0) {
+ AVB_LOG_DEBUG("Not yet time to do a fast connect");
+ break;
+ }
+
// Get the rest of the details we need to connect to it.
U16 flags, talker_unique_id;
U8 talker_entity_id[8], controller_entity_id[8];
@@ -951,7 +963,8 @@ void openavbAcmpSMListenerSet_talkerTestFastConnect( openavbAcmpSMListenerSet_doFastConnect(pDescriptor->stream, flags, talker_unique_id, talker_entity_id, controller_entity_id);
}
else {
- AVB_LOGF_ERROR("Unexpected fast connect info for talker_entity_id=" ENTITYID_FORMAT, ENTITYID_ARGS(entity_id));
+ AVB_LOGF_DEBUG("Fast connect info for talker_entity_id=" ENTITYID_FORMAT " no longer valid", ENTITYID_ARGS(entity_id));
+ memset(pDescriptor->fast_connect_talker_entity_id, 0, 8);
}
break;
diff --git a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c index 7ba72355..6a1e5d44 100644 --- a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c +++ b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c @@ -201,7 +201,7 @@ void openavbAdpSMAdvertiseEntityStart() bool errResult;
THREAD_CREATE(openavbAdpSmAdvertiseEntityThread, openavbAdpSmAdvertiseEntityThread, NULL, openavbAdpSMAdvertiseEntityThreadFn, NULL);
THREAD_CHECK_ERROR(openavbAdpSmAdvertiseEntityThread, "Thread / task creation failed", errResult);
- if (errResult); // Already reported
+ if (errResult); // Already reported
AVB_TRACE_EXIT(AVB_TRACE_ADP);
}
diff --git a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c index 495ab328..1bc1f101 100644 --- a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c +++ b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c @@ -247,7 +247,7 @@ void openavbAdpSMAdvertiseInterfaceStart() bool errResult;
THREAD_CREATE(openavbAdpSmAdvertiseInterfaceThread, openavbAdpSmAdvertiseInterfaceThread, NULL, openavbAdpSMAdvertiseInterfaceThreadFn, NULL);
THREAD_CHECK_ERROR(openavbAdpSmAdvertiseInterfaceThread, "Thread / task creation failed", errResult);
- if (errResult); // Already reported
+ if (errResult); // Already reported
AVB_TRACE_EXIT(AVB_TRACE_ADP);
}
diff --git a/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c b/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c index 485f2783..3013642e 100644 --- a/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c +++ b/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c @@ -1049,7 +1049,7 @@ void openavbAecpSMEntityModelEntityStart() bool errResult;
THREAD_CREATE(openavbAecpSMEntityModelEntityThread, openavbAecpSMEntityModelEntityThread, NULL, openavbAecpSMEntityModelEntityThreadFn, NULL);
THREAD_CHECK_ERROR(openavbAecpSMEntityModelEntityThread, "Thread / task creation failed", errResult);
- if (errResult); // Already reported
+ if (errResult); // Already reported
AVB_TRACE_EXIT(AVB_TRACE_AECP);
}
diff --git a/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h b/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h index 799dc23e..5ab4ccb5 100644 --- a/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h +++ b/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h @@ -84,6 +84,7 @@ typedef struct { // Current status of the fast connect support for the Listener.
openavb_fast_connect_status_t fast_connect_status;
U8 fast_connect_talker_entity_id[8];
+ struct timespec fast_connect_start_time;
// Also save a pointer to the supplied stream information.
const openavb_tl_data_cfg_t *stream;
diff --git a/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c b/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c index 4959243e..3afcfc3d 100644 --- a/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c +++ b/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c @@ -388,6 +388,9 @@ bool openavbAvdeccMsgSrvrHndlChangeNotificationFromClient(int avdeccMsgHandle, o ENTITYID_ARGS(talker_entity_id), ENTITYID_ARGS(controller_entity_id)); pDescriptor->fast_connect_status = OPENAVB_FAST_CONNECT_STATUS_TIMED_OUT; + memcpy(pDescriptor->fast_connect_talker_entity_id, talker_entity_id, 8); + CLOCK_GETTIME(OPENAVB_CLOCK_REALTIME, &pDescriptor->fast_connect_start_time); + pDescriptor->fast_connect_start_time.tv_sec += 5; // Give the Talker some time to shutdown or stabilize break; } } diff --git a/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c b/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c index 65f5c4cd..350dcff4 100644 --- a/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c +++ b/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c @@ -258,7 +258,7 @@ bool openavbEptSrvrRegisterStream(int h, } // If the Shaper is available, enable it. - if (openavbShaperDaemonAvailable()) { + if (openavbShaperDaemonAvailable() && ps->txRate) { ps->hndShaper = openavbShaperHandle( ps->srClass, MICROSECONDS_PER_SECOND / ps->txRate, /* Note that division rounds down, which is what we want. */ diff --git a/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h b/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h index 5e4c4fc8..ba693da9 100644 --- a/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h +++ b/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h @@ -43,7 +43,7 @@ https://github.com/benhoyt/inih/commit/74d2ca064fb293bc60a77b0bd068075b293cf175. #define TIMERFD_SETTIME(arg1, arg2, arg3, arg4) timerfd_settime(arg1, arg2, arg3, arg4) #define TIMER_CLOSE(arg1) close(arg1) -// In this Linux port all clock IDs preceeding OPENAVB_CLOCK_WALLTIME will be set to clock_gettime() +// In this Linux port all clock IDs preceding OPENAVB_CLOCK_WALLTIME will be set to clock_gettime() typedef enum { OPENAVB_CLOCK_REALTIME, OPENAVB_CLOCK_MONOTONIC, |