Sending Data Via TCP/IP modem to modem


#1

Hello,

anyone have any help on how I might be able to send a packet of data from modem and recieve using a modem?

Thanks

Samuel


#2

Hi Samuel,
I assume that you are using eDlib to establish the TCP socket connection.
First of all you need to activate the IP connection of your module with the service provider. This, you can do using ed_DialupConnectionStart (). Then, you need to set the parameters for the socket you need to start using ed_SocketSetConfig () API. To start a particular kind of socket, use ed_SocketTCPStart () API.

When you receive, ED_INFO_WAITING_FOR_DATA event in the control handler function for the TCP, you can be sure that the socket is now created.

Now, to send data over the established socket, you need to call ed_SendDataExt () function. This function takes the amount of data to be sent, the pointer to data to be sent and the ID of the service (TCP socket number which is active).
The sent data will be received in the data handler function of the peer (this data handler function is the one that you specify while calling ed_SocketTCPStart () function on the peer).
Similarly, data sent by your peer to you will be received in the data handler function of your module.

Hope this information helps. You should refer to the TCP/IP user guide for more information on how to send/receive data.

Best Regards,
Open AT Fan.