Developing the main() Method in a Stub

Complete the main() method by adding start-up and shutdown information and error handling.

  1. Populate the PUB_STARTUP structure.

    In the line below // Set the startup_settings, at &startup_settings, insert the information pub_initialize needs from PUB_STARTUP to initialize the publisher. All fields in the PUB_STARTUP structure are required.

    Your feed handler may also require other initialization outside the PUB_STARTUP structure.

  2. Add error handling where indicated in the stub comments.

    At a minimum, the main() method needs error handling for initialization, publish_<msgName>_Message, and shutdown.

  3. Add any other shutdown processing.
Next
Develop a publish_<msgName>_Message() method for each message, either from stubs or by coding manually.
Related concepts
main() method stub
Initialization
Related reference
pub_initialize
pub_shutdown