Custom feedback to NetLinx
[Deleted User]
Posts: 0
I want to send a String back to NetLinx from CafeDuet. I tried using both 'processAdvancedEvent()' and 'processPassBackEvent()' but I do not seem to be able to get either of them to send a String back on the Virtual Device.
Does anyone have an example on how to SEND_STRING on the virtual device from inside of Cafe Duet so custom feedback can be handled on the NetLinx side?
Does anyone have an example on how to SEND_STRING on the virtual device from inside of Cafe Duet so custom feedback can be handled on the NetLinx side?
0
Comments
That much works for me anyway... I stuggling more with it to send back a command, for example, on a switcher I can ask for the current input with ?INPUT-ALL,1 and get a data event back. What I want is anytime that it switches inputs it automatically sends the data event back. Sure sounds simple, but I sure am lost!
Curt
Trikin
1.Create Duet device in Duet program:
public void handleAdvancedEvent(Event obj) {
if (dvDuet == null)
// initialize dvDuet with DPS from Netlinx code
{
dvDuet = new NetLinxDevice (obj.getDPS(),true);
dvDuet.initialize();
}
switch (obj.type)
{
case Event.E_COMMAND:
{
switch(obj.dataType)
{
case Event.D_STRING8:{
}
}
}
}
System.out.println(dvDuet.getDPS().toString());
}
2. Send command from NetLinx code for initialize.
3. Now you can send customize feedbacks from Duet module.
dvDuet.sendString("Something");
Curt
Trikin
public void handleAdvancedEvent(Event obj) {
log(DEBUG, "Advanced event entered");
NetLinxDevice testDevice= new NetLinxDevice(obj.getDPS(), true);
log(DEBUG, "Test device created at ["+logDevice.getDPS().toString()+"]");
testDevice.sendString("Some random string");
testDevice.sendCommand("Some random command");
At this point, the advanced events that I have programmed are getting fired off correctly, however I am not seeing any of the log messages, nor am I seeing any commands or strings being reported back from the virtual device in the Notifications pane in NetLinx Studio and the DATA_EVENT to handle the strings and commands from the virtual device are not executing either.
Try this:
NetLinxDevice testDevice= new NetLinxDevice(obj.getDPS(), true);
testDevice.initilize();
testDevice.sendString("Some random string");
testDevice.sendCommand("Some random command");