Fawkes API  Fawkes Development Version
BatteryMonitor Class Reference

A battery monitor. More...

#include <tools/battery_monitor/battery_monitor.h>

Inheritance diagram for BatteryMonitor:

Public Member Functions

 BatteryMonitor (Glib::RefPtr< Gtk::Builder > builder)
 Constructor. More...
 
 ~BatteryMonitor ()
 Destructor. More...
 
Gtk::Window & get_window () const
 Obtain the main window. More...
 

Protected Member Functions

void all_for_now ()
 All results have been retrieved. More...
 
void cache_exhausted ()
 Cache exhausted. More...
 
void browse_failed (const char *name, const char *type, const char *domain)
 Failed to browse for a given service. More...
 
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...
 
void service_removed (const char *name, const char *type, const char *domain)
 A service has been removed from the network. More...
 

Detailed Description

A battery monitor.

Author
Daniel Beck

Definition at line 39 of file battery_monitor.h.

Constructor & Destructor Documentation

◆ BatteryMonitor()

BatteryMonitor::BatteryMonitor ( Glib::RefPtr< Gtk::Builder >  builder)

Constructor.

Parameters
builderbuilder to get widgets from

Definition at line 39 of file battery_monitor.cpp.

◆ ~BatteryMonitor()

BatteryMonitor::~BatteryMonitor ( )

Destructor.

Definition at line 53 of file battery_monitor.cpp.

Member Function Documentation

◆ all_for_now()

void BatteryMonitor::all_for_now ( )
protectedvirtual

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 70 of file battery_monitor.cpp.

◆ browse_failed()

void BatteryMonitor::browse_failed ( const char *  name,
const char *  type,
const char *  domain 
)
protectedvirtual

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 80 of file battery_monitor.cpp.

◆ cache_exhausted()

void BatteryMonitor::cache_exhausted ( )
protectedvirtual

Cache exhausted.

Implements fawkes::ServiceBrowseHandler.

Definition at line 75 of file battery_monitor.cpp.

◆ get_window()

Gtk::Window & BatteryMonitor::get_window ( ) const

Obtain the main window.

Returns
the main window

Definition at line 64 of file battery_monitor.cpp.

◆ service_added()

void BatteryMonitor::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 
)
protectedvirtual

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 87 of file battery_monitor.cpp.

◆ service_removed()

void BatteryMonitor::service_removed ( const char *  name,
const char *  type,
const char *  domain 
)
protectedvirtual

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 105 of file battery_monitor.cpp.


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