TCP/IP client Ack back


#1

Hey there guys Ok so i have been doing some reading on the forums but no luck. I know this topic has been brought up before but this was a while ago and dont think there was the WIP library then.gotta make multiple posts as problem when posting stuff too large, no idea why. wmp100, R74a00-cus-wmp-01 is firmware


#2

Anyway, what i have implemented is a Boot loader server (TCP Server) using c# and MSSQL which records all important data. The unit in the field logs in daily checking for new updates, this occurs over gprs. This all works 100% however i need to use a similar procedure to implement on a TCP server of which i have no control over the protocol. So i therefore need some sort of Ack from the network (MTN). I am not too keen using a timeout as this means a worse throughput, surely there is some sort of AT command of some sort to view if the packet was sent 100% without errors. I know TCP should handle all this but i need a DEF reply to me to confirm this.

MANY thanks :slight_smile:
Dave


#3

wmp100, R74a00-cus-wmp-01 is firmware, cant edit post above


#4

See: https://forum.sierrawireless.com/t/forum-broken/4278/27


#5

ooo thanks! it worked https FTW hehe


#6

Jolly good!

Now can you explain a bit more clearly what you’re actually trying to achieve here?


#7

yes i can :slight_smile: now that dont have to cut my post shorter hehe. Anyway the problem is that i have no way of reading the Ack returned to me from the server to confirm to me that all was succeeded. Using the code provided to write to my TCP Server :

case WIP_CEV_WRITE:
		  {
			int nwrite;

			wip_debug ("[SAMPLE] Can send more data\n");
			nwrite = wip_write( ev->channel, snd_buffer + snd_offset,sizeof( snd_buffer) - snd_offset);
			
			if( nwrite < 0)
			{
				wip_debug( "[SAMPLE] write error %i\n", nwrite); return;
			}

			snd_offset += nwrite;

			if( snd_offset == sizeof( snd_buffer))
			{
			  wip_debug( "[SAMPLE] Everything has been sent, won't send more.\n");
			}

			else
			{
			  wip_debug( "[SAMPLE] Wrote %i bytes. "
						 "%i bytes left to send in snd_buffer\n",
						 nwrite, sizeof( snd_buffer) - snd_offset);
			}
			break;
		  }

Do i need to just accept that once snd_offset == sizeof( snd_buffer) everything should have been received to the server due it being connection orientated as its tcp? or is there some way i can access the very low level to be able to read each packet being acked?


#8

Doesn’t the server give you any kind of response to indicate that it’s got your request??


#9

well thats the problem, this is too low level so cant see it at that detail. Using my TCP server (ADSL) i reply and i receive (TCP client, GPRS) it perfectly. However i need to be able to see the ack if possible. Ifi do not send anything back from the server it just sits there waiting until timeout. If the server sends something its the actual payload but no ack. If u want i can show what i send and receive via prnt screens etc.

thanks a stack for the help!


#10

Exactly - so, if you get the payload, the server received your request; if you don’t get the payload, the server didn’t get your request.

I can’t really see where access to the low-level TCP stuff will help?

Any TCP errors will be reported via a WIP_CEV_ERROR event…


#11

that is very true about the WIP_CEV_ERROR… when i said i get the payload back… im talking bout the scenario where i can control the protocol ie. i have written the TCP server… thanks again man. For now im just looking if WIP_CEV_ERROR is called. I though we could actually view the ack or not