LrJposChannel.addIncomingFilter
Adds a filter to the incoming filters list. The filters can modify an incoming message.
public static void addIncomingFilter(ISOFilter filter)
Parameters
filter: The new filter to add to the list.
Return values
This function does not return any values.
Example
public void filterTest() throws Throwable{
//register channel
LrJposChannel.setName("MyProduct-JposChannel");
//creating filter
ChannelInfoFilter filter = new ChannelInfoFilter();
Properties props = new Properties();
props.put("channel-name","47"); //" MyProduct-JposChannel " will be set in field 47
props.put("socket-info", "48"); //socket info will be set in field 48
filter.setConfiguration(new SimpleConfiguration(props));
//adding filter to channel
LrJposChannel.addFilter(filter);
// LrJposChannel.addIncomingFilter(filter);
// LrJposChannel.addOutgoingFilter(filter);
LrISOMsg m = new LrISOMsg();
m.setMTI("0100");
m.set(2, "1234567890000000000");
m.set(3, "523456");
m.set(4, "123456789121");
m.set(12, "20241605108110");
LrJposChannel.send(m);
LrISOMsg r = LrJposChannel.receive();
LrJposChannel.removeFilter(filter);
// LrJposChannel.removeIncomingFilter(filter);
// LrJposChannel.removeOutgoingFilter(filter);
}