summaryrefslogtreecommitdiff
path: root/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c')
-rw-r--r--lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c52
1 files changed, 32 insertions, 20 deletions
diff --git a/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c b/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c
index 042801e3..90476031 100644
--- a/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c
+++ b/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c
@@ -1,16 +1,17 @@
/*************************************************************************************************************
Copyright (c) 2012-2015, Symphony Teleca Corporation, a Harman International Industries, Incorporated company
+Copyright (c) 2016-2017, Harman International Industries, Incorporated
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS LISTED "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -21,15 +22,15 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Attributions: The inih library portion of the source code is licensed from
-Brush Technology and Ben Hoyt - Copyright (c) 2009, Brush Technology and Copyright (c) 2009, Ben Hoyt.
-Complete license and copyright information can be found at
+
+Attributions: The inih library portion of the source code is licensed from
+Brush Technology and Ben Hoyt - Copyright (c) 2009, Brush Technology and Copyright (c) 2009, Ben Hoyt.
+Complete license and copyright information can be found at
https://github.com/benhoyt/inih/commit/74d2ca064fb293bc60a77b0bd068075b293cf175.
*************************************************************************************************************/
/*
-* MODULE SUMMARY : Talker implementation for use without endpoint
+* MODULE SUMMARY : Talker implementation for use without endpoint
*/
#include <stdlib.h>
@@ -40,6 +41,7 @@ https://github.com/benhoyt/inih/commit/74d2ca064fb293bc60a77b0bd068075b293cf175.
#include "openavb_talker.h"
#include "openavb_qmgr.h"
#include "openavb_endpoint.h"
+#include "openavb_avdecc_msg.h"
#define AVB_LOG_COMPONENT "Talker"
#include "openavb_log.h"
@@ -60,28 +62,28 @@ bool openavbTLRunTalkerInit(tl_state_t *pTLState)
talker_data_t *pTalkerData = pTLState->pPvtTalkerData;
//avtp_stream_t *pStream = (avtp_stream_t *)(pTalkerData->avtpHandle);
- strncpy(pTalkerData->ifname, pCfg->ifname, IFNAMSIZ);
-
+ strncpy(pTalkerData->ifname, pCfg->ifname, sizeof(pTalkerData->ifname) - 1);
+
// CORE_TODO: It would be good to have some parts of endpoint moved into non-endpoint general code to handle some the stream
// configuration values.
- // strncpy(pTalkerData->ifname, pCfg->ifname, IFNAMSIZ);
if (pCfg->stream_addr.mac) {
memcpy(pTalkerData->streamID.addr, pCfg->stream_addr.mac, ETH_ALEN);
}else {
AVB_LOG_WARNING("Stream Address Not Set");
}
-
+
pTalkerData->streamID.uniqueID = pCfg->stream_uid;
+ pTalkerData->srClass = pCfg->sr_class;
if (pCfg->sr_class == SR_CLASS_A) {
pTalkerData->classRate = 8000;
- pTalkerData->vlanID = pCfg->vlan_id == VLAN_NULL ?
- SR_CLASS_A_DEFAULT_VID : pCfg->vlan_id;
+ pTalkerData->vlanID = (pCfg->vlan_id == 0 ?
+ SR_CLASS_A_DEFAULT_VID : pCfg->vlan_id);
pTalkerData->vlanPCP = SR_CLASS_A_DEFAULT_PRIORITY;
}
else if (pCfg->sr_class == SR_CLASS_B) {
pTalkerData->classRate = 4000;
- pTalkerData->vlanID = pCfg->vlan_id == VLAN_NULL ?
- SR_CLASS_B_DEFAULT_VID : pCfg->vlan_id;
+ pTalkerData->vlanID = (pCfg->vlan_id == 0 ?
+ SR_CLASS_B_DEFAULT_VID : pCfg->vlan_id);
pTalkerData->vlanPCP = SR_CLASS_B_DEFAULT_PRIORITY;
}
memcpy(&pTalkerData->destAddr, &pCfg->dest_addr.mac->ether_addr_octet, ETH_ALEN);
@@ -99,10 +101,10 @@ bool openavbTLRunTalkerInit(tl_state_t *pTLState)
unsigned int map_intv_frames = pCfg->map_cb.map_get_max_interval_frames_cb(pTLState->pMediaQ, pTLState->cfg.sr_class);
pCfg->max_interval_frames = map_intv_frames > 0 ? map_intv_frames : pCfg->max_interval_frames;
}
- }
+ }
pTalkerData->tSpec.maxIntervalFrames = pCfg->max_interval_frames;
pTalkerData->tSpec.maxFrameSize = pCfg->map_cb.map_max_data_size_cb(pTLState->pMediaQ);
-
+
// TODO_COREAVB : This wakeRate should also be set in the endpoint case and removed from the tasker.c start stream
if (!pCfg->map_cb.map_transmit_interval_cb(pTLState->pMediaQ)) {
pTalkerData->wakeRate = pTalkerData->classRate / pCfg->batch_factor;
@@ -122,11 +124,20 @@ bool openavbTLRunTalkerInit(tl_state_t *pTLState)
if (pTalkerData->fwmark == INVALID_FWMARK)
return FALSE;
-
+
AVB_LOGF_INFO("Dest Addr: "ETH_FORMAT, ETH_OCTETS(pTalkerData->destAddr));
AVB_LOGF_INFO("Starting stream: "STREAMID_FORMAT, STREAMID_ARGS(&pTalkerData->streamID));
talkerStartStream(pTLState);
-
+
+ // Let the AVDECC Msg server know our current stream ID, in case it is waiting for an update.
+ if (pTLState->avdeccMsgHandle != AVB_AVDECC_MSG_HANDLE_INVALID) {
+ if (!openavbAvdeccMsgClntTalkerStreamID(pTLState->avdeccMsgHandle,
+ pTalkerData->srClass, pTalkerData->streamID.addr, pTalkerData->streamID.uniqueID,
+ pTalkerData->destAddr, pTalkerData->vlanID)) {
+ AVB_LOG_ERROR("openavbAvdeccMsgClntTalkerStreamID() failed");
+ }
+ }
+
return TRUE;
}
@@ -142,6 +153,7 @@ AVBStreamID_t *streamID,
char *ifname,
U8 destAddr[],
openavbSrpLsnrDeclSubtype_t lsnrDecl,
+U8 srClass,
U32 classRate,
U16 vlanID,
U8 priority,