39 #define MAX_EVT_LISTENERS 8
40 #define LIFECYCLE_STR "Life cycle"
43 #define STREAM_NPT_REF_DESC 23
44 #define STREAM_NPT_END_DESC 24
45 #define STREAM_MODE_DESC 25
46 #define STREAM_EVENT_DESC 26
48 #define GEN_E_HDL(sid, eid, lid) (((U32BIT)sid << 24) | ((U32BIT)eid << 8) | (lid))
49 #define EH_TO_LID(eh) (U8BIT)(((U32BIT)eh) & 0xFF)
50 #define EH_TO_SID(eh) (U8BIT)(((U32BIT)eh) >> 24)
51 #define EH_TO_EID(eh) (U16BIT)((((U32BIT)eh) >> 8) & 0xFFFF)
53 #ifdef DISABLE_SUBSCRIBE_REFRESH
54 #define NewEventListen(i, e, ps, pe, h, u1, u2) NewEventListen(i, e, h, u1, u2)
57 #define XML_DATA1a "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
58 "<dsmcc:dsmcc xmlns=\"urn:dvb:mis:dsmcc:2009\" xmlns:dsmcc=\"urn:dvb:mis:dsmcc:2009\">\n" \
59 "<dsmcc:dsmcc_object dsmcc:component_tag=\""
60 #define XML_DATA1b "\">\n"
61 #define XML_DATA2a "<dsmcc:stream_event dsmcc:stream_event_id=\""
62 #define XML_DATA2b "\" dsmcc:stream_event_name=\""
63 #define XML_DATA2c "\"/>\n"
64 #define XML_DATA3 "</dsmcc:dsmcc_object>\n" \
72 typedef struct s_se_info
74 struct s_se_info *next;
88 typedef struct s_listener
90 struct s_listener *next;
91 H_DsmEvent eventHandle;
97 typedef struct s_dsmevent
104 S_LISTENER *pListener;
105 #ifdef SUPPORT_SCHEDULED_EVENTS
113 static U8BIT unique_stream_ids = 0;
114 static U8BIT unique_listen_ids = 0;
118 static void ReleaseStreamInfo(
P_DsmCoreInst idp, S_SE_INFO *dsi );
121 S_SE_INFO **ppStreamInfo );
126 S_SE_INFO* FindEventInfo(
P_DsmCoreInst idp, H_DsmEvent eventHandle)
128 S_SE_INFO *pStreamInfo;
136 strmId = EH_TO_SID(eventHandle);
137 pStreamInfo = idp->hSubscribedEventList;
138 while (pStreamInfo != NULL)
140 if (pStreamInfo->uniqueId == strmId)
144 pStreamInfo = pStreamInfo->next;
152 S_SE_INFO *pStreamInfo;
153 pStreamInfo = idp->hSubscribedEventList;
154 while (pStreamInfo != NULL)
156 if (pStreamInfo->pModule == streamObject->pModule &&
157 !memcmp(&pStreamInfo->objectKey, &streamObject->objectInfo.objectKey,
sizeof(
S_ObjectKey)))
161 pStreamInfo = pStreamInfo->next;
166 #ifndef DISABLE_SUBSCRIBE_REFRESH
168 S_Event* FindMatchingEventId( S_SE_INFO *pStreamInfo, U16BIT
id )
171 U16BIT evntNdx, evntMax;
172 if (pStreamInfo != NULL)
174 pEvent = (S_Event *)(pStreamInfo + 1);
175 evntMax = pStreamInfo->eventCount;
176 for (evntNdx = 0; evntNdx != evntMax; evntNdx++)
178 if (pEvent->id ==
id)
190 static E_DscError UnsubscribeEvent(
P_DsmCoreInst idp, S_Event *pEvent, H_DsmEvent eventHandle )
193 S_LISTENER **ppL, *pL;
194 U8BIT lstnId = EH_TO_LID(eventHandle);
195 ppL = &(pEvent->pListener);
196 err = CLDSM_ERR_INVALID_STREAM_EVENT_HANDLE;
201 if (pL->uniqueId == lstnId)
204 DSC_CmMemRelease( idp, pL );
208 ppL = &((*ppL)->next);
210 if (pEvent->pListener == NULL && pEvent->pFilter != NULL)
212 DBGLOG((DD_SE | DD_SF),
"pFilter=%p", pEvent->pFilter)
213 DSC_SectionFilterStop( idp, (
void *)&pEvent->pFilter );
214 pEvent->version = 0xff;
219 static E_DscError NewEventListen(
P_DsmCoreInst idp, S_Event *pEvent,
220 S_SE_INFO *prevSEInfo, H_DsmEvent prevEventHandle, U32BIT hdl_id,
void *userData1,
void *userData2 )
224 #ifndef DISABLE_SUBSCRIBE_REFRESH
226 pPrevEvt = FindMatchingEventId( prevSEInfo, pEvent->id );
227 if (pPrevEvt != NULL)
229 dsmDP2((
"Previously subsribed event, id %d vers %d <- %d", pEvent->id, pEvent->version, pPrevEvt->version));
230 pEvent->version = pPrevEvt->version;
233 pL = pEvent->pListener;
236 DBGLOG(DD_SE,
"e Lsr=%p", pL)
237 if (pL->userData1 == userData1 && pL->userData2 == userData2)
239 err = CLDSM_ERR_STREAM_EVENTS_STILL_SUBSCRIBED;
246 pL = (S_LISTENER *)DSC_CmMemGet( idp,
sizeof(S_LISTENER) );
249 err = CLDSM_ERR_MEM_HEAP_FULL;
254 DBGLOG(DD_SE,
"e Lsr=%p", pL)
255 pL->userData1 = userData1;
256 pL->userData2 = userData2;
257 pL->uniqueId = unique_listen_ids;
258 pL->eventHandle = (H_DsmEvent)hdl_id;
259 pL->next = pEvent->pListener;
260 pEvent->pListener = pL;
266 static E_DscError StartSectionFilter(
P_DsmCoreInst idp, S_SE_INFO *pStreamInfo, P_Event pEvent )
269 if (pEvent->pFilter == NULL)
271 DBGLOG((DD_SE | DD_SF),
"serv_id=0x%x eid=%x", pStreamInfo->serviceId,pEvent->id)
273 target.kind = SFK_STREAM_DESCR;
274 target.
id = pEvent->
id;
275 target.serviceId = pStreamInfo->serviceId;
276 target.associationTag = pStreamInfo->eventAssocTag;
277 target.u.pEvent = pEvent;
278 return DSC_SectionFilterStart( idp, &target, SF_PRIORITY_HIGH, &pEvent->pFilter );
335 H_DsmEvent *pEventHandle )
339 S_SE_INFO *pStreamInfo;
340 #ifndef DISABLE_SUBSCRIBE_REFRESH
341 S_SE_INFO *prevStrmInfo;
345 U16BIT evntNdx, evntMax;
347 DBGLOG(DD_SE,
"( 0x%x, %s, 0x%x, 0x%x, 0x%x )",
348 streamObject, eventName, userData1, userData2, pEventHandle)
350 if (idp->setup.notifyStreamEventFunc == NULL)
352 return CLDSM_ERR_NO_STREAM_EVENT_NOTIFY_CALLBACK;
355 err = RetrieveStreamInfo( idp, streamObject, &pStreamInfo );
358 pEvent = (S_Event *)(pStreamInfo + 1);
359 evntMax = pStreamInfo->eventCount;
360 pStreamInfo->lstnrCount++;
361 usid = pStreamInfo->uniqueId;
363 #ifndef DISABLE_SUBSCRIBE_REFRESH
365 prevStrmInfo = FindEventInfo(idp, *pEventHandle);
369 if (eventName == NULL)
375 ui32 = strlen((
char *)eventName);
378 err = CLDSM_ERR_INVALID_STREAM_EVENT_NAME;
382 ui32 = GEN_E_HDL(usid, 0xFFFF, unique_listen_ids);
385 for (evntNdx = 0; evntNdx != evntMax; evntNdx++)
387 if (pEvent->name != NULL)
389 err = NewEventListen( idp, pEvent, prevStrmInfo, *pEventHandle, ui32, userData1, userData2 );
396 err = StartSectionFilter(idp, pStreamInfo, pEvent);
408 for (evntNdx = 0; evntNdx != evntMax; evntNdx++)
410 if (pEvent->name != NULL && pEvent->nlen == ui32 &&
411 memcmp(pEvent->name, eventName, ui32) == 0)
414 ui32 = GEN_E_HDL(usid, evntNdx, unique_listen_ids);
417 err = NewEventListen( idp, pEvent, prevStrmInfo, *pEventHandle, ui32, userData1, userData2 );
420 err = StartSectionFilter(idp, pStreamInfo, pEvent);
427 #ifndef DISABLE_SUBSCRIBE_REFRESH
437 case CLDSM_ERR_STREAM_EVENTS_STILL_SUBSCRIBED:
439 *pEventHandle = (H_DsmEvent)ui32;
443 if (EH_TO_EID(ui32) == 0xFFFF)
447 UnsubscribeEvent( idp, pEvent, (H_DsmEvent)ui32 );
454 UnsubscribeEvent( idp, pEvent, (H_DsmEvent)ui32 );
457 case CLDSM_ERR_INVALID_STREAM_EVENT_NAME:
458 ReleaseStreamInfo( idp, pStreamInfo );
506 U16BIT associationTag,
510 H_DsmEvent *pEventHandle )
514 S_SE_INFO *pStreamInfo;
518 DBGLOG(DD_SE,
"( %u, %u, 0x%x, 0x%x, 0x%x )",
519 associationTag, eventId, userData1, userData2, pEventHandle)
521 if (idp->setup.notifyStreamEventFunc == NULL)
523 return CLDSM_ERR_NO_STREAM_EVENT_NOTIFY_CALLBACK;
525 if (!idp->currentServiceSet || idp->dvbLocator.service_id == 0)
527 return CLDSM_ERR_NO_CURRENT_SERVICE_SET;
529 pStreamInfo = idp->hSubscribedEventList;
530 while (pStreamInfo != NULL)
532 DBGLOG(DD_SE,
"pStreamInfo=%p", pStreamInfo)
533 if (pStreamInfo->eventAssocTag == associationTag)
535 pEvent = (S_Event *)(pStreamInfo + 1);
536 if (pEvent->id == eventId)
541 pStreamInfo = pStreamInfo->next;
544 if (pStreamInfo != NULL)
550 size =
sizeof(S_SE_INFO) +
sizeof(S_Event);
551 pStreamInfo = (S_SE_INFO *)DSC_CmMemGet( idp, size );
555 err = CLDSM_ERR_MEM_HEAP_FULL;
561 memset( pStreamInfo, 0, size );
563 pEvent = (S_Event *)(pStreamInfo + 1);
566 pEvent->id = eventId;
567 pEvent->version = 0xFF;
569 DBGLOG(DD_SE,
"pStreamInfo=%p", pStreamInfo)
570 pStreamInfo->eventAssocTag = associationTag;
571 pStreamInfo->uniqueId = ++unique_stream_ids;
572 pStreamInfo->eventCount = 1;
573 pStreamInfo->serviceId = idp->dvbLocator.service_id;
575 pStreamInfo->next = idp->hSubscribedEventList;
576 idp->hSubscribedEventList = pStreamInfo;
581 #ifndef DISABLE_SUBSCRIBE_REFRESH
583 S_SE_INFO *prevStrmInfo = FindEventInfo(idp, *pEventHandle);
585 pStreamInfo->lstnrCount++;
586 hdl_id = pStreamInfo->uniqueId;
589 hdl_id = GEN_E_HDL(hdl_id, 0, unique_listen_ids);
590 err = NewEventListen( idp, pEvent, prevStrmInfo, *pEventHandle, hdl_id, userData1, userData2 );
593 DBGLOG(DD_SE,
"e ftr=%p, hdl_id=%lx", pEvent->pFilter, hdl_id)
594 err = StartSectionFilter(idp, pStreamInfo, pEvent);
595 DBGLOG(DD_SF,
"err=%d pEvent->pFilter=%x", err, pEvent->pFilter)
597 #ifndef DISABLE_SUBSCRIBE_REFRESH
601 DBGLOG(DD_SE,
"unsubscr %p", *pEventHandle)
608 case CLDSM_ERR_STREAM_EVENTS_STILL_SUBSCRIBED:
610 *pEventHandle = (H_DsmEvent)hdl_id;
614 ERRPRINT(
"err=%d", err)
615 UnsubscribeEvent( idp, pEvent, (H_DsmEvent)hdl_id );
616 ReleaseStreamInfo( idp, pStreamInfo );
640 H_DsmEvent eventHandle)
643 S_SE_INFO *pStreamInfo;
647 DBGLOG(DD_SE,
" evHl=%p", eventHandle)
649 evtId = EH_TO_EID(eventHandle);
651 pStreamInfo = FindEventInfo(idp, eventHandle);
652 if (pStreamInfo == NULL)
654 err = CLDSM_ERR_INVALID_STREAM_EVENT_HANDLE;
658 pEvent = (S_Event *)(pStreamInfo + 1);
662 err = CLDSM_ERR_INVALID_STREAM_EVENT_HANDLE;
663 for (evtId = 0; evtId != pStreamInfo->eventCount; evtId++, pEvent++)
665 if (UnsubscribeEvent( idp, pEvent, eventHandle ) == CLDSM_OK)
671 else if (evtId <= pStreamInfo->eventCount)
674 err = UnsubscribeEvent( idp, pEvent, eventHandle );
678 err = CLDSM_ERR_INVALID_STREAM_EVENT_HANDLE;
682 ReleaseStreamInfo( idp, pStreamInfo );
702 H_DsmEvent eventHandle )
707 #ifdef INC_STREAM_RESET
714 E_DscError dsmStreamEventReset(
719 S_SE_INFO *pStreamInfo;
721 U16BIT evntNdx, evntMax;
723 dsmDP2((
"( 0x%x )", streamObject));
725 pStreamInfo = FindStreamInfo(dsmccInstance, streamObject);
726 if (pStreamInfo != NULL)
728 dsmDP1((
" no stream object "));
729 err = CLDSM_ERR_OBJECT_NOT_LOADED;
733 pEvent = (S_Event *)(pStreamInfo + 1);
734 evntMax = pStreamInfo->eventCount;
735 for (evntNdx = 0; evntNdx != evntMax; evntNdx++)
737 pEvent->version = 0xff;
746 E_DscError DSC_StrmEventUpdate(
P_DsmCoreInst idp, U8BIT *pStreamDescrSection,
747 P_Event pEvent, U32BIT targetId )
749 E_DscError err = CLDSM_OK;
751 #if DSM_DATA_CHECK_LEVEL >= 2
754 U16BIT eventID, msg_len;
755 U8BIT ui8, version, dtag, dlen, edata_len, *edata_ptr;
756 #ifdef SUPPORT_SCHEDULED_EVENTS
760 dsmDP3((
"DSC_StrmEventUpdate()\n"));
761 dsmAssert((idp != NULL));
762 dsmAssert((pStreamDescrSection != NULL));
765 READ_UINT8( pStreamDescrSection, ui8);
768 dsmDP1((
"DATA ERROR: streamEvent table_id = %x", ui8));
769 return CLDSM_ERR_INVALID_INSTANCE;
776 READ_UINT16( pStreamDescrSection, msg_len );
780 dsmDP1((
"DATA ERROR: section length=0x%x", msg_len));
781 return CLDSM_ERR_INVALID_INSTANCE;
785 if (pEvent == NULL || pEvent->id != targetId)
787 dsmDP1((
"no target for id=%x", targetId));
788 return CLDSM_ERR_INVALID_STREAM_EVENT_HANDLE;
802 READ_UINT16( pStreamDescrSection, eventID );
808 if ((eventID != 0xFFFF) &&
809 ((eventID < 0x0001) || (eventID > 0xBFFF)))
811 dsmDP3((
"DSC_StrmEventUpdate tableId ext doesnt carry a do-it-now event = %xh\n", eventID));
815 if (pEvent->id != eventID)
817 dsmDP1((
"pEvent->id != eventID: %x, %x", pEvent->id, eventID));
818 err = CLDSM_ERR_INVALID_STREAM_EVENT_NAME;
823 READ_UINT8( pStreamDescrSection, ui8);
825 version = (ui8 >> 1) & 0x1F;
826 if (version != pEvent->version)
830 dsmDP2((
"newVer=%u oldVer=%u", version, pEvent->version));
831 pEvent->version = version;
835 READ_UINT8_L2CHK( pStreamDescrSection, ui8, ui8 == 0,
836 dsmDP2((
"only consider section number = 0 here: %x\n", ui8)),
839 READ_UINT8_L2CHK( pStreamDescrSection, ui8, ui8 == 0,
840 dsmDP2((
"only consider last section number = 0 here: %x\n", ui8)),
846 READ_UINT8( pStreamDescrSection, dtag );
848 READ_UINT8( pStreamDescrSection, dlen );
851 dsmDP1((
"Invalid lengths: msg=%x, dlen=%x", msg_len, dlen));
852 return CLDSM_ERR_END_OF_DATA;
857 case STREAM_NPT_REF_DESC:
858 case STREAM_NPT_END_DESC:
859 case STREAM_MODE_DESC:
863 case STREAM_EVENT_DESC:
866 dsmDP1((
"Invalid desc length: %x", dlen));
867 return CLDSM_ERR_END_OF_DATA;
869 edata_len = dlen - 10;
873 edata_ptr = pStreamDescrSection + 10;
875 #if DSM_DATA_CHECK_LEVEL >= 2
876 READ_UINT16_L2CHK(pStreamDescrSection, ui16, ui16 == eventID,
877 dsmDP2((
"DATA ERR: eventID mismatch %u,%u\n", eventID, ui16)),
880 pStreamDescrSection += 2;
882 #ifdef SUPPORT_SCHEDULED_EVENTS
884 READ_UINT32( pStreamDescrSection, ui32);
885 ULONG_Set32(pEvent->eventNpt, ui32 & 1);
886 ULONG_ShiftLeft(pEvent->eventNpt, 32);
887 READ_UINT32( pStreamDescrSection, ui32);
888 ULONG_Set32(pEvent->eventNpt, ui32);
889 pStreamDescrSection += edata_len;
891 pStreamDescrSection += 8 + edata_len;
895 if (eventID == 0xFFFF || (eventID > 0 && eventID < 0x4000))
897 U8BIT *name = pEvent->name;
906 dsmDP2((
"\nEVENT Name:%s ID:%u version Nb:%u\n", name, eventID, version));
908 dsmAssert((idp->setup.notifyStreamEventFunc != NULL));
909 pL = pEvent->pListener;
912 idp->setup.notifyStreamEventFunc( pL->eventHandle,
913 SEN_TRIGGERED, pL->userData1, pL->userData2, name, edata_ptr, dlen, edata_len );
931 DEBUG_CHK( err == CLDSM_OK, dsmDP1((
"ERROR: DSC_StrmEventUpdate: %u\n", err)));
937 S_SE_INFO *pStreamInfo;
939 U16BIT evntNdx, evntMax;
940 pStreamInfo = idp->hSubscribedEventList;
941 while (pStreamInfo != NULL)
943 pEvent = (S_Event *)(pStreamInfo + 1);
944 evntMax = pStreamInfo->eventCount;
945 for (evntNdx = 0; evntNdx != evntMax; evntNdx++, pEvent++)
947 if (pEvent->pFilter != NULL)
949 DBGLOG((DD_SE | DD_SF),
"serv_id=0x%x pFilter=%p", pStreamInfo->serviceId, pEvent->pFilter)
950 DSC_SectionFilterStop( idp, &pEvent->pFilter );
952 StartSectionFilter(idp, pStreamInfo, pEvent);
954 pStreamInfo = pStreamInfo->next;
963 static
void FreeStreamInfo(
P_DsmCoreInst idp, S_SE_INFO *pStreamInfo )
969 if (pStreamInfo->xmlPtr)
971 DSC_CmMemRelease( idp, pStreamInfo->xmlPtr );
973 pEvent = (S_Event *)(pStreamInfo + 1);
974 eventCount = pStreamInfo->eventCount;
977 while (pEvent->pListener != NULL)
979 pL = pEvent->pListener;
980 ERRPRINT(
"ERROR !Listener still subscribed! hdl=%x", pL->eventHandle)
981 pEvent->pListener = pL->next;
982 DSC_CmMemRelease( idp, pL );
984 if (pEvent->pFilter != NULL)
986 DBGLOG((DD_SE | DD_SF),
"serv_id=0x%x pFilter=%p", pStreamInfo->serviceId, pEvent->pFilter)
987 DSC_SectionFilterStop( idp, &pEvent->pFilter );
991 DSC_CmMemRelease( idp, pStreamInfo );
1009 S_SE_INFO **ppStreamInfo )
1011 MemPtr mpObjectData, mpObjectDataFirstPos;
1017 U16BIT eventCount, namesLen;
1022 S_SE_INFO *pStreamInfo;
1025 *ppStreamInfo = NULL;
1027 if (!DSM_OBJECT_CORRECT( streamObject, idp ))
1029 dsmDP1((
"API ERROR: Invalid object handle\n"));
1030 err = CLDSM_ERR_INVALID_OBJECT_HANDLE;
1032 else if (streamObject->objectInfo.objectKind != STE_STR)
1034 dsmDP1((
"ERROR: message is not a streamEvent !! = %u\n",
1035 streamObject->objectInfo.objectKind));
1036 err = CLDSM_ERR_INVALID_OBJECT_TYPE;
1038 else if ((pStreamInfo = FindStreamInfo(idp, streamObject)) != NULL)
1040 *ppStreamInfo = pStreamInfo;
1045 pModule = streamObject->pModule;
1046 if (!moduleDataFindObject(pModule->hModuleData, pModule->moduleInfo.originalSize,
1047 &(streamObject->objectInfo.objectKey), &mpObjectData ))
1049 dsmDP1((
"failed to find object in module"));
1050 err = CLDSM_ERR_OBJECT_NOT_LOADED;
1054 mpObjectDataFirstPos = mpObjectData;
1057 SET_POS_REL(mpObjectData, 12);
1060 READ_UINT8(mpObjectData, ui8 );
1061 SET_POS_REL(mpObjectData, ui8);
1064 READ_UINT32( mpObjectData, ui32)
1067 dsmDP2((
"DATA ERROR: objectKindLg !=4 %u\n", ui32));
1068 err = CLDSM_ERR_INVALID_OBJECT_TYPE;
1072 READ_UINT32( mpObjectData, ui32)
1073 if (ui32 != 0x73746500)
1075 dsmDP2((
"DATA ERROR: objectKind != ste %u\n", ui32));
1076 err = CLDSM_ERR_INVALID_OBJECT_TYPE;
1081 SET_POS_REL(mpObjectData, 2);
1084 READ_UINT8(mpObjectData, ui8);
1085 SET_POS_REL(mpObjectData, ui8);
1088 SET_POS_REL(mpObjectData, 11);
1090 READ_UINT16(mpObjectData, eventCount);
1091 GET_POS( mpObjectData, hdlPos );
1093 for (ui16 = eventCount; ui16--; )
1095 READ_UINT8( mpObjectData, ui8 );
1096 SET_POS_REL(mpObjectData, ui8);
1099 ui32 =
sizeof(S_SE_INFO) + (eventCount *
sizeof(S_Event)) + namesLen;
1100 pStreamInfo = (S_SE_INFO *)DSC_CmMemGet( idp, ui32 );
1103 err = CLDSM_ERR_MEM_HEAP_FULL;
1108 pStreamInfo->pModule = pModule;
1109 memcpy(&(pStreamInfo->objectKey), &(streamObject->objectInfo.objectKey),
sizeof(
S_ObjectKey));
1110 pStreamInfo->uniqueId = ++unique_stream_ids;
1111 if (memValidate(streamObject->pObjCarousel))
1113 pStreamInfo->serviceId = streamObject->pObjCarousel->root.serviceId;
1117 pStreamInfo->serviceId = idp->dvbLocator.service_id;
1119 pStreamInfo->eventCount = eventCount;
1120 pStreamInfo->lstnrCount = 0;
1121 pEvent = (S_Event *)(pStreamInfo + 1);
1122 pNames = (U8BIT *)(pEvent + eventCount);
1123 pStreamInfo->namesPtr = pNames;
1124 pStreamInfo->namesLen = namesLen;
1125 pStreamInfo->xmlPtr = NULL;
1128 SET_POS_ABS( mpObjectData, hdlPos );
1129 for (ui16 = eventCount; ui16--; pEvent++)
1132 READ_UINT8( mpObjectData, ui8 );
1133 pEvent->nlen = ui8 - 1;
1134 pEvent->name = pNames;
1137 READ_UINT8( mpObjectData, *pNames );
1142 *(pNames - 1) =
',';
1144 pEvent->version = 0xFF;
1145 pEvent->pFilter = NULL;
1146 pEvent->pListener = NULL;
1147 #ifdef SUPPORT_SCHEDULED_EVENTS
1148 pEvent->eventNpt = 0;
1155 mpObjectData = mpObjectDataFirstPos;
1156 SET_POS_REL( mpObjectData, (S32BIT)(streamObject->objectInfo.messageBodyOffset - 4));
1159 READ_UINT32(mpObjectData, ui32);
1162 dsmDP2((
"RetrieveStreamInfo(-): msg len is zero\n"));
1166 READ_UINT8(mpObjectData, tapsCount);
1168 pStreamInfo->eventAssocTag = 0;
1172 READ_UINT16(mpObjectData, ui16);
1175 dsmDP1((
"tap Id should zero, here=%d\n", ui16));
1177 READ_UINT16(mpObjectData, tapUse);
1179 READ_UINT16(mpObjectData, ui16);
1180 dsmDP2((
"TAP: use=%d assocTag=0x%x\n", tapUse, ui16));
1182 READ_UINT8(mpObjectData, ui8);
1185 dsmDP1((
"RetrieveStreamInfo(-): selector_length should be zero here=%d\n", ui8));
1189 case STR_STATUS_AND_EVENT_USE:
1191 pStreamInfo->eventAssocTag = ui16;
1196 READ_UINT8(mpObjectData, ui8);
1197 if (eventCount != ui8)
1199 dsmDP1((
"eventNamesCount=%d != eventIds_count=%d\n", eventCount, ui8));
1201 pEvent = (S_Event *)(pStreamInfo + 1);
1202 for (ui16 = eventCount; ui16--; pEvent++)
1204 READ_UINT16(mpObjectData, pEvent->id);
1207 pStreamInfo->next = idp->hSubscribedEventList;
1208 idp->hSubscribedEventList = pStreamInfo;
1209 *ppStreamInfo = pStreamInfo;
1224 if (!sei->lstnrCount)
1226 ppSEI = &idp->hSubscribedEventList;
1227 while (*ppSEI != NULL)
1231 *ppSEI = (*ppSEI)->next;
1232 FreeStreamInfo( idp, sei );
1235 ppSEI = &((*ppSEI)->next);
1242 S_SE_INFO *sei, *nxt;
1243 sei = idp->hSubscribedEventList;
1247 FreeStreamInfo( idp, sei );
1250 idp->hSubscribedEventList = NULL;
1282 U8BIT **pNamesPtr, U16BIT *pNamesLen )
1285 S_SE_INFO *pStreamInfo;
1286 err = RetrieveStreamInfo( dsmccInstance, streamObject, &pStreamInfo );
1287 if (CLDSM_OK == err)
1289 *pNamesPtr = pStreamInfo->namesPtr;
1290 *pNamesLen = pStreamInfo->namesLen;
1313 U8BIT **pXmlData, U16BIT *pXmlLen)
1316 S_SE_INFO *pStreamInfo;
1318 err = RetrieveStreamInfo( dsmccInstance, streamObject, &pStreamInfo );
1319 if (CLDSM_OK == err)
1321 if (pStreamInfo->xmlPtr == NULL)
1325 sz =
sizeof(XML_DATA2a) +
sizeof(XML_DATA2b) +
sizeof(XML_DATA2c) + 2;
1326 sz *= pStreamInfo->eventCount;
1327 sz += pStreamInfo->namesLen;
1328 sz +=
sizeof(XML_DATA1a) +
sizeof(XML_DATA1b) +
sizeof(XML_DATA3);
1329 data = (
char *)DSC_CmMemGet( (
P_DsmCoreInst)dsmccInstance, sz );
1332 pStreamInfo->xmlPtr = (U8BIT *)data;
1333 strcpy(data, XML_DATA1a);
1334 data +=
sizeof(XML_DATA1a) - 1;
1335 data += sprintf(data,
"%u", pStreamInfo->eventAssocTag);
1336 strcpy(data, XML_DATA1b);
1337 data +=
sizeof(XML_DATA1b) - 1;
1338 pEvent = (S_Event *)(pStreamInfo + 1);
1339 for (sz = 0; sz != pStreamInfo->eventCount; sz++, pEvent++)
1341 strcat(data, XML_DATA2a);
1342 data +=
sizeof(XML_DATA2a) - 1;
1343 data += sprintf(data,
"%u", pEvent->id);
1344 strcat(data, XML_DATA2b);
1345 data +=
sizeof(XML_DATA2b) - 1;
1346 strncpy(data, (
const char *)pEvent->name, pEvent->nlen);
1347 data += pEvent->nlen;
1348 strcat(data, XML_DATA2c);
1349 data +=
sizeof(XML_DATA2c) - 1;
1351 strcat(data, XML_DATA3);
1352 data +=
sizeof(XML_DATA3) - 1;
1353 pStreamInfo->xmlLen = (U16BIT)((U8BIT*)data - pStreamInfo->xmlPtr);
1356 *pXmlData = pStreamInfo->xmlPtr;
1357 *pXmlLen = pStreamInfo->xmlLen;
E_DscError CDSM_StreamEventUnsubscribe(H_DsmCoreInst idp, H_DsmEvent eventHandle)
This function is called by the Client to let DSMCC know when a previously subscribed stream event is ...
General include file for clDsm library internal definitions.
E_DscError CDSM_StreamEventNameList(H_DsmCoreInst dsmccInstance, H_DsmObject streamObject, U8BIT **pNamesPtr, U16BIT *pNamesLen)
The Client uses this function to request list of event names for stream object Before calling this fu...
E_DscError CDSM_StreamEventSubscribe(H_DsmCoreInst dsmccInstance, H_DsmObject streamObject, U8BIT *eventName, void *userData1, void *userData2, H_DsmEvent *pEventHandle)
The Client uses this function to request that the DSMCC notifies it when a named stream event occurs...
Header to the cacheMgr module.
E_DscError CDSM_SpecialEventSubscribe(H_DsmCoreInst dsmccInstance, U16BIT associationTag, U16BIT eventId, void *userData1, void *userData2, H_DsmEvent *pEventHandle)
Like clDsmStreamEventSubscribe, except that no stream object is required. This function subscribes to...
Header to dsmObject module - functions for managing DSM object heap.
E_DscError CDSM_SpecialEventUnsubscribe(H_DsmCoreInst dsmccInstance, H_DsmEvent eventHandle)
Same as clDsmStreamEventUnsubscribe - used in conjuction with clDsmSpecialEventSubscribe.
Header to the sectionFilter module.
Header to the objectCarousel module.
E_DscError CDSM_StreamEventXmlData(H_DsmCoreInst dsmccInstance, H_DsmObject streamObject, U8BIT **pXmlData, U16BIT *pXmlLen)
The Client uses this function to request data in XML format for stream object and associated events...
Header to the 'module' module - Functions/methods for creating/destroying and managing attributes of ...
Header to the moduleData module.