Add Header and Footer when output data via the serial interface

Add Header and Footer when output data via the serial interface.
refMacro Sample:Add Header and Footer when output data via the serial interface