A Functional Co-Design Towards Safe And Secure Vehicle Platooning