Use maximum fd set for select size
Handle used timeouts > 1 sec
Added missing unistd.h include
Fixed bug in terminating command_type buffer
Improved debug messages for missing RSSI data
Added quotes around directory expansions that could include spaces