24 #include <interfaces/DynamicReconfigureInterface.h>
26 #include <core/exceptions/software.h>
46 DynamicReconfigureInterface::DynamicReconfigureInterface() : Interface()
48 data_size =
sizeof(DynamicReconfigureInterface_data_t);
50 data = (DynamicReconfigureInterface_data_t *)
data_ptr;
53 enum_map_LastMsgStatus[(int)Succeeded] =
"Succeeded";
54 enum_map_LastMsgStatus[(int)Failed] =
"Failed";
63 add_fieldinfo(
IFT_ENUM,
"last_msg_status", 1, &data->last_msg_status,
"LastMsgStatus", &enum_map_LastMsgStatus);
69 unsigned char tmp_hash[] = {0xe2, 0xc2, 0x78, 0x4a, 0x9f, 0x90, 0x36, 0x57, 0xeb, 0x26, 0x9, 0xe0, 0xe8, 0x77, 0xcd, 0x9d};
74 DynamicReconfigureInterface::~DynamicReconfigureInterface()
86 case Succeeded:
return "Succeeded";
87 case Failed:
return "Failed";
88 default:
return "UNKNOWN";
99 return data->last_service;
119 strncpy(data->last_service, new_last_service,
sizeof(data->last_service)-1);
120 data->last_service[
sizeof(data->last_service)-1] = 0;
131 return data->last_parameter;
151 strncpy(data->last_parameter, new_last_parameter,
sizeof(data->last_parameter)-1);
152 data->last_parameter[
sizeof(data->last_parameter)-1] = 0;
163 return data->last_bool_value;
183 data->last_bool_value = new_last_bool_value;
194 return data->last_str_value;
214 strncpy(data->last_str_value, new_last_str_value,
sizeof(data->last_str_value)-1);
215 data->last_str_value[
sizeof(data->last_str_value)-1] = 0;
226 return data->last_uint32_value;
246 data->last_uint32_value = new_last_uint32_value;
257 return data->last_uint64_value;
277 data->last_uint64_value = new_last_uint64_value;
288 return data->last_float_value;
308 data->last_float_value = new_last_float_value;
319 return data->last_msg_id;
339 data->last_msg_id = new_last_msg_id;
370 data->last_msg_status = new_last_msg_status;
378 if ( strncmp(
"SetBoolMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
379 return new SetBoolMessage();
380 }
else if ( strncmp(
"SetStringMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
381 return new SetStringMessage();
382 }
else if ( strncmp(
"SetUint32Message",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
383 return new SetUint32Message();
384 }
else if ( strncmp(
"SetUint64Message",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
385 return new SetUint64Message();
386 }
else if ( strncmp(
"SetFloatMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
387 return new SetFloatMessage();
389 throw UnknownTypeException(
"The given type '%s' does not match any known "
390 "message type for this interface type.",
type);
401 const DynamicReconfigureInterface *oi = dynamic_cast<const DynamicReconfigureInterface *>(other);
404 type(), other->type());
406 memcpy(data, oi->data,
sizeof(DynamicReconfigureInterface_data_t));
412 if (strcmp(enumtype,
"LastMsgStatus") == 0) {
413 return tostring_LastMsgStatus((LastMsgStatus)val);
433 data_size =
sizeof(SetBoolMessage_data_t);
436 data = (SetBoolMessage_data_t *)
data_ptr;
438 strncpy(data->service, ini_service, 64-1);
439 data->service[64-1] = 0;
440 strncpy(data->parameter, ini_parameter, 64-1);
441 data->parameter[64-1] = 0;
442 data->value = ini_value;
443 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
444 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
452 data_size =
sizeof(SetBoolMessage_data_t);
455 data = (SetBoolMessage_data_t *)
data_ptr;
457 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
458 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
478 data = (SetBoolMessage_data_t *)
data_ptr;
490 return data->service;
510 strncpy(data->service, new_service,
sizeof(data->service)-1);
511 data->service[
sizeof(data->service)-1] = 0;
521 return data->parameter;
541 strncpy(data->parameter, new_parameter,
sizeof(data->parameter)-1);
542 data->parameter[
sizeof(data->parameter)-1] = 0;
572 data->value = new_value;
599 data_size =
sizeof(SetStringMessage_data_t);
602 data = (SetStringMessage_data_t *)
data_ptr;
604 strncpy(data->service, ini_service, 64-1);
605 data->service[64-1] = 0;
606 strncpy(data->parameter, ini_parameter, 64-1);
607 data->parameter[64-1] = 0;
608 strncpy(data->value, ini_value, 64-1);
609 data->value[64-1] = 0;
610 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
611 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
619 data_size =
sizeof(SetStringMessage_data_t);
622 data = (SetStringMessage_data_t *)
data_ptr;
624 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
625 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
645 data = (SetStringMessage_data_t *)
data_ptr;
657 return data->service;
677 strncpy(data->service, new_service,
sizeof(data->service)-1);
678 data->service[
sizeof(data->service)-1] = 0;
688 return data->parameter;
708 strncpy(data->parameter, new_parameter,
sizeof(data->parameter)-1);
709 data->parameter[
sizeof(data->parameter)-1] = 0;
739 strncpy(data->value, new_value,
sizeof(data->value)-1);
740 data->value[
sizeof(data->value)-1] = 0;
767 data_size =
sizeof(SetUint32Message_data_t);
770 data = (SetUint32Message_data_t *)
data_ptr;
772 strncpy(data->service, ini_service, 64-1);
773 data->service[64-1] = 0;
774 strncpy(data->parameter, ini_parameter, 64-1);
775 data->parameter[64-1] = 0;
776 data->value = ini_value;
777 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
778 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
786 data_size =
sizeof(SetUint32Message_data_t);
789 data = (SetUint32Message_data_t *)
data_ptr;
791 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
792 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
812 data = (SetUint32Message_data_t *)
data_ptr;
824 return data->service;
844 strncpy(data->service, new_service,
sizeof(data->service)-1);
845 data->service[
sizeof(data->service)-1] = 0;
855 return data->parameter;
875 strncpy(data->parameter, new_parameter,
sizeof(data->parameter)-1);
876 data->parameter[
sizeof(data->parameter)-1] = 0;
906 data->value = new_value;
933 data_size =
sizeof(SetUint64Message_data_t);
936 data = (SetUint64Message_data_t *)
data_ptr;
938 strncpy(data->service, ini_service, 64-1);
939 data->service[64-1] = 0;
940 strncpy(data->parameter, ini_parameter, 64-1);
941 data->parameter[64-1] = 0;
942 data->value = ini_value;
943 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
944 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
952 data_size =
sizeof(SetUint64Message_data_t);
955 data = (SetUint64Message_data_t *)
data_ptr;
957 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
958 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
978 data = (SetUint64Message_data_t *)
data_ptr;
990 return data->service;
1010 strncpy(data->service, new_service,
sizeof(data->service)-1);
1011 data->service[
sizeof(data->service)-1] = 0;
1021 return data->parameter;
1041 strncpy(data->parameter, new_parameter,
sizeof(data->parameter)-1);
1042 data->parameter[
sizeof(data->parameter)-1] = 0;
1072 data->value = new_value;
1099 data_size =
sizeof(SetFloatMessage_data_t);
1102 data = (SetFloatMessage_data_t *)
data_ptr;
1104 strncpy(data->service, ini_service, 64-1);
1105 data->service[64-1] = 0;
1106 strncpy(data->parameter, ini_parameter, 64-1);
1107 data->parameter[64-1] = 0;
1108 data->value = ini_value;
1109 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
1110 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
1118 data_size =
sizeof(SetFloatMessage_data_t);
1121 data = (SetFloatMessage_data_t *)
data_ptr;
1123 enum_map_LastMsgStatus[(int)
Succeeded] =
"Succeeded";
1124 enum_map_LastMsgStatus[(int)
Failed] =
"Failed";
1144 data = (SetFloatMessage_data_t *)
data_ptr;
1156 return data->service;
1176 strncpy(data->service, new_service,
sizeof(data->service)-1);
1177 data->service[
sizeof(data->service)-1] = 0;
1187 return data->parameter;
1207 strncpy(data->parameter, new_parameter,
sizeof(data->parameter)-1);
1208 data->parameter[
sizeof(data->parameter)-1] = 0;
1238 data->value = new_value;
1258 const SetBoolMessage *m0 = dynamic_cast<const SetBoolMessage *>(message);
1262 const SetStringMessage *m1 = dynamic_cast<const SetStringMessage *>(message);
1266 const SetUint32Message *m2 = dynamic_cast<const SetUint32Message *>(message);
1270 const SetUint64Message *m3 = dynamic_cast<const SetUint64Message *>(message);
1274 const SetFloatMessage *m4 = dynamic_cast<const SetFloatMessage *>(message);
1282 EXPORT_INTERFACE(DynamicReconfigureInterface)