Step 7: Gluing it All Together

This step corresponds to test_agg_lib_7 .

And now, ladies and gentlemen, let's crown this application with some glue code. Observe the code and notice the following...

  1. Handling of the BR setting A-variable :

     - Every time we select new baudrate in AggreGate, callback_stg_post_set() is invoked. Our code there calls baudrate_set() . Don't understand how this works? Read Using Pre-gets and Post-sets .

     - We also call baudrate_get() from callback_stg_pre_get() .

     - Baudrate_get() is also invoked from setup_serial_port() , which is called from the on_sys_init() .

  2. Handling of the UT setting A-variable : again, we just return the actual door status in callback_stg_pre_get() . If you may recall , the MD button is used as a make-believe door sensor.

  3. The GE setting A-variable now properly allows or prevents the events from generating.

  4. Handling of user access codes is in the on_ser_data_arrival event handler.