Get rid of Cast into to String message

Juan Luis5 years ago

I know is dumb, but best to avoid the Cast messages that are triggered on track server on the AlarmEventHandler.

Instead of event.set(Position.KEY_ALARM, (String) alarm);
dumb but better event.set(Position.KEY_ALARM, alarm + "");

Anton Tananaev5 years ago

Why?

Juan Luis5 years ago
error - java.lang.Integer cannot be cast to java.lang.String - ClassCastException (AlertEventHandler:52 < BaseEventHandler:29 < BaseDataHandler:27 < ...)
Anton Tananaev5 years ago

Official version without any customization? What protocol? HEX sample?

Juan Luis5 years ago

got it, try for it:

 retranslator < XX.XX.XX.XX] HEX: e7000000333531353130303930383435323539005f1cfb43000000020bbb0000001301036164665f7265675f74696d65005f1cfb440bbb000000130003616c61726d5f73746174757300000000000bbb00000011010361766c5f696e7075747300000000040bbb0000000e0003766f6c7461676500000000060bbb0000000a000367736d00000000040bbb0000000c0003616c61726d00000000000bbb0000001b0004656e67696e65206f7065726174696f6e0000000000000000000bbb0000001200046469676974616c00000000000000f03f0bbb000000110004637573746f6d000000000000005940
Anton Tananaev5 years ago

Looks like the issue is with the original source. Attribute "alarm" has to be a string and there are specific keys.