Ejemplo n.º 1
0
Uptime_t DummyTx::transmit( const Lpdu& lpdu)
{
    char buf[Lpdu::MAX_LEN*3+1];
    assert(lpdu.ab.size() >= 10);
    lastTxBytes = lpdu.ab;
    if (*debug_p > 0)
        printf( "%s Tx %s\n", n, hex_repr( lpdu.ab, buf,sizeof(buf)));
    numTxs++;
    return 0;
}
Ejemplo n.º 2
0
Uptime_t CustomInter::transmit( const Lpdu& lpdu)
{
    char buf[MAX_LEN*3+1];
    assert(lpdu.ab.size() >= 10);
    lastTxBytes = lpdu.ab;
    if (*debug_p > 0)
	printf( "%s Tx %s\n", n, hex_repr(lpdu.ab, buf,sizeof(buf)));

	char buf_to_send[MAX_LEN*3+1];

	for(unsigned int i = 0; i < lpdu.ab.size(); i++)
    {
        buf_to_send[i] = lpdu.ab[i];
    }

	if(!write(socket, (const char*)buf_to_send, lpdu.ab.size(), 15))
	{
		//Error
		return 1;
	}

    numTxs++;
    return 0;
}