xbee server side code