OpenTP1 Version 7 Programming Reference C Language
Create a main function (SUP, SPP, MHP)
Format
The name of a main function must include main(). For the other rules of creating main functions, comply with the specifications of the C language for coding. OpenTP1 does not limit creation of main functions. Main functions can be created according to the explanation of this section.
Description
After the UAP process starts, the OS first calls the main function.
SUP main function
The following OpenTP1 functions are always called in the SUP main function:
In addition to the above OpenTP1 functions, the function for initializing UAP processes required for jobs, the termination processing function, and the function dc_rpc_call() can also be called.
SPP main function
Service functions created as services which are provided by an SPP are grouped into one executable file. An executable file comprising one main function and multiple service functions corresponds to a service group.
The OpenTP1 functions listed below are always called in the SPP main function. To use an MCF function with an SPP service, call the function dc_mcf_open() and the function dc_mcf_close().
After initialization processing, the main function stops when the function dc_rpc_mainloop() is called. Meanwhile, the main function performs processing requested by service functions. In addition to the above OpenTP1 functions, the function for initializing SPP processes required for jobs, the termination processing function, and the function dc_rpc_call() can also be used in the main function.
MHP main function
Service functions created as applications for message processing are grouped into one executable file. An executable file comprising one main function and multiple service functions corresponds to a service group. The service group name must be unique in the domain (in the entire network).
The following OpenTP1 functions are always called in the MHP main function:
The MHP having the service function corresponding to the application name is started. After initialization processing, the main function stops when the function dc_mcf_mainloop() is called. Meanwhile, the main function performs processing requested by service functions. In addition to the above OpenTP1 functions, the function for initializing MHP processes required for jobs, the termination processing function, and the function dc_rpc_call() can also be used in the main function.
Argument
No argument is passed to the main function.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.