24 #include <interfaces/SpeechRecognitionInterface.h>
26 #include <core/exceptions/software.h>
46 SpeechRecognitionInterface::SpeechRecognitionInterface() : Interface()
48 data_size =
sizeof(SpeechRecognitionInterface_data_t);
50 data = (SpeechRecognitionInterface_data_t *)
data_ptr;
59 unsigned char tmp_hash[] = {0x8f, 0x5c, 0xd, 0x42, 0x1b, 0x22, 0x75, 0x3d, 0x50, 0x66, 0x70, 0x8, 0x1f, 0x47, 0xa7, 0xfd};
64 SpeechRecognitionInterface::~SpeechRecognitionInterface()
100 strncpy(data->text, new_text,
sizeof(data->text)-1);
101 data->text[
sizeof(data->text)-1] = 0;
114 return data->counter;
136 data->counter = new_counter;
149 return data->processing;
171 data->processing = new_processing;
184 return data->enabled;
206 data->enabled = new_enabled;
214 if ( strncmp(
"ResetMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
215 return new ResetMessage();
216 }
else if ( strncmp(
"SetEnabledMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
217 return new SetEnabledMessage();
219 throw UnknownTypeException(
"The given type '%s' does not match any known "
220 "message type for this interface type.",
type);
231 const SpeechRecognitionInterface *oi = dynamic_cast<const SpeechRecognitionInterface *>(other);
234 type(), other->type());
236 memcpy(data, oi->data,
sizeof(SpeechRecognitionInterface_data_t));
242 throw UnknownTypeException(
"Unknown enum type %s", enumtype);
259 data = (ResetMessage_data_t *)
data_ptr;
277 data = (ResetMessage_data_t *)
data_ptr;
304 data_size =
sizeof(SetEnabledMessage_data_t);
307 data = (SetEnabledMessage_data_t *)
data_ptr;
309 data->enabled = ini_enabled;
315 data_size =
sizeof(SetEnabledMessage_data_t);
318 data = (SetEnabledMessage_data_t *)
data_ptr;
337 data = (SetEnabledMessage_data_t *)
data_ptr;
351 return data->enabled;
373 data->enabled = new_enabled;
393 const ResetMessage *m0 = dynamic_cast<const ResetMessage *>(message);
397 const SetEnabledMessage *m1 = dynamic_cast<const SetEnabledMessage *>(message);
405 EXPORT_INTERFACE(SpeechRecognitionInterface)