How can send 1kB


#1

Hi Everybody

I implemented data transver over TCP/IP. I use fcmDataHandler for sending data the another modem but I can’t send highter than 256 bytes how can send 1Kb once a time.

I hope somebody answer this question.


#2

Hi enen,
Did you use eDlib APIs to implement TCP/IP functionality? If this is the case, then you can send the data of length provided by “MaxLen” parameter of ed_RequestCallback_f function in one call to ed_SendDataExt () function. This is because, eDlib internally buffers the data until it receives the acknowlegement of all the data that is sent previously (as is done in TCP/IP protocol to ensure guaranteed delivery of data).

In case, you have implemented your own TCP/IP stack using FCM APIs, then you can send upto 1500 bytes over FCM flow for GPRS. If you use GSM CSD, then there is no limit on the number of bytes that can be sent (the only limitation is posed by the number of bytes that you can allocate to a varaible, either dynamically or locally). In this case, you must give due respect to the credits (i.e. try sending data only after received ADL_FCM_EVEN_MEM_RELEASE event is received in the FCM control handler).

Also try executing your application in target mode instead of debug mode.

Best Regards,
Open AT Fan.


#3

Hi firstly thanks for answer

I have quetions again firstly I wrote my code below.
for sending data I am using this code… I am using ed_sendData command for sending Buffer. But it doesnt’ send upper than 256Bytes.
For detecting data lenght higher than 256 i am using wm_strlen(Data) but it can’t detect.
now what is the way for sending data higher than 256bytes.
bool fcmDataHandler(u16 DataLen,u8 *Data)
{
u8 indis;
for (indis=0;indis<DataLen;indis++)
{
Buffer[BufferIndis++]=Data[indis];
}
return TRUE;
}

for receiving data I am using this code…
u16 DataHnd( u16 DataLen,u8 *Data,TeDHandle id)
{ ascii output_string;
if (DataLen>0)
{
output_string=adl_memGet(DataLen);
wm_memcpy(output_string,Data,DataLen);
adl_fcmSendData(fcm_Handle,(u8
)output_string,DataLen);
adl_memRelease(output_string);
}
return DataLen;
}
void DataRequest(u16 MaxLen,TeDHandle id)
{
}

Best Regards


#4

Hi enen,
While trying to use ed_SendData() to send data to the peer, please check the maximum length of data that you can send (by checking the MaxLen parameter of “DataRequest” function.
You must send the amount of data that is allowed to be send and not more that this.

Whenever you send the data (using ed_SendData() function), the eDlib internally buffers the data to be send and provides a new value for “MaxLen” parameter of “DataRequest” function. This “MaxLen” parameter should be read by the application and in one call to ed_SendData () function, data of length upto “MaxLen” should be sent in one call to ed_SendData () or ed_SendDataExt () function (whichever you are using).

Best Regards,
Open AT Fan.


#5

Hi again

now …if the data over the maximum length edsend can’t send data this is ok. I tried this ;firstly I buffered data in to the fcmdatahandler after that I divided to maximum length and I am trying to send with two or three (it can change depends on data length) packet with edsend but it doesn’t work.

Can you help me how can i send these data…


#6

Hi enen,
You are right to break the data in chunks which can be send by ed_SendData () function.
There are a few points which I would like you to check:

  1. Execute your application in target mode. This is because, in debug mode, there is a problem while trying to send large amount of data.
  2. If you are using a TCP socket, then try using ed_SendDataExt () function instead of using ed_SendData () function.

If this does not solves the problem, you should check the return value of ed_SendDataExt () function to check out the cause of problem.

Best Regards,
Open AT Fan.