Fawkes API Fawkes Development Version
FireVisionNetworkTool Class Reference

FireVision Network Tool. More...

Inheritance diagram for FireVisionNetworkTool:

Public Member Functions

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

Detailed Description

FireVision Network Tool.

Definition at line 57 of file net.cpp.

Constructor & Destructor Documentation

◆ FireVisionNetworkTool()

FireVisionNetworkTool::FireVisionNetworkTool ( ArgumentParser argp)
inlineexplicit

Constructor.

Parameters
argpargument parser

Definition at line 63 of file net.cpp.

Member Function Documentation

◆ all_for_now()

virtual void FireVisionNetworkTool::all_for_now ( )
inlinevirtual

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().

◆ browse_failed()

virtual void FireVisionNetworkTool::browse_failed ( const char *  name,
const char *  type,
const char *  domain 
)
inlinevirtual

Failed to browse for a given service.

Parameters
namename of the service
typetype of the service
domaindomain of the service

Implements fawkes::ServiceBrowseHandler.

Definition at line 244 of file net.cpp.

◆ cache_exhausted()

virtual void FireVisionNetworkTool::cache_exhausted ( )
inlinevirtual

Cache exhausted.

Implements fawkes::ServiceBrowseHandler.

Definition at line 239 of file net.cpp.

◆ explore_network()

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 371 of file net.cpp.

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

Referenced by run().

◆ fuse_connection_died()

virtual void FireVisionNetworkTool::fuse_connection_died ( )
inlinevirtualnoexcept

Connection died.

Implements firevision::FuseClientHandler.

Definition at line 82 of file net.cpp.

◆ fuse_connection_established()

virtual void FireVisionNetworkTool::fuse_connection_established ( )
inlinevirtualnoexcept

Connection has been established.

Implements firevision::FuseClientHandler.

Definition at line 77 of file net.cpp.

◆ fuse_inbound_received()

virtual void FireVisionNetworkTool::fuse_inbound_received ( FuseNetworkMessage m)
inlinevirtualnoexcept

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
mmessage to handle

Implements firevision::FuseClientHandler.

Definition at line 87 of file net.cpp.

References firevision::ColormapFile::add_colormap(), fawkes::Exception::append(), firevision::FuseImageContent::buffer(), firevision::FuseLutContent::buffer(), firevision::FuseImageContent::buffer_size(), firevision::FUSE_lutinfo_t::bytes_per_cell, fawkes::Thread::cancel(), firevision::FUSE_imageinfo_t::colorspace, firevision::FuseImageContent::colorspace(), firevision::FUSE_lutinfo_t::depth, firevision::FuseLutContent::depth(), firevision::FuseImageContent::format(), firevision::FuseImageListContent::has_next(), firevision::FuseLutListContent::has_next(), firevision::FUSE_imageinfo_t::height, firevision::FUSE_lutinfo_t::height, firevision::FuseLutContent::height(), firevision::FUSE_imageinfo_t::image_id, firevision::FUSE_lutdesc_message_t::lut_id, firevision::FUSE_lutinfo_t::lut_id, firevision::FuseImageListContent::next(), firevision::FuseLutListContent::next(), firevision::FuseImageContent::pixel_height(), firevision::FuseImageContent::pixel_width(), fawkes::Exception::print_trace(), firevision::YuvColormap::set(), firevision::FUSE_imageinfo_t::width, firevision::FUSE_lutinfo_t::width, firevision::FuseLutContent::width(), firevision::FvRawWriter::write(), and firevision::FireVisionDataFile::write().

◆ fuse_invalid_server_version()

void FireVisionNetworkTool::fuse_invalid_server_version ( uint32_t  local_version,
uint32_t  remote_version 
)
inlinevirtualnoexcept

Invalid version string received.

The remote end has a different incompatible FUSE version.

Parameters
local_versionversion that the FuseClient speaks
remote_versionversion that the remote FUSE server speaks.

Implements firevision::FuseClientHandler.

Definition at line 71 of file net.cpp.

◆ get_colormap()

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

Request LUT.

Parameters
lut_idLUT ID.

Definition at line 329 of file net.cpp.

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

Referenced by run().

◆ get_image()

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

Request image.

Parameters
image_idImage ID.
jpegif true JPEG images are requested, raw images otherwise

Definition at line 315 of file net.cpp.

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

Referenced by run().

◆ print_usage()

void FireVisionNetworkTool::print_usage ( )
inline

Print usage message.

Definition at line 292 of file net.cpp.

References fawkes::ArgumentParser::program_name().

Referenced by run().

◆ run()

◆ service_added()

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

A service has been announced on the network.

Parameters
namename of the service
typetype of the service
domaindomain of the service
host_namename of the host that provides the service
interfacename of network interface to reach service
addrpointer to sockaddr struct of appropriate type for address
addr_sizesize of addr struct
portport of the service
txtlist of txt records.
flagsextra flags, see Avahi documentation

Implements fawkes::ServiceBrowseHandler.

Definition at line 250 of file net.cpp.

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

◆ service_removed()

virtual void FireVisionNetworkTool::service_removed ( const char *  name,
const char *  type,
const char *  domain 
)
inlinevirtual

A service has been removed from the network.

Parameters
namename of the service
typetype of the service
domaindomain of the service

Implements fawkes::ServiceBrowseHandler.

Definition at line 286 of file net.cpp.

◆ set_colormap()

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

◆ show_all()

void FireVisionNetworkTool::show_all ( )
inline

Show all images and LUTs.

Definition at line 359 of file net.cpp.

References firevision::FuseClient::enqueue().

Referenced by run(), and service_added().


The documentation for this class was generated from the following file: