[prev in list] [next in list] [prev in thread] [next in thread]
List: freebob-cvs
Subject: [Freebob-cvs] libfreebob/src/libfreebobavc serialize.h,1.1.1.1,1.2 serialize.cpp,1.1.1.1,1.2 ieee139
From: Daniel Wagner <wagi () users ! sourceforge ! net>
Date: 2006-03-29 22:57:54
Message-ID: E1FOjbv-0002HY-Iq () mail ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/freebob/libfreebob/src/libfreebobavc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4988/src/libfreebobavc
Modified Files:
serialize.h serialize.cpp ieee1394service.h
ieee1394service.cpp avc_unit_info.h avc_unit_info.cpp
avc_subunit_info.h avc_subunit_info.cpp avc_signal_source.h
avc_signal_source.cpp avc_plug_info.h avc_plug_info.cpp
avc_generic.h avc_generic.cpp avc_extended_subunit_info.h
avc_extended_subunit_info.cpp avc_extended_stream_format.h
avc_extended_stream_format.cpp avc_extended_plug_info.h
avc_extended_plug_info.cpp avc_definitions.h avc_connect.h
avc_connect.cpp
Log Message:
2006-03-30 Daniel Wagner <wagi@monom.org>
* configure.ac: Version bump to 0.6.0
* src/*: Verbose bool turned int verbose level.
* src/libfreebobavc/*: Moved fire implementation to
base class (AVCCommand).
* libfreebob/freebob.h: freebob_sleep_after_avc_command
workaround added.
* tests/test-freebob.c: Verbose bool turned into verbose level.
Workaround: sleep after avc command added.
* tests/streaming/Makefile.am (*_SOURCES): Added libavc1394 to LDADD.
* tests/Makefile.am (*_SOURCES): Likewise.
* tests/streaming/teststreaming2.c (fid_in): compiler warning fixed.
Index: avc_plug_info.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_plug_info.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** avc_plug_info.cpp 28 Feb 2006 23:29:09 -0000 1.4
--- avc_plug_info.cpp 29 Mar 2006 22:57:51 -0000 1.5
***************
*** 134,226 ****
bool
- PlugInfoCmd::fire()
- {
- bool result = false;
-
- #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length
- union UPacket {
- quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];
- unsigned char byte[STREAM_FORMAT_REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "PlugInfoCmd::fire: Could not serialize\n" );
- return false;
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
-
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- STREAM_FORMAT_REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- }
- break;
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
-
- bool
PlugInfoCmd::setSubFunction( ESubFunction subFunction )
{
--- 134,137 ----
Index: avc_generic.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_generic.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** avc_generic.h 26 Dec 2005 15:49:31 -0000 1.1.1.1
--- avc_generic.h 29 Mar 2006 22:57:51 -0000 1.2
***************
*** 32,35 ****
--- 32,38 ----
class Ieee1394Service;
+ const int fcpFrameMaxLength = 512;
+ typedef unsigned char fcp_frame_t[fcpFrameMaxLength];
+
class IBusData {
public:
***************
*** 89,93 ****
virtual bool setCommandType( ECommandType commandType );
! virtual bool fire() = 0;
EResponse getResponse();
--- 92,96 ----
virtual bool setCommandType( ECommandType commandType );
! virtual bool fire();
EResponse getResponse();
***************
*** 100,106 ****
subunit_id_t getSubunitId();
! bool setVerbose( bool enable );
! bool isVerbose();
protected:
--- 103,116 ----
subunit_id_t getSubunitId();
! bool setVerbose( int verboseLevel );
! int getVerboseLevel();
!
! virtual const char* getCmdName() const = 0;
+ // workaround
+ static void setSleepAfterAVCCommand( int time );
+ protected:
+ void showFcpFrame( const unsigned char* buf,
+ unsigned short frameSize ) const;
protected:
***************
*** 108,112 ****
virtual ~AVCCommand() {}
- bool parseResponse( byte_t response );
ECommandType getCommandType();
--- 118,121 ----
***************
*** 114,117 ****
--- 123,128 ----
fb_nodeid_t m_nodeId;
+ fcp_frame_t m_fcpFrame;
+
private:
ctype_t m_ctype;
***************
*** 119,124 ****
opcode_t m_opcode;
EResponse m_eResponse;
! bool m_verbose;
ECommandType m_commandType;
};
--- 130,136 ----
opcode_t m_opcode;
EResponse m_eResponse;
! int m_verboseLevel;
ECommandType m_commandType;
+ static int m_time;
};
Index: ieee1394service.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/ieee1394service.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ieee1394service.cpp 12 Mar 2006 19:20:30 -0000 1.3
--- ieee1394service.cpp 29 Mar 2006 22:57:51 -0000 1.4
***************
*** 23,26 ****
--- 23,27 ----
#include <errno.h>
+ #include <netinet/in.h>
#include <iostream>
***************
*** 85,88 ****
int len )
{
! return avc1394_transaction_block( m_handle, nodeId, buf, len, 10 );
}
--- 86,108 ----
int len )
{
! for (int i = 0; i < len; ++i) {
! buf[i] = ntohl( buf[i] );
! }
!
! fb_quadlet_t* result =
! avc1394_transaction_block( m_handle, nodeId, buf, len, 10 );
!
! for ( int i = 0; i < 512/4; ++i ) { //XXX
! result[i] = htonl( result[i] );
! }
!
! return result;
! }
!
!
! bool
! Ieee1394Service::transactionBlockClose()
! {
! avc1394_transaction_block_close( m_handle );
! return true;
}
Index: avc_generic.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_generic.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** avc_generic.cpp 9 Mar 2006 23:35:46 -0000 1.2
--- avc_generic.cpp 29 Mar 2006 22:57:51 -0000 1.3
***************
*** 23,26 ****
--- 23,32 ----
#include "ieee1394service.h"
+ #include <netinet/in.h>
+
+ #define DEBUG_EXTRA_VERBOSE 2
+
+ int AVCCommand::m_time = 0;
+
AVCCommand::AVCCommand( Ieee1394Service* ieee1394service,
opcode_t opcode )
***************
*** 31,35 ****
, m_opcode( opcode )
, m_eResponse( eR_Unknown )
! , m_verbose( false )
{
}
--- 37,41 ----
, m_opcode( opcode )
, m_eResponse( eR_Unknown )
! , m_verboseLevel( 0 )
{
}
***************
*** 74,84 ****
bool
- AVCCommand::parseResponse( byte_t response )
- {
- m_eResponse = static_cast<EResponse>( response );
- return true;
- }
-
- bool
AVCCommand::setSubunitType(ESubunitType subunitType)
{
--- 80,83 ----
***************
*** 116,131 ****
bool
! AVCCommand::setVerbose( bool enable )
{
! m_verbose = enable;
return true;
}
bool
! AVCCommand::isVerbose()
{
! return m_verbose;
}
const char* subunitTypeStrings[] =
--- 115,220 ----
bool
! AVCCommand::setVerbose( int verboseLevel )
{
! m_verboseLevel = verboseLevel;
return true;
}
+ int
+ AVCCommand::getVerboseLevel()
+ {
+ return m_verboseLevel;
+ }
+
+
+ void
+ AVCCommand::showFcpFrame( const unsigned char* buf,
+ unsigned short frameSize ) const
+ {
+ for ( int i = 0; i < frameSize; ++i ) {
+ if ( ( i % 16 ) == 0 ) {
+ if ( i > 0 ) {
+ printf( "\n" );
+ }
+ printf( " %3d:\t", i );
+ } else if ( ( i % 4 ) == 0 ) {
+ printf( " " );
+ }
+ printf( "%02x ", buf[i] );
+ }
+ printf( "\n" );
+ }
+
bool
! AVCCommand::fire()
{
! memset( &m_fcpFrame, 0x0, sizeof( m_fcpFrame ) );
!
! BufferSerialize se( m_fcpFrame, sizeof( m_fcpFrame ) );
! if ( !serialize( se ) ) {
! printf( "ExtendedPlugInfoCmd::fire: Could not serialize\n" );
! return false;
! }
!
! unsigned short fcpFrameSize = se.getNrOfProducesBytes();
!
! if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE ) {
! printf( "%s:\n", getCmdName() );
! puts( " Request:");
! showFcpFrame( m_fcpFrame, fcpFrameSize );
!
! CoutSerializer se;
! serialize( se );
! }
!
! quadlet_t* resp = m_1394Service->transactionBlock( m_nodeId,
! (quadlet_t*)m_fcpFrame,
! ( fcpFrameSize + 3 ) / 4 );
! bool result = false;
! if ( resp ) {
! unsigned char* buf = ( unsigned char* ) resp;
!
! m_eResponse = ( EResponse )( *buf );
! switch ( m_eResponse )
! {
! case eR_Implemented:
! case eR_Rejected:
! case eR_NotImplemented:
! {
! BufferDeserialize de( buf, 512 ); // XXX magic number
! result = deserialize( de );
!
! if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE) {
! puts(" Response:");
! showFcpFrame( buf, de.getNrOfConsumedBytes() );
!
! CoutSerializer se;
! serialize( se );
! }
! }
! break;
! default:
! printf( "unexpected response received (0x%x)\n", m_eResponse );
! }
! } else {
! printf( "no response\n" );
! }
!
! if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE ) {
! printf( "\n" );
! }
!
! m_1394Service->transactionBlockClose();
!
! usleep( m_time );
!
! return result;
}
+ void
+ AVCCommand::setSleepAfterAVCCommand( int time )
+ {
+ m_time = time;
+ }
const char* subunitTypeStrings[] =
Index: avc_extended_subunit_info.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_extended_subunit_info.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** avc_extended_subunit_info.h 9 Mar 2006 23:35:46 -0000 1.1
--- avc_extended_subunit_info.h 29 Mar 2006 22:57:51 -0000 1.2
***************
*** 93,97 ****
virtual bool deserialize( IISDeserialize& de );
! virtual bool fire();
page_t m_page;
--- 93,98 ----
virtual bool deserialize( IISDeserialize& de );
! virtual const char* getCmdName() const
! { return "ExtendedSubunitInfoCmd"; }
page_t m_page;
Index: serialize.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/serialize.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** serialize.h 26 Dec 2005 15:49:40 -0000 1.1.1.1
--- serialize.h 29 Mar 2006 22:57:50 -0000 1.2
***************
*** 42,45 ****
--- 42,46 ----
virtual bool read( byte_t* value ) = 0;
virtual bool read( quadlet_t* value ) = 0;
+ virtual bool read( char** value, size_t length ) = 0;
virtual bool peek( byte_t* value ) = 0;
};
***************
*** 51,54 ****
--- 52,56 ----
CoutSerializer()
: IOSSerialize()
+ , m_cnt( 0 )
{}
virtual ~CoutSerializer() {}
***************
*** 56,59 ****
--- 58,65 ----
virtual bool write( byte_t value, const char* name = "" );
virtual bool write( quadlet_t value, const char* name = "" );
+
+ private:
+ unsigned int m_cnt;
+
};
***************
*** 71,74 ****
--- 77,83 ----
virtual bool write( quadlet_t value, const char* name = "" );
+ int getNrOfProducesBytes() const
+ { return m_curPos - m_buffer; }
+
protected:
inline bool isCurPosValid() const;
***************
*** 92,97 ****
--- 101,110 ----
virtual bool read( byte_t* value );
virtual bool read( quadlet_t* value );
+ virtual bool read( char** value, size_t length );
virtual bool peek( byte_t* value );
+ int getNrOfConsumedBytes() const
+ { return m_curPos - m_buffer; }
+
protected:
inline bool isCurPosValid() const;
***************
*** 100,104 ****
unsigned char* m_buffer; // start of the buffer
unsigned char* m_curPos; // current read pos
! size_t m_length; // length of buffer
};
--- 113,117 ----
unsigned char* m_buffer; // start of the buffer
unsigned char* m_curPos; // current read pos
! size_t m_length; // size of buffer
};
Index: serialize.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/serialize.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** serialize.cpp 26 Dec 2005 15:49:40 -0000 1.1.1.1
--- serialize.cpp 29 Mar 2006 22:57:51 -0000 1.2
***************
*** 24,33 ****
#include <iomanip>
! using namespace std;
bool
CoutSerializer::write( byte_t d, const char* name )
{
! cout << name << ": 0x" << setfill( '0' ) << hex << static_cast<unsigned int>( d ) << endl;
return true;
}
--- 24,35 ----
#include <iomanip>
! #include <netinet/in.h>
bool
CoutSerializer::write( byte_t d, const char* name )
{
! printf( " %3d:\t0x%02x\t%s\n", m_cnt, d, name );
! m_cnt += sizeof( byte_t );
!
return true;
}
***************
*** 36,40 ****
CoutSerializer::write( quadlet_t d, const char* name )
{
! cout << name << ": 0x" << setfill( '0' ) << setw( 8 ) << hex << d << endl;
return true;
}
--- 38,43 ----
CoutSerializer::write( quadlet_t d, const char* name )
{
! printf( " %3d:\t0x%08x\t%s\n", m_cnt, d, name );
! m_cnt += sizeof( quadlet_t );
return true;
}
***************
*** 96,100 ****
*value = *m_curPos;
m_curPos += sizeof( quadlet_t );
! result = true;;
}
return result;
--- 99,115 ----
*value = *m_curPos;
m_curPos += sizeof( quadlet_t );
! result = true;
! }
! return result;
! }
!
! bool
! BufferDeserialize::read( char** value, size_t length )
! {
! bool result = false;
! if ( isCurPosValid() ) {
! *value = ( char* )m_curPos;
! m_curPos += length;
! result = true;
}
return result;
Index: avc_subunit_info.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_subunit_info.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** avc_subunit_info.cpp 28 Feb 2006 23:29:09 -0000 1.2
--- avc_subunit_info.cpp 29 Mar 2006 22:57:51 -0000 1.3
***************
*** 93,186 ****
return true;
}
-
- bool
- SubUnitInfoCmd::fire()
- {
- bool result = false;
-
- #define REQUEST_SIZE 2
- union UPacket {
- quadlet_t quadlet[REQUEST_SIZE];
- unsigned char byte[REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "UnitInoCmd::fire: Could not serialize\n" );
- return false;
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
-
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- }
- break;
- case eR_NotImplemented:
- break;
-
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
--- 93,94 ----
Index: avc_extended_plug_info.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_extended_plug_info.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** avc_extended_plug_info.h 21 Feb 2006 23:42:19 -0000 1.2
--- avc_extended_plug_info.h 29 Mar 2006 22:57:52 -0000 1.3
***************
*** 261,265 ****
virtual ExtendedPlugInfoInfoType* clone() const;
- typedef byte_t info_type_t;
info_type_t m_infoType;
--- 261,264 ----
***************
*** 274,277 ****
--- 273,278 ----
};
+ const char* extendedPlugInfoInfoTypeToString( info_type_t infoType );
+
/////////////////////////////////////////////////////////
***************
*** 296,301 ****
virtual bool deserialize( IISDeserialize& de );
- virtual bool fire();
-
bool setPlugAddress( const PlugAddress& plugAddress );
bool setSubFunction( ESubFunction subFunction );
--- 297,300 ----
***************
*** 304,307 ****
--- 303,309 ----
{ return m_infoType; }
+ virtual const char* getCmdName() const
+ { return "ExtendedPlugInfoCmd"; }
+
protected:
subfunction_t m_subFunction;
Index: avc_extended_plug_info.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_extended_plug_info.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** avc_extended_plug_info.cpp 14 Mar 2006 23:12:06 -0000 1.8
--- avc_extended_plug_info.cpp 29 Mar 2006 22:57:52 -0000 1.9
***************
*** 113,125 ****
de.read( &length );
m_name.clear();
! for ( int i = 0; i < length; ++length ) {
! byte_t c;
! de.read( &c );
! // \todo do correct encoding
! if ( c == '&' ) {
! c = '+';
! }
! m_name += c;
! }
return true;
}
--- 113,120 ----
de.read( &length );
m_name.clear();
! char* name;
! de.read( &name, length );
! m_name = name;
!
return true;
}
***************
*** 500,504 ****
const char* extendedPlugInfoClusterInfoPortTypeToString( port_type_t portType )
{
! if ( portType > sizeof( extendedPlugInfoPortTypeStrings ) ) {
return "Unknown";
} else {
--- 495,500 ----
const char* extendedPlugInfoClusterInfoPortTypeToString( port_type_t portType )
{
! if ( portType > ( ( sizeof( extendedPlugInfoPortTypeStrings ) )
! / ( sizeof( extendedPlugInfoPortTypeStrings[0] ) ) ) ) {
return "Unknown";
} else {
***************
*** 624,628 ****
ExtendedPlugInfoInfoType::serialize( IOSSerialize& se )
{
! se.write( m_infoType, "ExtendedPlugInfoInfoType infoType" );
switch ( m_infoType ) {
--- 620,628 ----
ExtendedPlugInfoInfoType::serialize( IOSSerialize& se )
{
! // XXX \todo improve IOSSerialize::write interface
! char* buf;
! asprintf( &buf, "ExtendedPlugInfoInfoType infoType (%s)",
! extendedPlugInfoInfoTypeToString( m_infoType ) );
! se.write( m_infoType, buf );
switch ( m_infoType ) {
***************
*** 749,752 ****
--- 749,775 ----
}
+ const char* extendedPlugInfoInfoTypeStrings[] =
+ {
+ "PlugType",
+ "PlugName",
+ "NoOfChannels",
+ "ChannelPosition",
+ "ChannelName",
+ "PlugInput",
+ "PlugOutput",
+ "ClusterInfo",
+ };
+
+ const char* extendedPlugInfoInfoTypeToString( info_type_t infoType )
+ {
+ if ( infoType > ( ( sizeof( extendedPlugInfoInfoTypeStrings ) )
+ / ( sizeof( extendedPlugInfoInfoTypeStrings[0] ) ) ) ) {
+ return "Unknown";
+ } else {
+ return extendedPlugInfoInfoTypeStrings[infoType];
+ }
+ }
+
+
//////////////////////////////////////////////
***************
*** 806,913 ****
bool
- ExtendedPlugInfoCmd::fire()
- {
- bool result = false;
-
- #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length
- union UPacket {
- quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];
- unsigned char byte[STREAM_FORMAT_REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "ExtendedPlugInfoCmd::fire: Could not serialize\n" );
- return false;
- }
-
- if ( isVerbose() ) {
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, req.byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, req.byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, req.byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, req.byte[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
-
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- STREAM_FORMAT_REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- case eR_Rejected:
- case eR_NotImplemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- }
- break;
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
-
- bool
ExtendedPlugInfoCmd::setPlugAddress( const PlugAddress& plugAddress )
{
--- 829,832 ----
Index: avc_extended_subunit_info.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_extended_subunit_info.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** avc_extended_subunit_info.cpp 9 Mar 2006 23:35:46 -0000 1.1
--- avc_extended_subunit_info.cpp 29 Mar 2006 22:57:51 -0000 1.2
***************
*** 153,262 ****
return status;
}
-
- bool
- ExtendedSubunitInfoCmd::fire()
- {
- bool result = false;
-
- #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length
- union UPacket {
- quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];
- unsigned char byte[STREAM_FORMAT_REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "ExtendedSubunitInfoCmd::fire: Could not serialize\n" );
- return false;
- }
-
- if ( isVerbose() ) {
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, req.byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, req.byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, req.byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, req.byte[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
-
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- STREAM_FORMAT_REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- break;
- }
- case eR_NotImplemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- }
- break;
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
--- 153,154 ----
Index: avc_extended_stream_format.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_extended_stream_format.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** avc_extended_stream_format.cpp 28 Feb 2006 23:29:09 -0000 1.5
--- avc_extended_stream_format.cpp 29 Mar 2006 22:57:52 -0000 1.6
***************
*** 360,461 ****
}
- bool
- ExtendedStreamFormatCmd::fire()
- {
- bool result = false;
-
- #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length
- union UPacket {
- quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];
- unsigned char byte[STREAM_FORMAT_REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "ExtendedStreamFormatCmd::fire: Could not serialize\n" );
- return false;
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- STREAM_FORMAT_REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- }
- break;
- case eR_Rejected:
- if ( m_subFunction == eSF_ExtendedStreamFormatInformationCommandList ) {
- if ( isVerbose() ) {
- printf( "no futher stream formats defined\n" );
- }
- result = true;
- } else {
- printf( "request rejected\n" );
- }
- break;
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
-
ExtendedStreamFormatCmd::EStatus
ExtendedStreamFormatCmd::getStatus()
--- 360,363 ----
Index: ieee1394service.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/ieee1394service.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ieee1394service.h 19 Jan 2006 00:21:39 -0000 1.2
--- ieee1394service.h 29 Mar 2006 22:57:51 -0000 1.3
***************
*** 84,89 ****
int len );
!
!
private:
--- 84,88 ----
int len );
! bool transactionBlockClose();
private:
Index: avc_definitions.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_definitions.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** avc_definitions.h 9 Mar 2006 23:35:46 -0000 1.4
--- avc_definitions.h 29 Mar 2006 22:57:52 -0000 1.5
***************
*** 64,67 ****
--- 64,68 ----
typedef byte_t no_of_input_plugs_t;
typedef byte_t no_of_output_plugs_t;
+ typedef byte_t info_type_t;
typedef quadlet_t company_id_t;
Index: avc_plug_info.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_plug_info.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** avc_plug_info.h 21 Feb 2006 23:42:19 -0000 1.2
--- avc_plug_info.h 29 Mar 2006 22:57:51 -0000 1.3
***************
*** 50,55 ****
virtual bool deserialize( IISDeserialize& de );
! virtual bool fire();
!
nr_of_plugs_t m_serialBusIsochronousInputPlugs;
--- 50,55 ----
virtual bool deserialize( IISDeserialize& de );
! virtual const char* getCmdName() const
! { return "PlugInfoCmd"; }
nr_of_plugs_t m_serialBusIsochronousInputPlugs;
Index: avc_unit_info.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_unit_info.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** avc_unit_info.h 26 Dec 2005 15:49:37 -0000 1.1.1.1
--- avc_unit_info.h 29 Mar 2006 22:57:51 -0000 1.2
***************
*** 55,60 ****
virtual bool deserialize( IISDeserialize& de );
! virtual bool fire();
!
reserved_t m_reserved;
--- 55,60 ----
virtual bool deserialize( IISDeserialize& de );
! virtual const char* getCmdName() const
! { return "UnitInfoCmd"; }
reserved_t m_reserved;
Index: avc_signal_source.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_signal_source.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** avc_signal_source.h 28 Feb 2006 23:29:09 -0000 1.2
--- avc_signal_source.h 29 Mar 2006 22:57:51 -0000 1.3
***************
*** 72,76 ****
virtual bool deserialize( IISDeserialize& de );
! virtual bool fire();
bool setSignalSource( SignalUnitAddress& signalAddress );
--- 72,77 ----
virtual bool deserialize( IISDeserialize& de );
! virtual const char* getCmdName() const
! { return "SignalSourceCmd"; }
bool setSignalSource( SignalUnitAddress& signalAddress );
Index: avc_unit_info.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_unit_info.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** avc_unit_info.cpp 28 Feb 2006 23:29:09 -0000 1.2
--- avc_unit_info.cpp 29 Mar 2006 22:57:51 -0000 1.3
***************
*** 81,171 ****
return true;
}
-
- bool
- UnitInfoCmd::fire()
- {
- bool result = false;
-
- #define STREAM_FORMAT_REQUEST_SIZE 2
- union UPacket {
- quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];
- unsigned char byte[STREAM_FORMAT_REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "UnitInoCmd::fire: Could not serialize\n" );
- return false;
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
-
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- STREAM_FORMAT_REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- }
- break;
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
--- 81,82 ----
Index: avc_connect.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_connect.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** avc_connect.h 26 Dec 2005 15:49:01 -0000 1.1.1.1
--- avc_connect.h 29 Mar 2006 22:57:52 -0000 1.2
***************
*** 35,41 ****
virtual bool deserialize( IISDeserialize& de );
! virtual bool fire( ECommandType commandType,
! raw1394handle_t handle,
! unsigned int node_id );
};
--- 35,40 ----
virtual bool deserialize( IISDeserialize& de );
! virtual const char* getCmdName() const
! { return "ConnectCmd"; }
};
Index: avc_signal_source.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_signal_source.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** avc_signal_source.cpp 28 Feb 2006 23:29:09 -0000 1.3
--- avc_signal_source.cpp 29 Mar 2006 22:57:51 -0000 1.4
***************
*** 230,325 ****
bool
- SignalSourceCmd::fire()
- {
- bool result = false;
-
- #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length
- union UPacket {
- quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];
- unsigned char byte[STREAM_FORMAT_REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "SignalSourceCmd::fire: Could not serialize\n" );
- return false;
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
-
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- STREAM_FORMAT_REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- case eR_NotImplemented:
- case eR_Accepted:
- case eR_Rejected:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- result = deserialize( de );
- }
- break;
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
-
- bool
SignalSourceCmd::setSignalSource( SignalUnitAddress& signalAddress )
{
--- 230,233 ----
Index: avc_subunit_info.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_subunit_info.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** avc_subunit_info.h 26 Dec 2005 15:49:37 -0000 1.1.1.1
--- avc_subunit_info.h 29 Mar 2006 22:57:51 -0000 1.2
***************
*** 38,42 ****
virtual bool deserialize( IISDeserialize& de );
! virtual bool fire();
bool clear();
--- 38,43 ----
virtual bool deserialize( IISDeserialize& de );
! virtual const char* getCmdName() const
! { return "SubUnitInfoCmd"; }
bool clear();
Index: avc_extended_stream_format.h
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_extended_stream_format.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** avc_extended_stream_format.h 28 Feb 2006 23:29:09 -0000 1.4
--- avc_extended_stream_format.h 29 Mar 2006 22:57:52 -0000 1.5
***************
*** 269,278 ****
virtual bool deserialize( IISDeserialize& de );
- virtual bool fire();
-
EStatus getStatus();
FormatInformation* getFormatInformation();
index_in_stream_format_t getIndex();
protected:
subfunction_t m_subFunction;
--- 269,279 ----
virtual bool deserialize( IISDeserialize& de );
EStatus getStatus();
FormatInformation* getFormatInformation();
index_in_stream_format_t getIndex();
+ virtual const char* getCmdName() const
+ { return "ExtendedStreamFormatCmd"; }
+
protected:
subfunction_t m_subFunction;
Index: avc_connect.cpp
===================================================================
RCS file: /cvsroot/freebob/libfreebob/src/libfreebobavc/avc_connect.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** avc_connect.cpp 2 Jan 2006 16:10:34 -0000 1.2
--- avc_connect.cpp 29 Mar 2006 22:57:52 -0000 1.3
***************
*** 50,144 ****
return true;
}
-
- bool
- ConnectCmd::fire( ECommandType commandType,
- raw1394handle_t handle,
- unsigned int node_id )
- {
- bool result = false;
-
- #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length
- union UPacket {
- quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];
- unsigned char byte[STREAM_FORMAT_REQUEST_SIZE*4];
- };
- typedef union UPacket packet_t;
-
- packet_t req;
- packet_t* resp;
-
- setCommandType( commandType );
- // initialize complete packet
- memset( &req, 0xff, sizeof( req ) );
-
- BufferSerialize se( req.byte, sizeof( req ) );
- if ( !serialize( se ) ) {
- printf( "ConnectCmd::fire: Could not serialize\n" );
- return false;
- }
-
- // reorder the bytes to the correct layout
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- req.quadlet[i] = ntohl( req.quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // debug output
- puts("request:");
- for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) {
- printf(" %2d: 0x%08x\n", i, req.quadlet[i]);
- }
- }
-
- resp = reinterpret_cast<packet_t*>(
- m_1394Service->transactionBlock( m_nodeId,
- req.quadlet,
- STREAM_FORMAT_REQUEST_SIZE ) );
- if ( resp ) {
- if ( isVerbose() ) {
- // debug output
- puts("response:");
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- printf( " %2d: 0x%08x\n", i, resp->quadlet[i] );
- }
- }
-
- // reorder the bytes to the correct layout
- for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) {
- resp->quadlet[i] = htonl( resp->quadlet[i] );
- }
-
- if ( isVerbose() ) {
- // a more detailed debug output
- printf( "\n" );
- printf( " idx type value\n" );
- printf( "-------------------------------------\n" );
- printf( " %02d ctype: 0x%02x\n", 0, resp->byte[0] );
- printf( " %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] );
- printf( " %02d opcode: 0x%02x\n", 2, resp->byte[2] );
-
- for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) {
- printf( " %02d operand %2d: 0x%02x\n", i, i-3, resp->byte[i] );
- }
- }
-
- // parse output
- parseResponse( resp->byte[0] );
- switch ( getResponse() )
- {
- case eR_Implemented:
- {
- BufferDeserialize de( resp->byte, sizeof( req ) );
- deserialize( de );
- result = true;
- }
- break;
- default:
- printf( "unexpected response received (0x%x)\n", getResponse() );
- }
- } else {
- printf( "no response\n" );
- }
-
- return result;
- }
--- 50,51 ----
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freebob-cvs mailing list
Freebob-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freebob-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic