Create a bearer

Hi all,

We try to create a TCP / IP server on the Fastrack to create a communication between him and our environment on a LAN server. But for this we need to define a Bearer and configure network settings of Fastrack. We chose the Bearer Ethernet to communicate with the module channel.

We come to create the Bearer and dynamically configured using DHCP network settings in the template we based TCP Server provided in the IDE. However, the IP address must be Fastrack statically configured. And it is at this level that it blocks.

We are good at creating the Bearer and calling the wip_bearerSetOpts function does not return an error. However, the network parameters applied are not those that we have provided.

Here the dynamic and static configurations we conducted and the results of program execution:

Dynamic :

ret = wip_bearerSetOpts ( Bearer_Handle,

                                  WIP_BOPT_ETH_ADDR, &mac_addr,

                                  WIP_BOPT_IP_DHCP, TRUE,

                                  WIP_BOPT_END );

Result: Ethernet bearer started
Applied settings: Local: 192.168.0.209 Netmask: 255.255.255.0 Default gateway: 192.168.0.1 DNS1: 194.2.0.20 DNS2: 194.2.0.50
Server created and listening on port 2000

Static :

wip_in_addr_t static_ip_addr = 0xFA00A8C0;      // ip address 250.0.168.192

wip_in_addr_t static_subnet  = 0x00FFFFFF;      // subnet mask 0.255.255.255

wip_in_addr_t static_gw      = 0x0100A8C0;      // Default gateway 1.0.168.192

wip_in_addr_t static_dns1  = 0x140002C2;       // DNS 1 20.0.2.194

wip_in_addr_t static_dns2  = 0x320002C2;       // DNS 2 50.0.2.194

wip_in_addr_t static_dst     = 0x0100A8C0;      // Default gateway 1.0.168.192

 

ret = wip_bearerSetOpts ( Bearer_Handle,

                                  WIP_BOPT_ETH_ADDR, &mac_addr,

                                  WIP_BOPT_IP_DHCP, FALSE,

                                  WIP_BOPT_IP_ADDR, &static_ip_addr,

                                  WIP_BOPT_IP_NETMASK, &static_subnet,

                                  WIP_BOPT_IP_GW, &static_gw,

                                  /*WIP_BOPT_IP_DST_ADDR, &static_dst,*/

                                  WIP_BOPT_IP_DNS1, &static_dns1,

                                  WIP_BOPT_IP_DNS2, &static_dns2,

                                  WIP_BOPT_IP_SETDNS, FALSE,

                                  WIP_BOPT_IP_SETGW, FALSE,

                                  WIP_BOPT_END );

Result: Ethernet bearer started
Provided settings: Net mask: 255.255.255.0, IP: 192.168.0.250, GW: 92.168.0.1 ,DNS1: 194.2.0.20, DNS2: 194.2.0.50

Showing configuration
Applied setings: Local: 0.0.0.0 Netmask: 0.0.0.0 default gateway: 112.8.16.2 DNS1: 116.8.16.24 DNS2: 120.8.16.24
Server created and listening on port 2000
Applied setings: Local: 0.0.0.0 Netmask: 0.0.0.0 default gateway: 112.8.16.2 DNS1: 116.8.16.24 DNS2: 120.8.16.24
Server created and listening on port 2000

Is there a special option to apply a static address that we would have missed?

Thank you

Hiya,

The ‘Applied Settings’ values you show as the result of your wip_bearerSetOpts() call with fixed values look like the results from the GPRS/ISP bearer, rather than your LAN ethernet bearer. Are you sure that you are applying the settings to the correct (Ethernet/Lan) interface?

Can you show some more of your setup code please.

ciao, Dave