Beispiel #1
0
            private void Run()
            {
                OdmSession odmSess = new OdmSession(session);

                disposables.Add(odmSess.GetPullPointEvents()
                                .Subscribe(
                                    evnt => {
                    //Parse onvif event here
                    Console.WriteLine(EventParse.ParseTopic(evnt.topic));
                    var messages = EventParse.ParseMessage(evnt.message);
                    messages.ForEach(msg => Console.WriteLine(msg));
                    Console.WriteLine("----------------------------------------");
                    Console.WriteLine();
                    Console.WriteLine();
                }, err => {
                    Console.WriteLine(err.Message);
                }
                                    ));
            }
Beispiel #2
0
    public void GenerateBaseEvent()
    {
        // for this device must be discoverable and and its account and uri must be known
        var        sessionFactory = new NvtSessionFactory(deviceparam.Account); // deviceparam is camera and account contaion its username and password
        var        sess           = sessionFactory.CreateSession(uri);
        OdmSession os             = new OdmSession(sess);

        os.GetBaseEvents(9865)    // some random port number
        .Subscribe(
            evnt =>
        {
            Console.WriteLine(EventParse.ParseTopic(evnt.topic));
            var messages = EventParse.ParseMessage(evnt.message);
            messages.ForEach(msg => Console.WriteLine(msg));
        }, err =>
        {
            Console.WriteLine(err.Message);
        }
            );
    }