FireVisionNetworkTool Class Reference

FireVision Network Tool. More...

Inheritance diagram for FireVisionNetworkTool:

[legend]
List of all members.

Public Member Functions

 FireVisionNetworkTool (ArgumentParser *argp)
 Constructor.
void fuse_invalid_server_version (uint32_t local_version, uint32_t remote_version) throw ()
 Invalid version string received.
virtual void fuse_connection_established () throw ()
 Connection has been established.
virtual void fuse_connection_died () throw ()
 Connection died.
virtual void fuse_inbound_received (FuseNetworkMessage *m) throw ()
 Message received.
virtual void all_for_now ()
 All results have been retrieved.
virtual void cache_exhausted ()
 Cache exhausted.
virtual void browse_failed (const char *name, const char *type, const char *domain)
 Failed to browse for a given service.
virtual void service_added (const char *name, const char *type, const char *domain, const char *host_name, const struct sockaddr *addr, const socklen_t addr_size, uint16_t port, std::list< std::string > &txt, int flags)
 A service has been announced on the network.
virtual void service_removed (const char *name, const char *type, const char *domain)
 A service has been removed from the network.
void print_usage ()
 Print usage message.
void get_image (const char *image_id, bool jpeg)
 Request image.
void get_colormap (const char *lut_id)
 Request LUT.
void set_colormap (const char *lut_id)
 Upload LUT.
void show_all ()
 Show all images and LUTs.
void explore_network ()
 Explore network.
void run ()
 Run.

Detailed Description

FireVision Network Tool.

Definition at line 58 of file net.cpp.


Constructor & Destructor Documentation

FireVisionNetworkTool::FireVisionNetworkTool ( ArgumentParser argp  )  [inline]

Constructor.

Parameters:
argp argument parser

Definition at line 66 of file net.cpp.


Member Function Documentation

virtual void FireVisionNetworkTool::all_for_now (  )  [inline, virtual]

All results have been retrieved.

If you read the DNS-SD specs you will see that there is no explicit "not existent" or "end of records" message - it cannot be. But after some time it is assumed that there are no more records. If that is the case this method is called.

Implements fawkes::ServiceBrowseHandler.

Definition at line 230 of file net.cpp.

References fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wake_all().

virtual void FireVisionNetworkTool::browse_failed ( const char *  name,
const char *  type,
const char *  domain 
) [inline, virtual]

Failed to browse for a given service.

Parameters:
name name of the service
type type of the service
domain domain of the service

Implements fawkes::ServiceBrowseHandler.

Definition at line 242 of file net.cpp.

virtual void FireVisionNetworkTool::cache_exhausted (  )  [inline, virtual]

Cache exhausted.

Implements fawkes::ServiceBrowseHandler.

Definition at line 238 of file net.cpp.

void FireVisionNetworkTool::explore_network (  )  [inline]

Explore network.

This will query via service discovery for all Fountain instances on the local network. It will then connect to each of these and query them for existing images and lookup tables.

Definition at line 368 of file net.cpp.

References fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wait().

Referenced by run().

virtual void FireVisionNetworkTool::fuse_connection_died (  )  throw () [inline, virtual]

Connection died.

Implements firevision::FuseClientHandler.

Definition at line 87 of file net.cpp.

virtual void FireVisionNetworkTool::fuse_connection_established (  )  throw () [inline, virtual]

Connection has been established.

Implements firevision::FuseClientHandler.

Definition at line 82 of file net.cpp.

virtual void FireVisionNetworkTool::fuse_inbound_received ( FuseNetworkMessage m  )  throw () [inline, virtual]

Message received.

An incoming message has been received and can now be processed. Note that if you want to work on the message after this method has finished you have to reference the message by calling FuseMessage::ref()!

Parameters:
m message to handle

Implements firevision::FuseClientHandler.

Definition at line 92 of file net.cpp.

References firevision::ColormapFile::add_colormap(), fawkes::Exception::append(), firevision::FuseLutContent::buffer(), fawkes::Thread::cancel(), firevision::colorspace_to_string(), firevision::FuseLutContent::depth(), firevision::FUSE_IF_JPEG, firevision::FUSE_IF_RAW, firevision::FUSE_MT_IMAGE, firevision::FUSE_MT_IMAGE_LIST, firevision::FUSE_MT_LUT, firevision::FUSE_MT_LUT_LIST, firevision::FUSE_MT_SET_LUT_FAILED, firevision::FUSE_MT_SET_LUT_SUCCEEDED, firevision::FuseLutListContent::has_next(), firevision::FuseImageListContent::has_next(), firevision::FuseLutContent::height(), firevision::FUSE_lutdesc_message_t::lut_id, firevision::FuseLutListContent::next(), firevision::FuseImageListContent::next(), fawkes::Exception::print_trace(), firevision::FuseLutContent::width(), and firevision::FireVisionDataFile::write().

