Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » Unable to receive Events(itemCommandEvent,ItemStateEvent) from ESH
Unable to receive Events(itemCommandEvent,ItemStateEvent) from ESH [message #1792952] Thu, 26 July 2018 12:33 Go to next message
Paramesh  Surakod is currently offline Paramesh SurakodFriend
Messages: 15
Registered: January 2018
Junior Member
Hi sir,

I am trying to receive the events using the ESH Event Bus through the following method. I Followed the instructions from the Event Section of ESH Documentation.

public class CloudService implements ActionService, CloudClientListener, EventSubscriber {
...........


@Override
public void receive(Event event) {
String topic = event.getTopic();
String type = event.getType();
String payload = event.getPayload();
if (event instanceof ItemCommandEvent) {
ItemCommandEvent itemCommandEvent = (ItemCommandEvent) event;
String itemName = itemCommandEvent.getItemName();
Command command = itemCommandEvent.getItemCommand();
// ...
} else if (event instanceof ItemStateEvent) {
ItemStateEvent itemStateEvent = (ItemStateEvent) event;
// ...
}
else if (event instanceof ItemStateChangedEvent) {
ItemStateChangedEvent ItemStateChangedEvent = (ItemStateChangedEvent) event;
// ...
}
}
}


The above code works only for "ItemStateEvent".

I would like to get all event types.

Please help me to resolve this issue.

Thanks
Re: Unable to receive Events(itemCommandEvent,ItemStateEvent) from ESH [message #1792989 is a reply to message #1792952] Fri, 27 July 2018 06:06 Go to previous message
Paramesh  Surakod is currently offline Paramesh SurakodFriend
Messages: 15
Registered: January 2018
Junior Member
Sorry for the inconvenience sir by mistake i have posted here.
Previous Topic:Use TLS for IN-CSE and MN-CSE communication
Next Topic:coap Response byte structure
Goto Forum:
  


Current Time: Thu Dec 26 13:07:55 GMT 2024

Powered by FUDForum. Page generated in 0.04433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top