Exemplo n.º 1
0
        private void AutoInfoService()
        {
            try
            {
                List<string> InfoPlaySetting = FetchData.GetInstance().GetInfoPlaySetting();
                foreach (string strInfo in InfoPlaySetting)
                {
                    string[] aryInfo = strInfo.Split('|');
                    string strGpsCode = aryInfo[0];
                    MediaInfoSetItem item1 = new MediaInfoSetItem();
                    item1.InfoType = byte.Parse(aryInfo[1]);
                    item1.Info = "自动发送信息点播" + aryInfo[1];

                    AddSerialNum(strGpsCode);
                    GPSGatewayServer.DataModel.BuBiaoData.GPRSFrame BuBiaoSendMsg = new GPSGatewayServer.DataModel.BuBiaoData.GPRSFrame(BuBiaoMsgIdType.MediaInfoService, false, EncryptType.NoEncrypt
                        , (ushort)item1.dataBuffer.Length, strGpsCode
                        , GetSerialNum(strGpsCode), 0, 0, item1.dataBuffer);

                    Socket socket = TCPConnList.Instance().GetTCPConnection(strGpsCode);
                    if (socket == null)
                    {
                        Logger.Trace("[部标:下发信息点播] socket == null");
                        continue;
                    }
                    if (socket.Connected == false)
                    {
                        Logger.Trace("[部标:下发信息点播] Connected == false");
                        continue;
                    }

                    int send = socket.Send(BuBiaoSendMsg.WriteBuffer());
                    Logger.Trace("[部标:下发信息点播]" + strGpsCode + " " + aryInfo[1]);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Exemplo n.º 2
0
        public void AddSetItem(MediaInfoSetItem item)
        {
            if (_Items == null)
                _Items = new List<MediaInfoSetItem>();
            _Items.Add(item);

            InfoCount = (byte)_Items.Count;
        }