User's Manual

6. Run the program. If you click the Command1 button, a message request is sent to
eKERNEL.
7. You can alter the code shown in Figure 36: Sample socket client code on page 69
to specify the correct parameters for the parameters group (use one of the values
specified in the eKERNEL_GROUP table), alarm description (use one of the values
specified in the eKERNEL_ALARM table), and so on.
Note:
The code shown in Figure 36: Sample socket client code on page 69 is not intended to
represent a reliable TCP client, and is meant only to illustrate how to start programming with
eAPI using minimal code entry. A real-life program must take all necessary action to handle
all error conditions.
The following issues usually require improvement:
• The sample code shown in Figure 36: Sample socket client code on page 69 does not
respond on the asynchronous connection attempt by means of the Winsock1_Connect()
event. The code assumes that the connect succeeds after doing a DoEvents(). The
Winsock1.State must be 7 before a SendData can be requested.
• The sample code shown in
Figure 36: Sample socket client code on page 69 includes
appropriate error recovery, but does not respond to failed connection attempts.
• The sample code shown in Figure 36: Sample socket client code on page 69 assumes
the data is actually transmitted with the SendData, and does not wait for the
Winsock1_SendComplete() event.
• The values for IP address and port are hard-coded, and users must be able to set them
as parameters in a real-word program.
The values in the message request are hard-coded, and must be filled with actual alarm
information and appropriate configured values, as defined in the configuration
database.
Module eAPI
68 DECT Messenger Installation and Commissioning — Book 1 March 2012
Comments? infodev@avaya.com