Discussion Forum

mem_test()...?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Komoto Takamura
Posted
18-Mar-2010 05:43 GMT
Toolset
ARM
New! mem_test()...?

Only one question please
What is the definition of mem_test() function in TCPnet manual

void send_data (void) {
  static const U8 rem_IP[4] = {192,168,0,100};
  U8 *sendbuf;

  if (wait_ack == __TRUE) {
    return;
  }
  if (mem_test (localm[NETIF_ETH].IpAdr, 0, 4) == __TRUE) {
    /* IP address not yet assigned by DHCP. */
    return;
  }
  if (bindex < 128) {
    sendbuf = udp_get_buf (512);
    for (i = 0; i < 512; i += 2) {
      sendbuf[i]   = bcount >> 8;
      sendbuf[i+1] = bcount & 0xFF;
    }
    udp_send (udp_soc, rem_IP, 1000, sendbuf, 512);
  }
}

Is it a member of stdio.h library?
I can not address it anywhere even on google...
Thanks
kom

Read-Only
Author
IB Shy
Posted
18-Mar-2010 07:55 GMT
Toolset
ARM
New! RE: mem_test()...?

It's defined in net_config.h as:

extern BOOL mem_test (void *sp, U8 val, int len);

Looking at the context of where you've taken it from, I would suspect that it is checking a block to see if it all contains a specific value; i.e., all IP address would be zero until DHCP had aquired something useful.

Read-Only
Author
Andrew Neil
Posted
18-Mar-2010 08:29 GMT
Toolset
ARM
New! RE: mem_test()...?

It appears to be undocumented.

A site search for it finds only the above code example at http://www.keil.com/support/man/docs/rlarm/rlarm_tn_using_udp_dhcpen.htm

:-(

Read-Only
Author
IB Shy
Posted
18-Mar-2010 08:54 GMT
Toolset
ARM
New! It appears to be undocumented.

Yes ...

<rant>
And because Keil don't supply the source code to their TCP library (at least, not at a reasonable cost) you can't easily determine what it does.
</rant>

Next Thread | Thread List | Previous Thread Start a Thread | Settings