<div dir="ltr">Got it I was missing the below:<br><pre><code>#ifdef _WIN32
#define __attribute__(x)
#pragma pack(push, 1)
#ifdef _WIN32
#pragma pack(pop)
#endif</code></pre><br><div>for now in the function i have<br><br>int nFreq;<br><br><br>#define COMM_SET_FREQ ((unsigned char) 0x01)<br><br>#ifdef _WIN32<br>#define __attribute__(x)<br>#pragma pack(push, 1)<br>#endif<br>
struct command{<br> unsigned char cmd;<br> unsigned int param;<br>}__attribute__((packed));<br>#ifdef _WIN32<br>#pragma pack(pop)<br>#endif<br><br><br><br>void sendCommand(unsigned char cmds, unsigned int parami) {<br> int left;<br>
int sent;<br> int retr = 0;<br> struct command cmd={cmds, htonl(parami)};<br><br> left=sizeof(cmd);<br> while(left >0) {<br> //start the funtion of winsock dll<br> int answer;<br>
WSAData wsaData;<br> WORD DLLVersion;<br> DLLVersion = MAKEWORD(2,1);<br> answer = WSAStartup(DLLVersion, &wsaData);<br> SOCKADDR_IN addr;<br>
int addrlen = sizeof(addr);<br> //setup socket<br> SOCKET sConnect;<br> // internet family of connection oriented socket<br>
sConnect = socket(AF_INET, SOCK_STREAM,NULL);<br> //configure the strucket it addre <br> addr.sin_addr.s_addr = inet_addr("127.0.0.1");<br>
//Now we have to retype the faimly<br> addr.sin_family = AF_INET;<br> // set port google htons<br> addr.sin_port = htons(1234);<br>
// no we have to type in the client should connect to tthe server<br> connect(sConnect, (SOCKADDR*)&addr, sizeof(addr));<br> answer = send(sConnect, (char*)&cmd+(sizeof(cmd)-left), left, 0); <br>
<br> cout << (char*)&cmd+(sizeof(cmd)-left) <<endl;<br> closesocket(sConnect);<br> return;<br> }<br>}<br><br></div><div>Works perfectly. Thanks every one for the help.<br>
</div><div><br></div><div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Chris Svendsen</b> <span dir="ltr"><<a href="mailto:csvendsen2143@gmail.com">csvendsen2143@gmail.com</a>></span><br>
Date: Mon, Mar 25, 2013 at 1:10 PM<br>Subject: RTL_TCP Commands<br>To: <a href="mailto:osmocom-sdr@lists.osmocom.org">osmocom-sdr@lists.osmocom.org</a><br><br><br><div dir="ltr"><div>Sending commands to RTL_TCP<br>What format do the commands need to be in order to change the frequency of RTL_TCP.<br>
</div><div>I have tried the following and the frequency will change but no to the frequency that is expected for example:<br>
<br><br></div><div>This code :<br></div><div><br> char SET_FREQUENCY[] ={0x01};<br> string Freq = string(SET_FREQUENCY,1)+"500000000";<br> answer = send(sConnect,Freq.c_str(),11,0);<br><br></div><div>Changes the freq to this:<br>
<br>client accepted!<br>set freq 892350512<br>ll+, now 1<br>ll+, now 2<br><br></div><div>Any help would be greatly appreciated as i have been stuck on this for days.<br><br></div><div><br></div><div>Thanks<br><br></div><div>
<br><br><br></div><div><br></div><br></div>
</div><br></div></div>