//   LiveView Request
        public void SendLiveViewRequest(string channel, string pw)
        {
            //     if (m_STATE != STATE.CONNECTED) return;

            RCS_Protocol.RCS_Protocol.LIVE_VIEW_HEADER header = new RCS_Protocol.RCS_Protocol.LIVE_VIEW_HEADER();
            header.cameraName = channel;
            header.timeStamp = " ";
            string jpegInfo = m_RCSProtocol.BuildInfoString(header);
            byte[] pkt = m_RCSProtocol.CreatePacket(null, RCS_Protocol.RCS_Protocol.PACKET_TYPES.REQUEST_LIVE_VIEW, pw, jpegInfo);

            m_SendPacketRequests.AddRequest(pkt);
        }
Exemple #2
0
            public void SendJpeg(byte[] jpeg, string channel, string timeStamp, string plateNumber)
            {
                try
                {
                    RCS_Protocol.RCS_Protocol.LIVE_VIEW_HEADER header =new RCS_Protocol.RCS_Protocol.LIVE_VIEW_HEADER();
                    header.cameraName = channel;
                    header.timeStamp = timeStamp;
                    header.plateNumber = plateNumber;
                    string jpegInfo = protocol.BuildInfoString(header);
                    byte[] packet = protocol.CreatePacket(RCS_Protocol.RCS_Protocol.PACKET_TYPES.SEND_LIVE_VIEW, jpeg, jpegInfo);

                   //     Console.WriteLine("writing " + packet.Length.ToString() + " bytes to socket, packet number: " + mPacketCount.ToString());

                    writer.Write(packet, 0, packet.Length);

                    mPacketCount++;
                }
                catch (Exception ex)
                {
                    writer.Close();
                    reader.Close();
                    socketStream.Close();
                    connection.Close();
                    ConnectionClosed(this);
                    m_Log.Trace(ex, ErrorLog.LOG_TYPE.INFORMATIONAL);
                }
            }