LrJposChannel.getHeader

Gets the header that is set for the channel.

public static byte[] getHeader()

Return values

This function returns a byte array that represents the defined channel header.

General information

If the LrJposChannel.setOverrideHeader property is set to true, the defined channel header overrides the message header. If not, the channel header is not used.

Example

Copy code
public void simpleISOtest() throws Throwable{
        
        GenericPackager packager = new GenericPackager(PACKAGERCONFIGFILE);
        LrJposChannel.initChannel(LrJposChannel.ChannelType.ASCIIChannel, "localhost", 8000, packager);
        LrJposChannel.setHeader("newHeader");
        
        LrJposChannel.connect();
        
        LrISOMsg m = new LrISOMsg();
        m.setMTI("0100");
        m.set(ISO87Fields.PAN_PRIMARY_ACCOUNT_NUMBER, "1234567890000000000")
        m.set(3, "523456")
        m.set(4, "123456789121")
        m.set(12, "20241605108110");  
        m.set(47, "32432")

        LrJposChannel.send(m);
        
        LrISOMsg r = LrJposChannel.receive();
        if (r!=null) {
            lr.output_message(r.getMTI());
        }
        
        byte[] currentHeader = LrJposChannel.getHeader();

        LrJposChannel.disconnect();
        LrJposChannel.closeChannel();
}