AMX DESIGN XPRESS V 1.5 - PROGRAMMER GUIDE User's Guide Page 33

  • Download
  • Add to my manuals
  • Print
  • Page
    / 316
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 32
KwikNet Overview
K
A
DAK
19
1.6 KwikNet Data Logging Service
Like most TCP/IP stacks, KwikNet can generate a variety of messages to assist you in your
use of the stack. The messages can provide debug information and trace execution of the
stack through its various paths. Your application can also generate a statistics summary
of event counts by calling KwikNet procedure kn_netstats().
For debug and trace messages to be generated, the KwikNet Library must be configured
accordingly. Statistics for a particular KwikNet component will only be available for
logging if the KwikNet Library is appropriately configured. Even if the message sources
are enabled, KwikNet will only log the messages if message logging is enabled. To enable
these features, use the KwikNet Configuration Builder to edit your Network Parameter File
as described in Chapter 2.3.
Edit the Network Parameter File as follows. Go to the Debug property page and check
the box which enables message logging. On the same page, define the amount of
memory you are willing to reserve for KwikNet to use for message storage. Specify the
maximum allowable message line length, usually about 80 to 128 characters. Finally,
enter the name of the data log function to be used by KwikNet to print each message. This
function will be described shortly.
The KwikNet Library, ready for message logging use, will be generated and linked with
your application as described in Chapter 3.
Message Formatting
Many TCP/IP stacks produce these data logging messages using the C library printf()
function which is often not even available in embedded systems. KwikNet provides its
own procedure called kn_dprintf() which, although similar to printf(), has several
special features not found in the latter. This procedure is fully described in Chapter 4.6.
The prototype is as follows.
int kn_dprintf(int attrib, const char *fmtp, ...);
Unlike printf(), KwikNet's procedure receives a parameter attrib which defines the
print attributes of the message. This encoded parameter defines the severity of the
message, the message class and the message source. These characteristics will be
described shortly.
The parameter fmtp is a pointer to a conventional format string which can be followed by
zero or more parameters as required by the format specification. Not all standard C
formats are supported. For example, parameters of type
float and double are not
permitted. However, a new format "%a" is introduced which greatly simplifies the
formatting of network IP addresses in dotted decimal notation.
For a complete specification of the formatting features supported by KwikNet procedure
kn_dprintf(), see the description of format procedure kn_fmt() in Chapter 4.6.
Page view 32
1 ... 32 33 34 ... 316

Comments to this Manuals

No comments