• 赞助网站
  • 您的位置:  首页 >> 技术交流区 >> DVB机顶盒 >> 卫星控制序列代码片断:
    卫星控制序列代码片断:
    2010年04月03日 点击: 编辑: klklfhy
    发一段整个互联网没有的!卫星控制序列代码片断:
        # procedure to translate a file
      # tcfile = name of TC file to translate
      # tctype = TranslateBinaryOnly | TranslateGroupOnly
      # returns 1 if successful 2 for Failure, otherwise 0
      proc translateCommand { tcfile tctype } {
        set rc 0
        # Translate the file
        set tid [jtcc tc translate $tcfile $tctype]
        if {$tid != "" & $tid != "0"} {
            # Loop for up to 15 seconds waiting for a connection
            for {set count 0} {$count < 15} {set count [expr $count + 1]} {
              set tcstatus [lindex [jtcc tc xlatstatus $tid] 0]
              if {$tcstatus == "Success"} {
                set rc 1
                break;
              } else {
                if {$tcstatus == "Failure"} {
                    logMsg -e "Failed to translate $tcfile ($tctyoe)"
                    set rc 2
                    break;
                }
              }
              jtcc wait 1000
            }
        }
        return $rc
      }
    赞助网站 | 关于我们 | 版权声明 | 站点导航 | 收藏本站 | 设为首页