Problem with WIP UDP


#1

Hi everyone !! Got a little problem with WIP UDP
WIP TCP and PING works perfectly but I am unable to send data through UDP

Here is shortly what I do …

wip_channel_t udp_socket; // global variable

typedef struct
{
u16 nPortTo;
u16 nPortFrom;
u32 nIpTo;
u32 nIpFrom;
} gprs_IpPort_t;

gprs_IpPort_t gprs_IpPort; // global

//Creation of udp socket*
void udp_socketCreate(void)
{
wip_bearerGetOpts(gprs_bearer,WIP_BOPT_IP_ADDR,&(gprs_IpPort.nIpFrom),WIP_BOPT_END);
gprs_IpPort.nPortFrom = 7776

udp_socket = wip_UDPCreateOpts( udp_evh, NULL, 
					WIP_COPT_ADDR,gprs_IpPort.nIpFrom,
					WIP_COPT_PORT,gprs_IpPort.nPortFrom, 
					WIP_COPT_SND_BUFSIZE,900,
					WIP_COPT_RCV_BUFSIZE,900,
					WIP_COPT_END);

}
//*****************************************************

socket is created, no errors , WIP_CEV_OPEN event received

//sending data*****
//** AT+SUDP handler
{
int nwrite,
nlen; // length of the text
u8 *cBuff // text to send…

// …
//read parameters
// allocate cBuff
// …

nwrite = wip_writeOpts( udp_socket, cBuff,nlen ,
WIP_COPT_PEER_ADDR, gprs_IpPort.nIpTo,
WIP_COPT_PEER_PORT, gprs_IpPort.nPortTo,
WIP_COPT_END);

adl_memRelease(cBuff);
}
//*************************************************

the return value of writeOpts (nwrite) is by 19 greater than the length of data(nlen), but nothing is received by the peer.
I really don’t know what could be the problem :frowning: cause when I make UDP packets by myself and send them through adl_fcmSendData everything works fine…

Can anybody help me ??

THX