I think im starting to understand it....in arduino SerialGateway i read inputs in void serialEvent() method right? Im using PiGatewaySerial as a gateway, but im lost witch method supose to read inputs, maybe gw->parseAndSend(buff) is used for sending commands. So i have to read commands from pty_master?