Hello.
We are following this example from Keil on how to configure the local host name of a system running on top of TCPNet.
http://www.keil.com/support/man/docs/rlarm/rlarm_tn_runtimecfg.htm
However, after the latest patch (4.22a) we get a linker error that lhost_name is an unknown symbol.
Did that global change names or is there a different way of configuring the host name now?
thanks
- Per
Try this:
#include <Net_Config.h> extern SYS_CFG sys_config; U8 const dev_name[16] = { "Keil_MCB" }; str_copy (sys_config.HostName, &dev_name);
I actually submitted a support case for this exact problem, and I was adviced to just edit out the static keyword which was added to the lhost_name[] variable in net_lib.c (which is a file belonging to the system), as Keil would remove the static keyword themselves in the next version.
What is written here suggests a different approach, which is OK, but it is yet another example of the sloppiness from Keil. The help file does not reflect this change, and version 4.22 actually broke the example code in the help.
And while I'm at it, the code posted by Franc Urbanc here shows the use of the function str_copy, which resides in the library at_Lib.c along with some other memory functions, but none of those are documented in the help. Why not? The function is used many times in the examples in the help, but no docs. The function itself is obviously simple, but it would be nice to have some docs outlining why it would be preferred over the standard strcpy library function.
Regards -Øyvind