[serial] coding: move functions implementations to c file