merge host code from xh100 project