Ejemplo n.º 1
0
GYVOID GYGatewaySession::SendPacket(const GYGUID& guid, const GYPacketInteface& packet)
{
	m_connection.Send();
	GYStreamSerialization<GATEWAY_SESSION_SEND_BUFFER_LEN> packetSender(m_connection.m_outputBuffer, EM_SERIALIZAION_MODE_WRITE);
	packetSender << const_cast<GYGUID&>(guid);
	packetSender << const_cast<GYPacketInteface&>(packet);
	m_allSendDataSize += packetSender.GetSerializDataSize();
	GYAssert(m_connection.m_outputBuffer.GetWriteSize() > 0);
}
Ejemplo n.º 2
0
void ncopy(const char* port, int studentNo, int nfiles, char* file[]) 
{
    SerialPort serialPort(port);
    PacketSender packetSender(&serialPort);

    if (serialPort.Setup() != ERR_NONE) {
       eggog("Error: cannot open %s\n", port);
    }

    for (int i = 0; i < nfiles; i++) {
        sendFile(file[i], packetSender, studentNo);
    }

    info("ncopy done\n");
}