miscellaneous bits and bobs ;)
tho [Fri, 7 Mar 2008 12:07:59 +0000 (12:07 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@734 270642c3-0616-0410-b53a-bc976706d245

Examples/DVBAdapter/ULEdec.cc
Examples/Sniffer/SConscript
Packets/MPEGDVBBundle/TransportPacket.hh
Packets/MPEGDVBBundle/TransportPacket.test.cc
Socket/Protocols/DVB/DVBDemuxSocketProtocol.hh
Socket/Protocols/UN/ConnectedUNDatagramSocketHandle.cc
Utils/Logger/IOStreamTarget.cc

index f70b49f..8fc629d 100644 (file)
@@ -67,7 +67,7 @@ void ULEdec::handleEvent(senf::Scheduler::EventId event)
     dvrHandle.read( ts_packet.data() );
     
     // Check TS error conditions: sync_byte, transport_error_indicator, scrambling_control.
-    if ( (ts_packet->sync_byte() != TRANSPORT_PACKET_SYNC_BYTE) ||
+    if ( (ts_packet->sync_byte() != senf::TransportPacketType::SYNC_BYTE) ||
          (ts_packet->transport_error_indicator() == true) ||
          (ts_packet->transport_scrmbl_ctrl() != 0))
     {
index 250abc6..ecf3cad 100644 (file)
@@ -3,9 +3,8 @@ import SENFSCons
 
 ###########################################################################
 
-SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(),
-                 LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ],
-                 OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o',
-                             '#/Packets/MPEGDVBBundle/MPEGDVBBundle.o' ])
+SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(), LIBS = [
+     'Packets_DefaultBundle', 'Packets_MPEGDVBBundle', 
+     'Scheduler', 'Packets', 'Socket', 'Utils' ])
 
 SENFSCons.Doxygen(env)
index 36fd10f..ab9d495 100644 (file)
@@ -119,13 +119,11 @@ namespace senf {
         using mixin::initSize;
         
         static void dump(packet p, std::ostream & os);
+        static const byte SYNC_BYTE = 0x47;
     };
     
     /** \brief Transport packet typedef */
-    typedef TransportPacketType::packet TransportPacket;
-    
-    #define TRANSPORT_PACKET_SYNC_BYTE 0x47
-  
+    typedef ConcretePacket<TransportPacketType> TransportPacket;
 }
 
 
index 9aa131f..fc843de 100644 (file)
@@ -69,14 +69,14 @@ BOOST_AUTO_UNIT_TEST(transportPacket_packet)
             
     senf::TransportPacket p (senf::TransportPacket::create(data));
 
-    BOOST_CHECK_EQUAL(   p->sync_byte(),                TRANSPORT_PACKET_SYNC_BYTE );
-    BOOST_CHECK(       ! p->transport_error_indicator()                            );
-    BOOST_CHECK(         p->pusi()                                                 );
-    BOOST_CHECK(       ! p->transport_priority()                                   );
-    BOOST_CHECK_EQUAL(   p->pid(),                      0x010fu                    );  
-    BOOST_CHECK_EQUAL(   p->transport_scrmbl_ctrl(),    0x0u                       );             
-    BOOST_CHECK_EQUAL(   p->adaptation_field_ctrl(),    0x1u                       );
-    BOOST_CHECK_EQUAL(   p->continuity_counter(),       0x0eu                      );  
+    BOOST_CHECK_EQUAL(   p->sync_byte(),                TransportPacketType::SYNC_BYTE );
+    BOOST_CHECK(       ! p->transport_error_indicator()                                );
+    BOOST_CHECK(         p->pusi()                                                     );
+    BOOST_CHECK(       ! p->transport_priority()                                       );
+    BOOST_CHECK_EQUAL(   p->pid(),                      0x010fu                        );  
+    BOOST_CHECK_EQUAL(   p->transport_scrmbl_ctrl(),    0x0u                           );             
+    BOOST_CHECK_EQUAL(   p->adaptation_field_ctrl(),    0x1u                           );
+    BOOST_CHECK_EQUAL(   p->continuity_counter(),       0x0eu                          );  
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////
index e5963e9..7545022 100644 (file)
@@ -39,14 +39,18 @@ namespace senf {
     /// \addtogroup protocol_facets_group
     /// @{
 
-    /** xxx
+    /** \todo Document me!
      */
     class DVBDemuxSocketProtocol
         : public virtual SocketProtocol
     {
     public:
-        void setBufferSize(unsigned long size) const;
-        
+        void setBufferSize(unsigned long size) const; 
+                                ///< set the size of the circular buffer used for filtered data.
+                                /**< The default size is two maximum sized sections, i.e. if this
+                                     function is not called a buffer size of 2 * 4096 bytes will
+                                     be used.
+                                     \param[in] size Size of circular buffer. */
         void startFiltering() const;
         void stopFiltering() const;
         
index 2a9a4db..21e7ddc 100644 (file)
 
 prefix_ void senf::ConnectedUNDatagramSocketProtocol::init_client() const
 {
-    int sock = ::socket(PF_UNIX,SOCK_DGRAM,0);
+    int sock = ::socket(PF_UNIX, SOCK_DGRAM, 0);
     if (sock < 0)
         throw SystemException( "Could not create socket(PF_UNIX,SOCK_DGRAM,0)." );
-   fd(sock);
+    fd(sock);
 }
 
 prefix_ void senf::ConnectedUNDatagramSocketProtocol::init_client(UNSocketAddress const & address) const 
index 6d720b5..dbf4454 100644 (file)
@@ -71,9 +71,9 @@ prefix_ void senf::log::IOStreamTarget::v_write(boost::posix_time::ptime timesta
 
     for (; i != i_end; ++i) {
         stream_ << timestamp << sep;
+        stream_ << "[" << LEVELNAMES_[level] << "]";
         if (area != "senf::log::DefaultArea")
-            stream_ << "[" << area << "]";
-        stream_ << "[" << LEVELNAMES_[level] << "] ";
+            stream_ << "[" << area << "] ";
         stream_ << *i << "\n";
         sep = '-';
     }