Add lost functionality again to hidgateway.c