Fawkes API  Fawkes Development Version
SkillerInterface.cpp
1 
2 /***************************************************************************
3  * SkillerInterface.cpp - Fawkes BlackBoard Interface - SkillerInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2008 Tim Niemueller
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <interfaces/SkillerInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <map>
29 #include <string>
30 #include <cstring>
31 #include <cstdlib>
32 
33 namespace fawkes {
34 
35 /** @class SkillerInterface <interfaces/SkillerInterface.h>
36  * SkillerInterface Fawkes BlackBoard Interface.
37  *
38  The interface provides access to the skill execution runtime plugin.
39  It provides basic status information about skiller and allows for
40  calling skills via messages. It can also be used to manually restart
41  the Lua interpreter if something is wedged.
42 
43  * @ingroup FawkesInterfaces
44  */
45 
46 
47 
48 /** Constructor */
49 SkillerInterface::SkillerInterface() : Interface()
50 {
51  data_size = sizeof(SkillerInterface_data_t);
52  data_ptr = malloc(data_size);
53  data = (SkillerInterface_data_t *)data_ptr;
54  data_ts = (interface_data_ts_t *)data_ptr;
55  memset(data_ptr, 0, data_size);
56  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
57  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
58  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
59  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
60  add_fieldinfo(IFT_STRING, "skill_string", 1024, data->skill_string);
61  add_fieldinfo(IFT_STRING, "error", 128, data->error);
62  add_fieldinfo(IFT_UINT32, "exclusive_controller", 1, &data->exclusive_controller);
63  add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid);
64  add_fieldinfo(IFT_ENUM, "status", 1, &data->status, "SkillStatusEnum", &enum_map_SkillStatusEnum);
65  add_messageinfo("ExecSkillMessage");
66  add_messageinfo("RestartInterpreterMessage");
67  add_messageinfo("StopExecMessage");
68  add_messageinfo("AcquireControlMessage");
69  add_messageinfo("ReleaseControlMessage");
70  unsigned char tmp_hash[] = {0x99, 0x14, 0xe6, 0x2b, 0x7f, 0x3b, 0x80, 0xb, 0xbd, 0x35, 0x10, 0xc0, 0x7e, 0xb5, 0xdc, 0x55};
71  set_hash(tmp_hash);
72 }
73 
74 /** Destructor */
75 SkillerInterface::~SkillerInterface()
76 {
77  free(data_ptr);
78 }
79 /** Convert SkillStatusEnum constant to string.
80  * @param value value to convert to string
81  * @return constant value as string.
82  */
83 const char *
84 SkillerInterface::tostring_SkillStatusEnum(SkillStatusEnum value) const
85 {
86  switch (value) {
87  case S_INACTIVE: return "S_INACTIVE";
88  case S_FINAL: return "S_FINAL";
89  case S_RUNNING: return "S_RUNNING";
90  case S_FAILED: return "S_FAILED";
91  default: return "UNKNOWN";
92  }
93 }
94 /* Methods */
95 /** Get skill_string value.
96  *
97  Currently executed skill string, at least the first 1023 bytes of it.
98  Must be properly null-terminated.
99 
100  * @return skill_string value
101  */
102 char *
104 {
105  return data->skill_string;
106 }
107 
108 /** Get maximum length of skill_string value.
109  * @return length of skill_string value, can be length of the array or number of
110  * maximum number of characters for a string
111  */
112 size_t
114 {
115  return 1024;
116 }
117 
118 /** Set skill_string value.
119  *
120  Currently executed skill string, at least the first 1023 bytes of it.
121  Must be properly null-terminated.
122 
123  * @param new_skill_string new skill_string value
124  */
125 void
126 SkillerInterface::set_skill_string(const char * new_skill_string)
127 {
128  strncpy(data->skill_string, new_skill_string, sizeof(data->skill_string)-1);
129  data->skill_string[sizeof(data->skill_string)-1] = 0;
130  data_changed = true;
131 }
132 
133 /** Get error value.
134  *
135  String describing the error. Can be set by a skill when it fails.
136 
137  * @return error value
138  */
139 char *
141 {
142  return data->error;
143 }
144 
145 /** Get maximum length of error value.
146  * @return length of error value, can be length of the array or number of
147  * maximum number of characters for a string
148  */
149 size_t
151 {
152  return 128;
153 }
154 
155 /** Set error value.
156  *
157  String describing the error. Can be set by a skill when it fails.
158 
159  * @param new_error new error value
160  */
161 void
162 SkillerInterface::set_error(const char * new_error)
163 {
164  strncpy(data->error, new_error, sizeof(data->error)-1);
165  data->error[sizeof(data->error)-1] = 0;
166  data_changed = true;
167 }
168 
169 /** Get exclusive_controller value.
170  *
171  Instance serial of the exclusive controller of the skiller. If this does not
172  carry your instance serial your exec messages will be ignored. Aquire control with
173  the AquireControlMessage. Make sure you release control before exiting.
174 
175  * @return exclusive_controller value
176  */
177 uint32_t
179 {
180  return data->exclusive_controller;
181 }
182 
183 /** Get maximum length of exclusive_controller value.
184  * @return length of exclusive_controller value, can be length of the array or number of
185  * maximum number of characters for a string
186  */
187 size_t
189 {
190  return 1;
191 }
192 
193 /** Set exclusive_controller value.
194  *
195  Instance serial of the exclusive controller of the skiller. If this does not
196  carry your instance serial your exec messages will be ignored. Aquire control with
197  the AquireControlMessage. Make sure you release control before exiting.
198 
199  * @param new_exclusive_controller new exclusive_controller value
200  */
201 void
202 SkillerInterface::set_exclusive_controller(const uint32_t new_exclusive_controller)
203 {
204  data->exclusive_controller = new_exclusive_controller;
205  data_changed = true;
206 }
207 
208 /** Get msgid value.
209  *
210  The ID of the message that is currently being processed,
211  or 0 if no message is being processed.
212 
213  * @return msgid value
214  */
215 uint32_t
217 {
218  return data->msgid;
219 }
220 
221 /** Get maximum length of msgid value.
222  * @return length of msgid value, can be length of the array or number of
223  * maximum number of characters for a string
224  */
225 size_t
227 {
228  return 1;
229 }
230 
231 /** Set msgid value.
232  *
233  The ID of the message that is currently being processed,
234  or 0 if no message is being processed.
235 
236  * @param new_msgid new msgid value
237  */
238 void
239 SkillerInterface::set_msgid(const uint32_t new_msgid)
240 {
241  data->msgid = new_msgid;
242  data_changed = true;
243 }
244 
245 /** Get status value.
246  *
247  The status of the current skill execution.
248 
249  * @return status value
250  */
253 {
254  return (SkillerInterface::SkillStatusEnum)data->status;
255 }
256 
257 /** Get maximum length of status value.
258  * @return length of status value, can be length of the array or number of
259  * maximum number of characters for a string
260  */
261 size_t
263 {
264  return 1;
265 }
266 
267 /** Set status value.
268  *
269  The status of the current skill execution.
270 
271  * @param new_status new status value
272  */
273 void
275 {
276  data->status = new_status;
277  data_changed = true;
278 }
279 
280 /* =========== message create =========== */
281 Message *
282 SkillerInterface::create_message(const char *type) const
283 {
284  if ( strncmp("ExecSkillMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
285  return new ExecSkillMessage();
286  } else if ( strncmp("RestartInterpreterMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
287  return new RestartInterpreterMessage();
288  } else if ( strncmp("StopExecMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
289  return new StopExecMessage();
290  } else if ( strncmp("AcquireControlMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
291  return new AcquireControlMessage();
292  } else if ( strncmp("ReleaseControlMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
293  return new ReleaseControlMessage();
294  } else {
295  throw UnknownTypeException("The given type '%s' does not match any known "
296  "message type for this interface type.", type);
297  }
298 }
299 
300 
301 /** Copy values from other interface.
302  * @param other other interface to copy values from
303  */
304 void
306 {
307  const SkillerInterface *oi = dynamic_cast<const SkillerInterface *>(other);
308  if (oi == NULL) {
309  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
310  type(), other->type());
311  }
312  memcpy(data, oi->data, sizeof(SkillerInterface_data_t));
313 }
314 
315 const char *
316 SkillerInterface::enum_tostring(const char *enumtype, int val) const
317 {
318  if (strcmp(enumtype, "SkillStatusEnum") == 0) {
319  return tostring_SkillStatusEnum((SkillStatusEnum)val);
320  }
321  throw UnknownTypeException("Unknown enum type %s", enumtype);
322 }
323 
324 /* =========== messages =========== */
325 /** @class SkillerInterface::ExecSkillMessage <interfaces/SkillerInterface.h>
326  * ExecSkillMessage Fawkes BlackBoard Interface Message.
327  *
328 
329  */
330 
331 
332 /** Constructor with initial values.
333  * @param ini_skill_string initial value for skill_string
334  */
335 SkillerInterface::ExecSkillMessage::ExecSkillMessage(const char * ini_skill_string) : Message("ExecSkillMessage")
336 {
337  data_size = sizeof(ExecSkillMessage_data_t);
338  data_ptr = malloc(data_size);
339  memset(data_ptr, 0, data_size);
340  data = (ExecSkillMessage_data_t *)data_ptr;
342  strncpy(data->skill_string, ini_skill_string, 1024-1);
343  data->skill_string[1024-1] = 0;
344  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
345  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
346  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
347  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
348  add_fieldinfo(IFT_STRING, "skill_string", 1024, data->skill_string);
349 }
350 /** Constructor */
352 {
353  data_size = sizeof(ExecSkillMessage_data_t);
354  data_ptr = malloc(data_size);
355  memset(data_ptr, 0, data_size);
356  data = (ExecSkillMessage_data_t *)data_ptr;
358  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
359  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
360  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
361  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
362  add_fieldinfo(IFT_STRING, "skill_string", 1024, data->skill_string);
363 }
364 
365 /** Destructor */
367 {
368  free(data_ptr);
369 }
370 
371 /** Copy constructor.
372  * @param m message to copy from
373  */
375 {
376  data_size = m->data_size;
377  data_ptr = malloc(data_size);
379  data = (ExecSkillMessage_data_t *)data_ptr;
381 }
382 
383 /* Methods */
384 /** Get skill_string value.
385  *
386  Currently executed skill string, at least the first 1023 bytes of it.
387  Must be properly null-terminated.
388 
389  * @return skill_string value
390  */
391 char *
393 {
394  return data->skill_string;
395 }
396 
397 /** Get maximum length of skill_string value.
398  * @return length of skill_string value, can be length of the array or number of
399  * maximum number of characters for a string
400  */
401 size_t
403 {
404  return 1024;
405 }
406 
407 /** Set skill_string value.
408  *
409  Currently executed skill string, at least the first 1023 bytes of it.
410  Must be properly null-terminated.
411 
412  * @param new_skill_string new skill_string value
413  */
414 void
415 SkillerInterface::ExecSkillMessage::set_skill_string(const char * new_skill_string)
416 {
417  strncpy(data->skill_string, new_skill_string, sizeof(data->skill_string)-1);
418  data->skill_string[sizeof(data->skill_string)-1] = 0;
419 }
420 
421 /** Clone this message.
422  * Produces a message of the same type as this message and copies the
423  * data to the new message.
424  * @return clone of this message
425  */
426 Message *
428 {
429  return new SkillerInterface::ExecSkillMessage(this);
430 }
431 /** @class SkillerInterface::RestartInterpreterMessage <interfaces/SkillerInterface.h>
432  * RestartInterpreterMessage Fawkes BlackBoard Interface Message.
433  *
434 
435  */
436 
437 
438 /** Constructor */
440 {
441  data_size = sizeof(RestartInterpreterMessage_data_t);
442  data_ptr = malloc(data_size);
443  memset(data_ptr, 0, data_size);
444  data = (RestartInterpreterMessage_data_t *)data_ptr;
446  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
447  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
448  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
449  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
450 }
451 
452 /** Destructor */
454 {
455  free(data_ptr);
456 }
457 
458 /** Copy constructor.
459  * @param m message to copy from
460  */
462 {
463  data_size = m->data_size;
464  data_ptr = malloc(data_size);
466  data = (RestartInterpreterMessage_data_t *)data_ptr;
468 }
469 
470 /* Methods */
471 /** Clone this message.
472  * Produces a message of the same type as this message and copies the
473  * data to the new message.
474  * @return clone of this message
475  */
476 Message *
478 {
480 }
481 /** @class SkillerInterface::StopExecMessage <interfaces/SkillerInterface.h>
482  * StopExecMessage Fawkes BlackBoard Interface Message.
483  *
484 
485  */
486 
487 
488 /** Constructor */
490 {
491  data_size = sizeof(StopExecMessage_data_t);
492  data_ptr = malloc(data_size);
493  memset(data_ptr, 0, data_size);
494  data = (StopExecMessage_data_t *)data_ptr;
496  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
497  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
498  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
499  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
500 }
501 
502 /** Destructor */
504 {
505  free(data_ptr);
506 }
507 
508 /** Copy constructor.
509  * @param m message to copy from
510  */
512 {
513  data_size = m->data_size;
514  data_ptr = malloc(data_size);
516  data = (StopExecMessage_data_t *)data_ptr;
518 }
519 
520 /* Methods */
521 /** Clone this message.
522  * Produces a message of the same type as this message and copies the
523  * data to the new message.
524  * @return clone of this message
525  */
526 Message *
528 {
529  return new SkillerInterface::StopExecMessage(this);
530 }
531 /** @class SkillerInterface::AcquireControlMessage <interfaces/SkillerInterface.h>
532  * AcquireControlMessage Fawkes BlackBoard Interface Message.
533  *
534 
535  */
536 
537 
538 /** Constructor with initial values.
539  * @param ini_steal_control initial value for steal_control
540  */
541 SkillerInterface::AcquireControlMessage::AcquireControlMessage(const bool ini_steal_control) : Message("AcquireControlMessage")
542 {
543  data_size = sizeof(AcquireControlMessage_data_t);
544  data_ptr = malloc(data_size);
545  memset(data_ptr, 0, data_size);
546  data = (AcquireControlMessage_data_t *)data_ptr;
548  data->steal_control = ini_steal_control;
549  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
550  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
551  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
552  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
553  add_fieldinfo(IFT_BOOL, "steal_control", 1, &data->steal_control);
554 }
555 /** Constructor */
557 {
558  data_size = sizeof(AcquireControlMessage_data_t);
559  data_ptr = malloc(data_size);
560  memset(data_ptr, 0, data_size);
561  data = (AcquireControlMessage_data_t *)data_ptr;
563  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
564  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
565  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
566  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
567  add_fieldinfo(IFT_BOOL, "steal_control", 1, &data->steal_control);
568 }
569 
570 /** Destructor */
572 {
573  free(data_ptr);
574 }
575 
576 /** Copy constructor.
577  * @param m message to copy from
578  */
580 {
581  data_size = m->data_size;
582  data_ptr = malloc(data_size);
584  data = (AcquireControlMessage_data_t *)data_ptr;
586 }
587 
588 /* Methods */
589 /** Get steal_control value.
590  *
591  If set to true steal the control from someone else who has it
592  atm. Use this with caution. But sometimes it is necessary to
593  ensure a successful operation, e.g. if the agent tries to
594  acquire control.
595 
596  * @return steal_control value
597  */
598 bool
600 {
601  return data->steal_control;
602 }
603 
604 /** Get maximum length of steal_control value.
605  * @return length of steal_control value, can be length of the array or number of
606  * maximum number of characters for a string
607  */
608 size_t
610 {
611  return 1;
612 }
613 
614 /** Set steal_control value.
615  *
616  If set to true steal the control from someone else who has it
617  atm. Use this with caution. But sometimes it is necessary to
618  ensure a successful operation, e.g. if the agent tries to
619  acquire control.
620 
621  * @param new_steal_control new steal_control value
622  */
623 void
625 {
626  data->steal_control = new_steal_control;
627 }
628 
629 /** Clone this message.
630  * Produces a message of the same type as this message and copies the
631  * data to the new message.
632  * @return clone of this message
633  */
634 Message *
636 {
638 }
639 /** @class SkillerInterface::ReleaseControlMessage <interfaces/SkillerInterface.h>
640  * ReleaseControlMessage Fawkes BlackBoard Interface Message.
641  *
642 
643  */
644 
645 
646 /** Constructor */
648 {
649  data_size = sizeof(ReleaseControlMessage_data_t);
650  data_ptr = malloc(data_size);
651  memset(data_ptr, 0, data_size);
652  data = (ReleaseControlMessage_data_t *)data_ptr;
654  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
655  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
656  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
657  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
658 }
659 
660 /** Destructor */
662 {
663  free(data_ptr);
664 }
665 
666 /** Copy constructor.
667  * @param m message to copy from
668  */
670 {
671  data_size = m->data_size;
672  data_ptr = malloc(data_size);
674  data = (ReleaseControlMessage_data_t *)data_ptr;
676 }
677 
678 /* Methods */
679 /** Clone this message.
680  * Produces a message of the same type as this message and copies the
681  * data to the new message.
682  * @return clone of this message
683  */
684 Message *
686 {
688 }
689 /** Check if message is valid and can be enqueued.
690  * @param message Message to check
691  * @return true if the message is valid, false otherwise.
692  */
693 bool
694 SkillerInterface::message_valid(const Message *message) const
695 {
696  const ExecSkillMessage *m0 = dynamic_cast<const ExecSkillMessage *>(message);
697  if ( m0 != NULL ) {
698  return true;
699  }
700  const RestartInterpreterMessage *m1 = dynamic_cast<const RestartInterpreterMessage *>(message);
701  if ( m1 != NULL ) {
702  return true;
703  }
704  const StopExecMessage *m2 = dynamic_cast<const StopExecMessage *>(message);
705  if ( m2 != NULL ) {
706  return true;
707  }
708  const AcquireControlMessage *m3 = dynamic_cast<const AcquireControlMessage *>(message);
709  if ( m3 != NULL ) {
710  return true;
711  }
712  const ReleaseControlMessage *m4 = dynamic_cast<const ReleaseControlMessage *>(message);
713  if ( m4 != NULL ) {
714  return true;
715  }
716  return false;
717 }
718 
719 /// @cond INTERNALS
720 EXPORT_INTERFACE(SkillerInterface)
721 /// @endcond
722 
723 
724 } // end namespace fawkes
fawkes::Interface::data_ptr
void * data_ptr
Definition: interface.h:223
fawkes::SkillerInterface::copy_values
virtual void copy_values(const Interface *other)
Copy values from other interface.
Definition: SkillerInterface.cpp:309
fawkes::SkillerInterface::set_exclusive_controller
void set_exclusive_controller(const uint32_t new_exclusive_controller)
Set exclusive_controller value.
Definition: SkillerInterface.cpp:206
fawkes::SkillerInterface::ReleaseControlMessage::~ReleaseControlMessage
~ReleaseControlMessage()
Destructor.
Definition: SkillerInterface.cpp:665
fawkes::SkillerInterface::RestartInterpreterMessage
Definition: SkillerInterface.h:121
fawkes::SkillerInterface::StopExecMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:531
fawkes::SkillerInterface::AcquireControlMessage::set_steal_control
void set_steal_control(const bool new_steal_control)
Set steal_control value.
Definition: SkillerInterface.cpp:628
fawkes::SkillerInterface::tostring_SkillStatusEnum
const char * tostring_SkillStatusEnum(SkillStatusEnum value) const
Convert SkillStatusEnum constant to string.
Definition: SkillerInterface.cpp:88
fawkes::SkillerInterface::AcquireControlMessage::is_steal_control
bool is_steal_control() const
Get steal_control value.
Definition: SkillerInterface.cpp:603
fawkes::SkillerInterface::RestartInterpreterMessage::RestartInterpreterMessage
RestartInterpreterMessage()
Constructor.
Definition: SkillerInterface.cpp:443
fawkes::SkillerInterface::S_RUNNING
The execution is still running.
Definition: SkillerInterface.h:61
fawkes::Message
Definition: message.h:40
fawkes::SkillerInterface::ExecSkillMessage::maxlenof_skill_string
size_t maxlenof_skill_string() const
Get maximum length of skill_string value.
Definition: SkillerInterface.cpp:406
fawkes::SkillerInterface::ReleaseControlMessage
Definition: SkillerInterface.h:194
fawkes::Message::data_ptr
void * data_ptr
Definition: message.h:124
fawkes::IFT_BOOL
boolean field
Definition: types.h:48
fawkes::SkillerInterface::set_msgid
void set_msgid(const uint32_t new_msgid)
Set msgid value.
Definition: SkillerInterface.cpp:243
fawkes::IFT_ENUM
field with interface specific enum type
Definition: types.h:61
fawkes::Message::data_ts
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:134
fawkes::IFT_UINT32
32 bit unsigned integer field
Definition: types.h:54
fawkes::SkillerInterface::ExecSkillMessage::ExecSkillMessage
ExecSkillMessage()
Constructor.
Definition: SkillerInterface.cpp:355
fawkes::SkillerInterface::maxlenof_skill_string
size_t maxlenof_skill_string() const
Get maximum length of skill_string value.
Definition: SkillerInterface.cpp:117
fawkes::Interface::type
const char * type() const
Get type of interface.
Definition: interface.cpp:643
fawkes::Interface::add_fieldinfo
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the field info list.
Definition: interface.cpp:339
fawkes::SkillerInterface::ReleaseControlMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:689
fawkes::Interface::data_ts
interface_data_ts_t * data_ts
Definition: interface.h:227
fawkes::SkillerInterface::maxlenof_error
size_t maxlenof_error() const
Get maximum length of error value.
Definition: SkillerInterface.cpp:154
fawkes::SkillerInterface::SkillStatusEnum
SkillStatusEnum
This determines the current status of skill execution.
Definition: SkillerInterface.h:53
fawkes::SkillerInterface::maxlenof_exclusive_controller
size_t maxlenof_exclusive_controller() const
Get maximum length of exclusive_controller value.
Definition: SkillerInterface.cpp:192
fawkes::SkillerInterface::S_FINAL
The skill string has been successfully processed.
Definition: SkillerInterface.h:60
fawkes::Message::message_data_ts_t
Timestamp data, must be present and first entries for each interface data structs!...
Definition: message.h:129
fawkes::SkillerInterface::RestartInterpreterMessage::~RestartInterpreterMessage
~RestartInterpreterMessage()
Destructor.
Definition: SkillerInterface.cpp:457
fawkes::TypeMismatchException
Definition: software.h:47
fawkes::Interface::data_changed
bool data_changed
Definition: interface.h:225
fawkes::SkillerInterface::AcquireControlMessage
Definition: SkillerInterface.h:163
fawkes::SkillerInterface::set_error
void set_error(const char *new_error)
Set error value.
Definition: SkillerInterface.cpp:166
fawkes::SkillerInterface::ExecSkillMessage
Definition: SkillerInterface.h:92
fawkes::SkillerInterface::StopExecMessage
Definition: SkillerInterface.h:142
fawkes::UnknownTypeException
Definition: software.h:53
fawkes::SkillerInterface::set_status
void set_status(const SkillStatusEnum new_status)
Set status value.
Definition: SkillerInterface.cpp:278
fawkes::Interface::Interface
Interface()
Constructor.
Definition: interface.cpp:236
fawkes::SkillerInterface::S_FAILED
The execution failed and cannot succeed anymore.
Definition: SkillerInterface.h:62
fawkes
fawkes::SkillerInterface::status
SkillStatusEnum status() const
Get status value.
Definition: SkillerInterface.cpp:256
fawkes::Interface::set_hash
void set_hash(unsigned char *ihash)
Set hash.
Definition: interface.cpp:319
fawkes::Message::data_size
unsigned int data_size
Definition: message.h:125
fawkes::SkillerInterface::ExecSkillMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:431
fawkes::SkillerInterface::AcquireControlMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:639
fawkes::SkillerInterface::msgid
uint32_t msgid() const
Get msgid value.
Definition: SkillerInterface.cpp:220
fawkes::SkillerInterface::create_message
virtual Message * create_message(const char *type) const
Definition: SkillerInterface.cpp:286
fawkes::SkillerInterface::ExecSkillMessage::~ExecSkillMessage
~ExecSkillMessage()
Destructor.
Definition: SkillerInterface.cpp:370
fawkes::SkillerInterface::AcquireControlMessage::AcquireControlMessage
AcquireControlMessage()
Constructor.
Definition: SkillerInterface.cpp:560
fawkes::SkillerInterface::skill_string
char * skill_string() const
Get skill_string value.
Definition: SkillerInterface.cpp:107
fawkes::SkillerInterface::ExecSkillMessage::skill_string
char * skill_string() const
Get skill_string value.
Definition: SkillerInterface.cpp:396
fawkes::SkillerInterface::error
char * error() const
Get error value.
Definition: SkillerInterface.cpp:144
fawkes::Message::add_fieldinfo
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
Definition: message.cpp:404
fawkes::SkillerInterface::maxlenof_status
size_t maxlenof_status() const
Get maximum length of status value.
Definition: SkillerInterface.cpp:266
fawkes::SkillerInterface::set_skill_string
void set_skill_string(const char *new_skill_string)
Set skill_string value.
Definition: SkillerInterface.cpp:130
fawkes::Interface::data_size
unsigned int data_size
Definition: interface.h:224
fawkes::SkillerInterface::ReleaseControlMessage::ReleaseControlMessage
ReleaseControlMessage()
Constructor.
Definition: SkillerInterface.cpp:651
fawkes::SkillerInterface::ExecSkillMessage::set_skill_string
void set_skill_string(const char *new_skill_string)
Set skill_string value.
Definition: SkillerInterface.cpp:419
fawkes::SkillerInterface::AcquireControlMessage::~AcquireControlMessage
~AcquireControlMessage()
Destructor.
Definition: SkillerInterface.cpp:575
fawkes::IFT_STRING
string field
Definition: types.h:59
fawkes::SkillerInterface::exclusive_controller
uint32_t exclusive_controller() const
Get exclusive_controller value.
Definition: SkillerInterface.cpp:182
fawkes::SkillerInterface::AcquireControlMessage::maxlenof_steal_control
size_t maxlenof_steal_control() const
Get maximum length of steal_control value.
Definition: SkillerInterface.cpp:613
fawkes::SkillerInterface::enum_tostring
virtual const char * enum_tostring(const char *enumtype, int val) const
Definition: SkillerInterface.cpp:320
fawkes::Interface::add_messageinfo
void add_messageinfo(const char *name)
Add an entry to the message info list.
Definition: interface.cpp:378
fawkes::SkillerInterface::StopExecMessage::~StopExecMessage
~StopExecMessage()
Destructor.
Definition: SkillerInterface.cpp:507
fawkes::SkillerInterface::RestartInterpreterMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:481
fawkes::SkillerInterface::message_valid
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Definition: SkillerInterface.cpp:698
fawkes::SkillerInterface::maxlenof_msgid
size_t maxlenof_msgid() const
Get maximum length of msgid value.
Definition: SkillerInterface.cpp:230
fawkes::SkillerInterface::StopExecMessage::StopExecMessage
StopExecMessage()
Constructor.
Definition: SkillerInterface.cpp:493
fawkes::SkillerInterface::S_INACTIVE
No skill is running.
Definition: SkillerInterface.h:59