Real-time software-defined free-space optical communication system