Commit 71c4b609 authored by jcaceres's avatar jcaceres
Browse files

more updates

parent 64e9f5c7
......@@ -82,11 +82,13 @@ UDPInput::rcv (char *buf)
datapart = packetData + sizeof (nsHeader);//JPC JLink***********************************
//byteSwap(datapart, wholeSize);
memcpy (buf, datapart, bpp);
//PRC("DATA INPUT ++++ ", &packetData[20]);
//###############JPC JLink#######################
// Binary print function
//unsigned short caca = 0xFFFF;
//PR("header in binary 44 ==============: ", ETX_44KHZ | ETX_XTND);
//PR("header in binary 24 ==============: ", ETX_RATE_MASK(ETX_24KHZ | ETX_XTND));
//PR("header in binary 22 ==============: ", ETX_RATE_MASK( ETX_22KHZ | ETX_XTND));
//PR("header in binary 8 ==============: ", ETX_RATE_MASK(ETX_8KHZ | ETX_XTND));
......
......@@ -101,6 +101,11 @@ UDPOutput::send (char *buf)
//###################################
//((nsHeader *) packetData)->i_head = packetIndex;//JPC JLink***********************************
// use this without byteswap
//((nsHeader *) packetData)->i_head = 16384;//JPC JLink***********************************
//use this with byteswap
((nsHeader *) packetData)->i_head = 64;//JPC JLink***********************************
//((nsHeader *) packetData)->i_cksum = 4;//JPC JLink***********************************
//((nsHeader *) packetData)->i_seq = packetIndex;//JPC JLink***********************************
//((nsHeader *) packetData)->i_rtnseq = 6;//JPC JLink***********************************
......@@ -127,6 +132,9 @@ UDPOutput::send (char *buf)
//PR("HEADER#############: ", caca);
memcpy (datapart, buf, bpp);
//PRC("buf ========== ", &buf[0]);
//PRC("datapart ===== ", &datapart[0]);
//PRC("packetData === ", &packetData[2]);
//cout << "sizeof (nsHeader): " << sizeof(ETX_XTND) << endl;
//cout << "sizeof(packetData): " << sizeof(packetData) << endl;
......@@ -140,16 +148,33 @@ UDPOutput::send (char *buf)
// sock->peerPort ());//***JPC Port to qt4*****************
// Quick hack to get the same header that I get in udp_input
((nsHeader *) packetData)->i_head = 64;//JPC JLink***********************************
//PR("HEADER OUTPUT============= ", ((nsHeader *) packetData)->i_head);
//cout << (signed short) 0xfffd << endl;
//cout << ETX_44KHZ << endl;
//PRC("packetDataBEFORE ========== ", &packetData[50]);
//PRC("packetDataBEFORE ========== ", &packetData[51]);
//byteSwap(packetData, wholeSize);//JPC JLink***********************************
//PRC("packetDataAFTER ========== ", &packetData[50]);
//PRC("packetDataAFTER ========== ", &packetData[51]);
//for (int caca = 0; caca<40; caca++) {
//cout << *((signed short *) packetData+6) << endl;
//}
byteSwap(packetData, wholeSize);//JPC JLink***********************************
//cout << *((signed short *) packetData+2) << endl;
//((nsHeader *) packetData)->i_head = ETX_XTND | ETX_24KHZ;//JPC JLink***********************************
//((nsHeader *) packetData)->i_head = ETX_48KHZ;//JPC JLink***********************************
//PRC("HEADER=============", &packetData[128]);
int rv = sock->writeDatagram (packetData, wholeSize,//***JPC Port to qt4*****************
sock->peerAddress (),//***JPC Port to qt4*****************
sock->peerPort ());//***JPC Port to qt4*****************
//PRC("packetDataBS== ", &packetData[2]);
//cout << "WRITING!!!!!!!!!!! " << rv <<" "<< QString(sock->peerName ()).latin1() << " " << sock->peerPort ()<< endl;
return rv;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment