24 #ifndef __CONFIG_NET_HANDLER_H_ 25 #define __CONFIG_NET_HANDLER_H_ 27 #include <core/threading/thread.h> 28 #include <netcomm/fawkes/handler.h> 29 #include <core/utils/lock_queue.h> 30 #include <core/utils/lock_list.h> 32 #include <config/net_messages.h> 33 #include <config/config.h> 34 #include <config/change_handler.h> 44 class FawkesNetworkHub;
73 void send_inv_value(
unsigned int clid,
const char *path);
76 T * prepare_msg(
const char *path,
bool is_default)
78 T * m = (T *)calloc(1,
sizeof(T));
79 strncpy(m->cp.path, path, CONFIG_MSG_PATH_LENGTH);
80 m->cp.is_default = is_default;
86 prepare_value_msg(
const char *path,
bool is_default,
bool is_list,
87 uint16_t num_values,
size_t &data_size,
void * __attribute__((__may_alias__)) * data)
90 void* m = calloc(1, data_size);
92 strncpy(cd->
path, path, CONFIG_MSG_PATH_LENGTH);
Fawkes library namespace.
virtual void config_value_changed(const Configuration::ValueIterator *v)
Called whenever a watched value has changed.
virtual void run()
Code to execute in the thread.
~ConfigNetworkHandler()
Destructor.
Interface for configuration change handling.
char path[CONFIG_MSG_PATH_LENGTH]
path to config value.
virtual void handle_network_message(FawkesNetworkMessage *msg)
Handle network message.
virtual void config_value_erased(const char *path)
Called whenever a value has been erased from the config.
Representation of a message that is sent over the network.
Thread class encapsulation of pthreads.
virtual void run()
Stub to see name in backtrace for easier debugging.
virtual void loop()
Process all network messages that have been received.
ConfigNetworkHandler(Configuration *config, FawkesNetworkHub *hub)
Constructor.
Fawkes Configuration Network Handler.
uint16_t is_default
1 if value is a default value, 0 otherwise, only for get response
Network handler abstract base class.
uint16_t num_values
Number of valus in list.
virtual void client_disconnected(unsigned int clid)
Client disconnected.
virtual void client_connected(unsigned int clid)
Client connected.
Iterator interface to iterate over config values.
virtual void config_comment_changed(const Configuration::ValueIterator *v)
Called whenever a comment of a watched value has changed.
Interface for configuration handling.
virtual void config_tag_changed(const char *new_location)
Tag changed.