Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Fix event compat issues (#492) ... (#531)
Browse files Browse the repository at this point in the history
with device servers exporting Device_4 devices.
Fix bug with Pipe, Data Ready and Device Interface Change events.
Fix event channel name issues in these different cases.
  • Loading branch information
bourtemb authored Feb 27, 2019
1 parent 2886a7f commit 3fbe75d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
20 changes: 17 additions & 3 deletions cppapi/server/eventcmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ DevVarLongStringArray *DServer::zmq_event_subscription_change(const Tango::DevVa
ret_data->svalue.length(2);

ret_data->lvalue.length(1);
ret_data->lvalue[0] = (Tango::DevLong)tg->get_tango_lib_release();;
ret_data->lvalue[0] = (Tango::DevLong)tg->get_tango_lib_release();

ZmqEventSupplier *ev;
if ((ev = tg->get_zmq_event_supplier()) != NULL)
Expand Down Expand Up @@ -1073,8 +1073,22 @@ DevVarLongStringArray *DServer::zmq_event_subscription_change(const Tango::DevVa
size_t size = ret_data->svalue.length();
ret_data->svalue.length(size + 2);

string event_topic =
ev->create_full_event_name(dev, EVENT_COMPAT_IDL5 + event, obj_name_lower, intr_change);
string event_topic = "";
bool add_compat_info = false;
if ((event != EventName[PIPE_EVENT]) &&
(event != EventName[INTERFACE_CHANGE_EVENT]) &&
(event != EventName[DATA_READY_EVENT]))
{
add_compat_info = true;
}
if(client_release >= 5 && add_compat_info) // client_release here is the minimum of the client release and dev IDL version
{
event_topic = ev->create_full_event_name(dev, EVENT_COMPAT_IDL5 + event, obj_name_lower, intr_change);
}
else
{
event_topic = ev->create_full_event_name(dev, event, obj_name_lower, intr_change);
}
assert(!(event_topic.empty()));
cout4 << "Sending event_topic = " << event_topic << endl;
ret_data->svalue[size] = Tango::string_dup(event_topic.c_str());
Expand Down
2 changes: 0 additions & 2 deletions cppapi/server/eventsupplier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,6 @@ EventSupplier::push_att_data_ready_event(DeviceImpl *device_impl, const string &
vector<long> filterable_data_lg;

string ev_type(DATA_READY_TYPE_EVENT);
ev_type = EVENT_COMPAT_IDL5 + ev_type;

AttDataReady dat_ready;
dat_ready.name = attr_name.c_str();
Expand Down Expand Up @@ -2560,7 +2559,6 @@ void EventSupplier::push_dev_intr_change_event(DeviceImpl *device_impl,
vector<long> filterable_data_lg;

string ev_type(EventName[INTERFACE_CHANGE_EVENT]);
ev_type = EVENT_COMPAT_IDL5 + ev_type;
time_t now, dev_intr_subscription;

//
Expand Down
2 changes: 0 additions & 2 deletions cppapi/server/pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,6 @@ void Pipe::fire_event(DeviceImpl *dev,DevFailed *except)
vector<long> f_data_lg;

string event_type("pipe");
event_type = EVENT_COMPAT_IDL5 + event_type;
event_supplier_zmq->push_event(dev, event_type, f_names, f_data, f_names_lg, f_data_lg, ad, name, except, true);
}

Expand Down Expand Up @@ -858,7 +857,6 @@ void Pipe::fire_event(DeviceImpl *dev,DevicePipeBlob *p_data,struct timeval &t,b
vector<long> f_data_lg;

string event_type("pipe");
event_type = EVENT_COMPAT_IDL5 + event_type;
event_supplier_zmq->push_event(dev, event_type, f_names, f_data, f_names_lg, f_data_lg, ad, name, NULL, true);

if (reuse_it == false)
Expand Down

0 comments on commit 3fbe75d

Please sign in to comment.