For instance, when I receive a reset diagnostic frame (11 01), I parse it with ld_receive_message() and I prepare the response with ld_send_message(); then I havesss to really reset the microprocessor, but only after I'm sure that the slave response was really sent on bus. How can I check that the response was sent on bus? ld_send_message() only prepares the response, but this does not mean that it was phisically sent on bus.
=> As far as I know, you can use ld_raw_tx_status() function to check the status of tx_queue.
tx_queue will be updated with data after you call ld_send_message() and will be cleaned after it is transmitted.
Please refer the chapter 7.4.3.3 of LIN_Specification_Package_2.2A.pdf to more detail.
As regards normal frames (not diagnostic), what is the way to ensure the same thing? (I mean, be sure that the response to a frame was really sent on bus).
=> For Unconditional frame, you can use l_flg_tst() to check status. The flag will be set when the frame is successfully transmitted from the node.