The programmatic_scan module demonstrates how to run a wlan scan from your program and capture its output for program use.
Build it from project "programmaticScanDemo".