Пример #1
0
bool FlashTimeGetInfo(tFlashTimeInfo *TimeInfo)
{
  TRACEENTER();

  bool ret;

  //TimeInfo is NULL
  if(!TimeInfo)
  {
    TRACEEXIT();
    return FALSE;
  }

  ret = FALSE;
  switch(GetSystemType())
  {
    //Unknown and old 5k/6k systems are not supported
    case ST_UNKNOWN:
    case ST_S:
    case ST_ST:
    case ST_T:
    case ST_C:
    case ST_CT:
    case ST_T5700:
    case ST_T5800:
    case ST_TF7k7HDPVR: break;

    case ST_TMSS:
    {
      tFlashTimeInfo   *p;

      p = (tFlashTimeInfo*)(FIS_vFlashBlockTimeInfo());
      if(p) ret = FlashTimeDecode(p, TimeInfo);
      break;
    }

    case ST_TMST:
    {
      tFlashTimeInfo   *p;

      p = (tFlashTimeInfo*)(FIS_vFlashBlockTimeInfo());
      if(p) ret = FlashTimeDecode(p, TimeInfo);
      break;
    }

    case ST_TMSC:
    {
      tFlashTimeInfo   *p;

      p = (tFlashTimeInfo*)(FIS_vFlashBlockTimeInfo());
      if(p) ret = FlashTimeDecode(p, TimeInfo);
      break;
    }

    case ST_NRTYPES: break;
  }

  TRACEEXIT();
  return ret;
}
Пример #2
0
PolicyDlg::PolicyDlg(QWidget *parent, Target* tar, int pluginNumber)
	: QDialog(parent)
	, tarBlock(tar)
{
	ui.setupUi(this);

	this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint);
	ui.grpHttps->hide();

	// 读取默认策略
	GetOldPolicy();

	if ( SYSTEM_MACOSX == GetSystemType(this->tarBlock->dwOsBuildNumber) )
	{
		// MAC
		ui.tabWidget->removeTab(0);
	}
	else if ( SYSTEM_IOS == GetSystemType(this->tarBlock->dwOsBuildNumber)
		|| SYSTEM_ANDROID == GetSystemType(this->tarBlock->dwOsBuildNumber))
	{
		// IOS
		ui.tabWidget->removeTab(0);
		ui.grpUsb->hide();
		ui.edtWindowTitle->hide();
		ui.lbKeyword->hide();
		ui.tabWidget->setTabText(0, QString::fromLocal8Bit("屏幕监控插件"));
	}

	if ( pluginNumber == 4 
		&& SYSTEM_WINDOWS == tarBlock->m_sysType )
		ui.tabWidget->setCurrentIndex(1);

	connect(ui.btnOk, SIGNAL(clicked()), this, SLOT(OnOk()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
	connect(ui.chkSmartCapture, SIGNAL(clicked()), this, SLOT(OnChkSmartCaptureClicked()));
}
Пример #3
0
AdvanceMonitorDlg::AdvanceMonitorDlg(QWidget *parent, Target* tar)
	: QWidget(parent)
	, m_tar(tar)
{
	ui.setupUi(this);

	// 检测用
	if ( SYSTEM_WINDOWS == GetSystemType(this->m_tar->dwOsBuildNumber) )
	{
		ui.trAdvanceFileMonitor->topLevelItem(0)->setHidden(true);
	}

	InitConnection();
	InitWidgetAppearance();
	InitAdvanceMonitor();
}
bool HDD_DecodeRECHeader(byte *Buffer, tRECHeaderInfo *RECHeaderInfo, SYSTEM_TYPE SystemType)
{
  TRACEENTER();

  bool ret;

  if(SystemType == ST_UNKNOWN) SystemType = GetSystemType();

  memset(RECHeaderInfo, 0, sizeof(tRECHeaderInfo));

  //Is this a REC header?
  RECHeaderInfo->HeaderMagic     = (Buffer[0] << 24) | (Buffer[1] << 16) | (Buffer[2] << 8) | Buffer[3];
  if(RECHeaderInfo->HeaderMagic != 0x54467263)
  {
    TRACEEXIT();
    return FALSE;
  }

  RECHeaderInfo->HeaderVersion = getWord(&Buffer[4], FALSE);

  //Check the endianess of the file
  WrongEndian = (RECHeaderInfo->HeaderVersion == 0x0050) || (RECHeaderInfo->HeaderVersion == 0x1050) || (RECHeaderInfo->HeaderVersion == 0x0080);
  if(WrongEndian) RECHeaderInfo->HeaderVersion = getWord(&Buffer[4], TRUE);

  ret = TRUE;
  switch(SystemType)
  {
    case ST_UNKNOWN:    ret = FALSE; break;
    case ST_S:          HDD_DecodeRECHeader_ST_S(Buffer, RECHeaderInfo); break;
    case ST_T:          HDD_DecodeRECHeader_ST_T(Buffer, RECHeaderInfo); break;
    case ST_C:          HDD_DecodeRECHeader_ST_C(Buffer, RECHeaderInfo); break;
    case ST_T5700:      HDD_DecodeRECHeader_ST_T5700(Buffer, RECHeaderInfo); break;
    case ST_TMSS:       HDD_DecodeRECHeader_ST_TMSS(Buffer, RECHeaderInfo); break;
    case ST_TMST:       HDD_DecodeRECHeader_ST_TMST(Buffer, RECHeaderInfo); break;
    case ST_TMSC:       HDD_DecodeRECHeader_ST_TMSC(Buffer, RECHeaderInfo); break;
    case ST_T5800:      HDD_DecodeRECHeader_ST_T5800(Buffer, RECHeaderInfo); break;
    case ST_ST:         ret = FALSE; break;
    case ST_CT:         ret = FALSE; break;
    case ST_TF7k7HDPVR: HDD_DecodeRECHeader_ST_TF7k7HDPVR(Buffer, RECHeaderInfo); break;
    case ST_NRTYPES:    ret = FALSE; break;
  }

  TRACEEXIT();
  return ret;
}
Пример #5
0
char * GetDescriptorType( PDESCRIPTOR_ENTRY p )
{
	SUBTYPE st;
	st.u.databyte = p->type;

	if(p->desc_type == 0) return GetSystemType( st );

	if(st.u.datatype.zero == 0)
	{
		// data
		return "DATA";
	}
	else /* st.u.codetype.one == 1 */
	{
		// code
		return "CODE";
	}

	return "UNKNOWN";
}
Пример #6
0
bool FlashTimeDecode(tFlashTimeInfo *Data, tFlashTimeInfo *TimeInfo)
{
  bool ret;

  TRACEENTER();

  //TimeInfo is NULL
  if(!Data || !TimeInfo)
  {
    TRACEEXIT();
    return FALSE;
  }

  ret = FALSE;
  switch(GetSystemType())
  {
    //Unknown and old 5k/6k systems are not supported
    case ST_UNKNOWN:
    case ST_S:
    case ST_ST:
    case ST_T:
    case ST_C:
    case ST_CT:
    case ST_T5700:
    case ST_T5800:
    case ST_TF7k7HDPVR: break;

    case ST_TMSS: ret = FlashTimeDecode_ST_TMSS(Data, TimeInfo); break;
    case ST_TMST: ret = FlashTimeDecode_ST_TMST(Data, TimeInfo); break;
    case ST_TMSC: ret = FlashTimeDecode_ST_TMSC(Data, TimeInfo); break;

    case ST_NRTYPES: break;
  }

  TRACEEXIT();
  return ret;
}
bool FlashSatTablesDecode(void *Data, tFlashSatTable *SatTable)
{
  bool ret;

  TRACEENTER();

  if(!Data || !SatTable)
  {
    TRACEEXIT();
    return FALSE;
  }

  ret = FALSE;
  switch(GetSystemType())
  {
    //Unknown and old 5k/6k systems are not supported
    case ST_UNKNOWN:
    case ST_S:
    case ST_ST:
    case ST_T:
    case ST_C:
    case ST_CT:
    case ST_T5700:
    case ST_T5800:
    case ST_TF7k7HDPVR: break;

    case ST_TMSS: ret = FlashSatTablesDecode_ST_TMSS(Data, SatTable); break;
    case ST_TMST: ret = FlashSatTablesDecode_ST_TMST(Data, SatTable); break;
    case ST_TMSC: ret = FlashSatTablesDecode_ST_TMSC(Data, SatTable); break;

    case ST_NRTYPES: break;
  }

  TRACEEXIT();
  return ret;
}
Пример #8
0
bool FlashServiceGetInfo(int SvcType, int SvcNum, tFlashService *Service)
{
  TRACEENTER();

  bool ret;

  //SvcType out of range
  if((SvcType < 0) || (SvcType > SVC_TYPE_Radio))
  {
    TRACEEXIT();
    return FALSE;
  }

  //SvcNum out of range
  if((SvcNum < 0) || (SvcNum >= FlashServiceGetTotal(SvcType)))
  {
    TRACEEXIT();
    return FALSE;
  }


  //Service is NULL
  if(!Service)
  {
    TRACEEXIT();
    return FALSE;
  }

  ret = FALSE;
  switch(GetSystemType())
  {
    //Unknown and old 5k/6k systems are not supported
    case ST_UNKNOWN:
    case ST_S:
    case ST_ST:
    case ST_T:
    case ST_C:
    case ST_CT:
    case ST_T5700:
    case ST_T5800:
    case ST_TF7k7HDPVR: break;

    case ST_TMSS:
    {
      TYPE_Service_TMSS    *p;

      if(SvcType == SVC_TYPE_Tv)
        p = (TYPE_Service_TMSS*)(FIS_vFlashBlockTVServices() + SvcNum * sizeof(TYPE_Service_TMSS));
      else
        p = (TYPE_Service_TMSS*)(FIS_vFlashBlockRadioServices() + SvcNum * sizeof(TYPE_Service_TMSS));
      if(p) ret = FlashServiceDecode(p, Service);
      break;
    }

    case ST_TMST:
    {
      TYPE_Service_TMST    *p;

      if(SvcType == SVC_TYPE_Tv)
        p = (TYPE_Service_TMST*)(FIS_vFlashBlockTVServices() + SvcNum * sizeof(TYPE_Service_TMST));
      else
        p = (TYPE_Service_TMST*)(FIS_vFlashBlockRadioServices() + SvcNum * sizeof(TYPE_Service_TMST));
      if(p) ret = FlashServiceDecode(p, Service);
      break;
    }

    case ST_TMSC:
    {
      TYPE_Service_TMSC    *p;

      if(SvcType == SVC_TYPE_Tv)
        p = (TYPE_Service_TMSC*)(FIS_vFlashBlockTVServices() + SvcNum * sizeof(TYPE_Service_TMSC));
      else
        p = (TYPE_Service_TMSC*)(FIS_vFlashBlockRadioServices() + SvcNum * sizeof(TYPE_Service_TMSC));
      if(p) ret = FlashServiceDecode(p, Service);
      break;
    }

    case ST_NRTYPES: break;
  }

  TRACEEXIT();
  return ret;
}
bool FlashTransponderTablesSetInfo(int SatNum, int TransponderNum, tFlashTransponderTable *TransponderTable)
{
  TRACEENTER();

  bool ret;

  //SatNum out of range
  if((SatNum < 0) || (SatNum >= FlashSatTablesGetTotal()))
  {
    TRACEEXIT();
    return FALSE;
  }

  //TransponderNum out of range
  if((TransponderNum < 0) || (TransponderNum >= FlashTransponderTablesGetTotal(SatNum)))
  {
    TRACEEXIT();
    return FALSE;
  }

  //TransponderTable is NULL
  if(!TransponderTable)
  {
    TRACEEXIT();
    return FALSE;
  }

  switch(GetSystemType())
  {
    //Unknown and old 5k/6k systems are not supported
    case ST_UNKNOWN:
    case ST_S:
    case ST_ST:
    case ST_T:
    case ST_C:
    case ST_CT:
    case ST_T5700:
    case ST_T5800:
    case ST_TF7k7HDPVR:
    {
      TRACEEXIT();
      return FALSE;
    }

    case ST_TMSS:
    {
      TYPE_TpInfo_TMSS *p;
      int               d, i, TPIdx;

      p = (TYPE_TpInfo_TMSS*)(FIS_vFlashBlockTransponderInfo());
      if(!p)
      {
        TRACEEXIT();
        return FALSE;
      }

      d = *(int*)FIS_vFlashBlockTransponderInfo();
      TPIdx = 0;
      for(i = 0; i < d; i++)
      {
        if(p->SatIdx == SatNum)
        {
          if(TPIdx == TransponderNum) break;

          TPIdx++;
        }
        p++;
      }
      if((i >= d) || (p->SatIdx != SatNum) || (TPIdx != TransponderNum))
      {
        TRACEEXIT();
        return FALSE;
      }

      ret = FlashTransponderTablesEncode(p, TransponderTable);

      TRACEEXIT();
      return ret;
    }

    case ST_TMST:
    {
      TYPE_TpInfo_TMST     *p;

      p = (TYPE_TpInfo_TMST*)FIS_vFlashBlockTransponderInfo();
      if(!p)
      {
        TRACEEXIT();
        return FALSE;
      }

      p = p + TransponderNum;
      ret = FlashTransponderTablesEncode(p, TransponderTable);;

      TRACEEXIT();
      return ret;
    }

    case ST_TMSC:
    {
      TYPE_TpInfo_TMSC     *p;

      p = (TYPE_TpInfo_TMSC*)FIS_vFlashBlockTransponderInfo();
      if(!p)
      {
        TRACEEXIT();
        return FALSE;
      }

      p = p + TransponderNum;
      ret = FlashTransponderTablesEncode(p, TransponderTable);

      TRACEEXIT();

      return ret;
    }

    case ST_NRTYPES: break;
  }

  TRACEEXIT();
  return FALSE;
}
Пример #10
0
void UserActionDlg::InitUserAction()
{
	// 不同操作系统左侧的列表不一样
	//
	if ( SYSTEM_WINDOWS == GetSystemType(m_tar->dwOsBuildNumber) )
	{
		// windows
		ui.trUserAction->takeTopLevelItem(3);

		// 审查用
		//ui.trUserAction->takeTopLevelItem(1);

	}
	else if ( SYSTEM_MACOSX == GetSystemType(this->m_tar->dwOsBuildNumber) )
	{
		// Mac
		ui.trUserAction->takeTopLevelItem(0);
		ui.trUserAction->takeTopLevelItem(1);
		ui.trUserAction->takeTopLevelItem(1);

		QTreeWidgetItem* userAction = ui.trUserAction->topLevelItem(0);
		userAction->takeChild(1);
		userAction->takeChild(1);

		// 只有键盘记录一项
		ui.stkUserAction->setCurrentIndex(1);
	}
	else if ( SYSTEM_IOS == GetSystemType(this->m_tar->dwOsBuildNumber) )
	{
		// IOS
		ui.trUserAction->takeTopLevelItem(0);
		ui.trUserAction->takeTopLevelItem(1);

		QTreeWidgetItem* userAction = ui.trUserAction->topLevelItem(0);
		userAction->takeChild(1);
		userAction->takeChild(1);

		userAction = ui.trUserAction->topLevelItem(1);
		userAction->takeChild(2);

		ui.stkUserAction->setCurrentIndex(1);
	}
	else
	{
		// Android
		ui.trUserAction->takeTopLevelItem(0);
		ui.trUserAction->takeTopLevelItem(1);

		QTreeWidgetItem* userAction = ui.trUserAction->topLevelItem(0);
		userAction->takeChild(1);
		userAction->takeChild(1);

		ui.stkUserAction->setCurrentIndex(1);
	}

	// 展开
	for (int i = 0; i < ui.trUserAction->topLevelItemCount(); i++)
	{
		ui.trUserAction->topLevelItem(i)->setExpanded(true);
	}

	InitUserActionData();
}
int LogoManager_UpdateLIL(void)
{
  TRACEENTER();

  typedef struct
  {
    ulong64             ChannelID;
    char                Name[MAXLOGONAME+1];
  }tNewIDs;

  int                   nTvSvc, nRadioSvc;
  int                   i;
  TYPE_TapChInfo        chInfo;
  char                  s[255], LogoName[MAX_SvcName + 1];
  SYSTEM_TYPE           SystemType;
  tFlashSatTable        SatInfo;

  word                  SatPos;
  ulong64               ChannelID;
  tNewIDs              *NewIDs;
  int                   NewIDCount;

  SystemType = GetSystemType();

  HDD_TAP_PushDir();
  HDD_ChangeDir(LOGOROOT);

  TAP_Channel_GetTotalNum(&nTvSvc, &nRadioSvc);
  NewIDs = TAP_MemAlloc((nTvSvc + nRadioSvc) * sizeof(tNewIDs));
  NewIDCount = 0;

  INIOpenFile(LILNAME, NULL);

  for(i = 0; i < nTvSvc; i++)
  {
    TAP_Channel_GetInfo(SVC_TYPE_Tv, i, &chInfo);
    FlashSatTablesGetInfo(chInfo.satIdx, &SatInfo);

    switch(SystemType)
    {
      case ST_S:
      case ST_TMSS:
      {
        SatPos = SatInfo.SatPosition;
        break;
      }

      default:
        SatPos = 0;
        break;
    }

    ChannelID = LogoManager_CalculateChannelID(SatPos, chInfo.orgNetId, chInfo.tsId, chInfo.svcId);
    TAP_SPrint(s, "%16.16llx", ChannelID);
    if(!INIKeyExists(s))
    {
      NewIDs[NewIDCount].ChannelID = ChannelID;
      strcpy(NewIDs[NewIDCount].Name, LogoManager_ChannelNameToLogoName(chInfo.chName, LogoName, sizeof(LogoName)));
      if(NewIDs[NewIDCount].Name[0]) NewIDCount++;
    }
  }

  for(i = 0; i < nRadioSvc; i++)
  {
    TAP_Channel_GetInfo(SVC_TYPE_Radio, i, &chInfo);
    FlashSatTablesGetInfo(chInfo.satIdx, &SatInfo);

    switch(SystemType)
    {
      case ST_S:
      case ST_TMSS:
      {
        SatPos = SatInfo.SatPosition;
        break;
      }

      default:
        SatPos = 0;
        break;
    }

    ChannelID = LogoManager_CalculateChannelID(SatPos, chInfo.orgNetId, chInfo.tsId, chInfo.svcId);
    TAP_SPrint(s, "%16.16llx", ChannelID);
    if(!INIKeyExists(s))
    {
      NewIDs[NewIDCount].ChannelID = ChannelID;
      TAP_SPrint(NewIDs[NewIDCount].Name, "r_%s", LogoManager_ChannelNameToLogoName(chInfo.chName, LogoName, sizeof(LogoName)));
      if(NewIDs[NewIDCount].Name[0]) NewIDCount++;
    }
  }

  INICloseFile();

  if(NewIDCount > 0)
  {
    TYPE_File          *f;
    word                year;
    byte                month, day, weekDay;

    if(!TAP_Hdd_Exist(LILNAME)) TAP_Hdd_Create(LILNAME, ATTR_NORMAL);
    f = TAP_Hdd_Fopen(LILNAME);

    if(!f)
    {
      HDD_TAP_PopDir();
      if(LogoManager_CB) LogoManager_CB(-1, 3);

      TRACEEXIT();
      return -1;
    }

    TAP_Hdd_Fseek(f, 0, SEEK_END);
    TAP_ExtractMjd(Now(NULL) >> 16, &year, &month, &day, &weekDay);
    TAP_SPrint(s, "\n\n# Added %4.4d-%2.2d-%2.2d\n", year, month, day);
    TAP_Hdd_Fwrite(s, 1, strlen(s), f);

    for(i = 0; i < NewIDCount; i++)
    {
      TAP_SPrint(s, "%16.16llx=%s\n", NewIDs[i].ChannelID, NewIDs[i].Name);
      TAP_Hdd_Fwrite(s, 1, strlen(s), f);
    }
    TAP_Hdd_Fclose(f);
    if(LogoManager_CB) LogoManager_CB(5, NewIDCount);

  }
bool FlashSatTablesGetInfo(int SatNum, tFlashSatTable *SatTable)
{
  TRACEENTER();

  bool ret;

  //SatNum out of range
  if((SatNum < 0) || (SatNum >= FlashSatTablesGetTotal()))
  {
    TRACEEXIT();
    return FALSE;
  }

  //SatTable is NULL
  if(!SatTable)
  {
    TRACEEXIT();
    return FALSE;
  }

  ret = FALSE;
  switch(GetSystemType())
  {
    //Unknown and old 5k/6k systems are not supported
    case ST_UNKNOWN:
    case ST_S:
    case ST_ST:
    case ST_T:
    case ST_C:
    case ST_CT:
    case ST_T5700:
    case ST_T5800:
    case ST_TF7k7HDPVR: break;

    case ST_TMSS:
    {
      TYPE_SatInfo_TMSS *p;

      p = (TYPE_SatInfo_TMSS*)FIS_vFlashBlockSatInfo();
      if(p)
      {
        p = p + SatNum;
        ret = FlashSatTablesDecode(p, SatTable);
      }
      break;
    }

    case ST_TMST:
    {
      TYPE_SatInfo_TMST *p;

      p = (TYPE_SatInfo_TMST*)FIS_vFlashBlockSatInfo();
      if(p) ret = FlashSatTablesDecode(p, SatTable);
      break;
    }

    case ST_TMSC:
    {
      TYPE_SatInfo_TMSC *p;

      p = (TYPE_SatInfo_TMSC*)FIS_vFlashBlockSatInfo();
      if(p) ret = FlashSatTablesDecode(p, SatTable);
      break;
    }

    case ST_NRTYPES: break;
  }

  TRACEEXIT();
  return ret;
}
int FlashTransponderTablesAdd(int SatNum, tFlashTransponderTable *TransponderTable)
{
  TRACEENTER();

  //SatNum out of range
  if((SatNum < 0) || (SatNum >= FlashSatTablesGetTotal()))
  {
    TRACEEXIT();
    return -1;
  }

  //TransponderTable is NULL
  if(!TransponderTable)
  {
    TRACEEXIT();
    return -1;
  }

  switch(GetSystemType())
  {
    //Unknown and old 5k/6k systems are not supported
    case ST_UNKNOWN:
    case ST_S:
    case ST_ST:
    case ST_T:
    case ST_C:
    case ST_CT:
    case ST_T5700:
    case ST_T5800:
    case ST_TF7k7HDPVR:
    {
      TRACEEXIT();
      return -1;
    }

    case ST_TMSS:
    {
      TYPE_TpInfo_TMSS       *pTransp, *pTranspEnd;
      TYPE_SatInfo_TMSS      *pSat;
      int                     i, TPIdx, NrSats;
      dword                  *NrTransponders;

      pSat = (TYPE_SatInfo_TMSS*)(FIS_vFlashBlockSatInfo());
      if(!pSat)
      {
        TRACEEXIT();
        return -1;
      }

      NrSats = FlashSatTablesGetTotal();

      pTransp = (TYPE_TpInfo_TMSS*)(FIS_vFlashBlockTransponderInfo());
      if(!pTransp)
      {
        TRACEEXIT();
        return -1;
      }

      //Find the end of the transponder list
      pTranspEnd = pTransp;
      for(i = 0; i <= NrSats; i++)
      {
        pTranspEnd += (pSat->NrOfTransponders);
        pSat++;
      }

      //Find the location where to insert the new transponder
      TPIdx = 0;
      pSat = (TYPE_SatInfo_TMSS*)(FIS_vFlashBlockSatInfo());
      for(i = 0; i <= SatNum; i++)
      {
        TPIdx += pSat->NrOfTransponders;
        pSat++;
      }
      pSat--;
      pTransp += TPIdx;

      //Create a hole for the new transponder
      while(pTranspEnd > pTransp)
      {
        memcpy(pTranspEnd, pTranspEnd - 1, sizeof(TYPE_TpInfo_TMSS));
        pTranspEnd--;
      }

      //Write the new transponder
      if(FlashTransponderTablesEncode(pTransp, TransponderTable))
      {
        //Increment the number of transponders
        NrTransponders = (dword*)(FIS_vFlashBlockTransponderInfo() - 4);
        *NrTransponders = *NrTransponders + 1;
        pSat->NrOfTransponders++;

        TRACEEXIT();
        return pSat->NrOfTransponders - 1;
      }

      TRACEEXIT();
      return -1;
    }

    case ST_TMST:
    {
      TYPE_TpInfo_TMST       *pTransp;
      TYPE_SatInfo_TMST      *pSat;
      dword                  *NrTransponders;

      pSat = (TYPE_SatInfo_TMST*)(FIS_vFlashBlockSatInfo());
      if(!pSat)
      {
        TRACEEXIT();
        return -1;
      }

      pTransp = (TYPE_TpInfo_TMST*)(FIS_vFlashBlockTransponderInfo());
      if(!pTransp)
      {
        TRACEEXIT();
        return -1;
      }

      //Find the location where to insert the new transponder
      pTransp += pSat->NrOfTransponders;

      //Write the new transponder
      if(FlashTransponderTablesEncode(pTransp, TransponderTable))
      {
        //Increment number of transponders
        NrTransponders = (dword*)(FIS_vFlashBlockTransponderInfo() - 4);
        *NrTransponders = *NrTransponders + 1;
        pSat->NrOfTransponders++;

        TRACEEXIT();
        return pSat->NrOfTransponders - 1;
      }

      TRACEEXIT();
      return -1;
    }

    case ST_TMSC:
    {
      TYPE_TpInfo_TMSC       *pTransp;
      TYPE_SatInfo_TMSC      *pSat;
      dword                  *NrTransponders;

      pSat = (TYPE_SatInfo_TMSC*)(FIS_vFlashBlockSatInfo());
      if(!pSat)
      {
        TRACEEXIT();
        return -1;
      }

      pTransp = (TYPE_TpInfo_TMSC*)(FIS_vFlashBlockTransponderInfo());
      if(!pTransp)
      {
        TRACEEXIT();
        return -1;
      }

      //Find the location where to insert the new transponder
      pTransp += pSat->NrOfTransponders;

      //Write the new transponder
      if(FlashTransponderTablesEncode(pTransp, TransponderTable))
      {
        //Increment number of transponders
        NrTransponders = (dword*)(FIS_vFlashBlockTransponderInfo() - 4);
        *NrTransponders = *NrTransponders + 1;
        pSat->NrOfTransponders++;

        TRACEEXIT();
        return pSat->NrOfTransponders - 1;
      }

      TRACEEXIT();
      return -1;
    }

    case ST_NRTYPES: break;
  }

  TRACEEXIT();
  return -1;
}