use of sugar.free.sightparser.authlayer.DataMessage in project SightRemote by TebbeUbben.
the class AppLayerProcessor method onOutboundMessage.
@Override
public void onOutboundMessage(Object message, Pipeline pipeline) throws Exception {
if (!(message instanceof AppLayerMessage))
return;
Log.d("SightService", "SEND: " + message.getClass());
DataMessage dataMessage = new DataMessage();
dataMessage.setData(((AppLayerMessage) message).serialize());
pipeline.send(dataMessage);
Answers.getInstance().logCustom(new CustomEvent("Sent Application Layer Message").putCustomAttribute("Message", message.getClass().getSimpleName()));
}
use of sugar.free.sightparser.authlayer.DataMessage in project SightRemote by TebbeUbben.
the class AppLayerProcessor method onInboundMessage.
@Override
public void onInboundMessage(Object message, Pipeline pipeline) throws Exception {
if (!(message instanceof DataMessage))
return;
DataMessage dataMessage = (DataMessage) message;
ByteBuf byteBuf = new ByteBuf(dataMessage.getData().length);
byteBuf.putBytes(dataMessage.getData());
AppLayerMessage appLayerMessage = AppLayerMessage.deserialize(byteBuf);
Log.d("SightService", "RECEIVE: " + appLayerMessage.getClass());
pipeline.receive(appLayerMessage);
Answers.getInstance().logCustom(new CustomEvent("Received Application Layer Message").putCustomAttribute("Message", appLayerMessage.getClass().getSimpleName()));
}
Aggregations