void FireVisionNetworkTool::fuse_invalid_server_version ( uint32_t  local_version,
uint32_t  remote_version 
) throw () [inline, virtual]

Invalid version string received.

The remote end has a different incompatible FUSE version.

Parameters:
local_version version that the FuseClient speaks
remote_version version that the remote FUSE server speaks.

Implements firevision::FuseClientHandler.

Definition at line 74 of file net.cpp.

void FireVisionNetworkTool::get_colormap ( const char *  lut_id  )  [inline]

Request LUT.

Parameters:
lut_id LUT ID.

Definition at line 329 of file net.cpp.

References firevision::FuseClient::enqueue(), firevision::FUSE_MT_GET_LUT, and firevision::FUSE_lutdesc_message_t::lut_id.

Referenced by run().

void FireVisionNetworkTool::get_image ( const char *  image_id,
bool  jpeg 
) [inline]

Request image.

Parameters:
image_id Image ID.
jpeg if true JPEG images are requested, raw images otherwise

Definition at line 316 of file net.cpp.

References firevision::FuseClient::enqueue(), firevision::FUSE_imagereq_message_t::format, firevision::FUSE_IF_JPEG, firevision::FUSE_IF_RAW, firevision::FUSE_MT_GET_IMAGE, and firevision::FUSE_imagereq_message_t::image_id.

Referenced by run().

void FireVisionNetworkTool::print_usage (  )  [inline]

Print usage message.

Definition at line 292 of file net.cpp.

References fawkes::ArgumentParser::program_name().

Referenced by run().

void FireVisionNetworkTool::run (  )  [inline]

Run.

Definition at line 397 of file net.cpp.

References fawkes::ArgumentParser::arg(), fawkes::Thread::cancel(), firevision::FuseClient::connect(), explore_network(), get_colormap(), get_image(), fawkes::ArgumentParser::has_arg(), fawkes::ArgumentParser::items(), fawkes::Thread::join(), fawkes::ArgumentParser::num_items(), print_usage(), set_colormap(), show_all(), fawkes::Thread::start(), and firevision::FuseClient::wait_greeting().

virtual void FireVisionNetworkTool::service_added ( const char *  name,
const char *  type,
const char *  domain,
const char *  host_name,
const struct sockaddr *  addr,
const socklen_t  addr_size,
uint16_t  port,
std::list< std::string > &  txt,
int  flags 
) [inline, virtual]

A service has been announced on the network.

Parameters:
name name of the service
type type of the service
domain domain of the service
host_name name of the host that provides the service
addr pointer to sockaddr struct of appropriate type for address
addr_size size of addr struct
port port of the service
txt list of txt records.
flags extra flags, see Avahi documentation

Implements fawkes::ServiceBrowseHandler.

Definition at line 249 of file net.cpp.

References firevision::FuseClient::connect(), fawkes::Thread::join(), show_all(), fawkes::Thread::start(), and firevision::FuseClient::wait_greeting().

virtual void FireVisionNetworkTool::service_removed ( const char *  name,
const char *  type,
const char *  domain 
) [inline, virtual]

A service has been removed from the network.

Parameters:
name name of the service
type type of the service
domain domain of the service

Implements fawkes::ServiceBrowseHandler.

Definition at line 284 of file net.cpp.

void FireVisionNetworkTool::set_colormap ( const char *  lut_id  )  [inline]

Upload LUT.

Parameters:
lut_id LUT ID.

Definition at line 341 of file net.cpp.

References firevision::Colormap::depth(), firevision::FuseClient::enqueue(), firevision::FUSE_MT_SET_LUT, firevision::Colormap::get_buffer(), firevision::ColormapFile::get_colormap(), firevision::Colormap::height(), firevision::FireVisionDataFile::read(), and firevision::Colormap::width().

Referenced by run().

void FireVisionNetworkTool::show_all (  )  [inline]

Show all images and LUTs.

Definition at line 356 of file net.cpp.

References firevision::FuseClient::enqueue(), firevision::FUSE_MT_GET_IMAGE_LIST, and firevision::FUSE_MT_GET_LUT_LIST.

Referenced by run(), and service_added().


The documentation for this class was generated from the following file:
Generated on Tue Feb 22 13:31:32 2011 for Fawkes API by  doxygen 1.4.7