24 #include <interfaces/SpeechRecognitionInterface.h>
26 #include <core/exceptions/software.h>
44 SpeechRecognitionInterface::SpeechRecognitionInterface() : Interface()
46 data_size =
sizeof(SpeechRecognitionInterface_data_t);
48 data = (SpeechRecognitionInterface_data_t *)
data_ptr;
57 unsigned char tmp_hash[] = {0x8f, 0x5c, 0xd, 0x42, 0x1b, 0x22, 0x75, 0x3d, 0x50, 0x66, 0x70, 0x8, 0x1f, 0x47, 0xa7, 0xfd};
62 SpeechRecognitionInterface::~SpeechRecognitionInterface()
98 strncpy(data->text, new_text,
sizeof(data->text));
111 return data->counter;
133 data->counter = new_counter;
146 return data->processing;
168 data->processing = new_processing;
181 return data->enabled;
203 data->enabled = new_enabled;
211 if ( strncmp(
"ResetMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
213 }
else if ( strncmp(
"SetEnabledMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
217 "message type for this interface type.", type);
233 memcpy(data, oi->data,
sizeof(SpeechRecognitionInterface_data_t));
256 data = (ResetMessage_data_t *)
data_ptr;
274 data = (ResetMessage_data_t *)
data_ptr;
301 data_size =
sizeof(SetEnabledMessage_data_t);
304 data = (SetEnabledMessage_data_t *)
data_ptr;
306 data->enabled = ini_enabled;
312 data_size =
sizeof(SetEnabledMessage_data_t);
315 data = (SetEnabledMessage_data_t *)
data_ptr;
334 data = (SetEnabledMessage_data_t *)
data_ptr;
348 return data->enabled;
370 data->enabled = new_enabled;
size_t maxlenof_text() const
Get maximum length of text value.
void * data_ptr
Pointer to memory that contains local data.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
virtual Message * clone() const
Clone this message.
ResetMessage()
Constructor.
void set_hash(unsigned char *ihash)
Set hash.
Fawkes library namespace.
SetEnabledMessage Fawkes BlackBoard Interface Message.
~SetEnabledMessage()
Destructor.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
void set_processing(const bool new_processing)
Set processing value.
bool is_processing() const
Get processing value.
Base class for all Fawkes BlackBoard interfaces.
void set_counter(const uint32_t new_counter)
Set counter value.
void set_text(const char *new_text)
Set text value.
size_t maxlenof_processing() const
Get maximum length of processing value.
bool is_enabled() const
Get enabled value.
void set_enabled(const bool new_enabled)
Set enabled value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
void set_enabled(const bool new_enabled)
Set enabled value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
size_t maxlenof_counter() const
Get maximum length of counter value.
bool data_changed
Indicator if data has changed.
SpeechRecognitionInterface Fawkes BlackBoard Interface.
void * data_ptr
Pointer to local memory storage.
~ResetMessage()
Destructor.
virtual Message * clone() const
Clone this message.
bool is_enabled() const
Get enabled value.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
virtual Message * create_message(const char *type) const
Create message based on type name.
ResetMessage Fawkes BlackBoard Interface Message.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0)
Add an entry to the info list.
virtual void copy_values(const Interface *other)
Copy values from other interface.
char * text() const
Get text value.
const char * type() const
Get type of interface.
32 bit unsigned integer field
uint32_t counter() const
Get counter value.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
SetEnabledMessage()
Constructor.