From owner-freebsd-embedded@FreeBSD.ORG Thu Apr 3 17:27:26 2008 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EFE4106566C for ; Thu, 3 Apr 2008 17:27:26 +0000 (UTC) (envelope-from jordan@JordanColeman.com) Received: from redfeather.colemanfamilycamps.com (redfeather.colemanfamilycamps.com [69.74.247.230]) by mx1.freebsd.org (Postfix) with ESMTP id 430918FC15 for ; Thu, 3 Apr 2008 17:27:26 +0000 (UTC) (envelope-from jordan@JordanColeman.com) Received: from [172.21.1.1] (unknown [172.21.1.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by redfeather.colemanfamilycamps.com (Postfix) with ESMTP id 642E15086C for ; Thu, 3 Apr 2008 13:09:02 -0400 (EDT) Message-Id: <8C45E249-2E03-4F70-B3C2-E28A92EEFB05@JordanColeman.com> From: Jordan Coleman To: freebsd-embedded@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Thu, 3 Apr 2008 13:09:01 -0400 X-Mailer: Apple Mail (2.919.2) Subject: Programmatic access to 802.11 info X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2008 17:27:26 -0000 We are currently working on an embedded application that need to connect to wireless networks. The UI lets the user configure one or more networks, select whether to use a specific network or roam among a list of SSIDs, view SSID scan information etc. We are wrapping wpa_supplicant and letting it handle network selection, roaming, WPA (as well as WEP), etc. and that seems to work well enough. However, at the moment, we're having trouble getting various status information in a reliable and efficient manner. Our temporary code invokes "ifconfig -v list scan" and scrapes its output to get scanning info (it appears to provide more and better info than wpa_supplicant's 'scan results' command). Similarly, we're scraping "wpa_cli status" and "ifconfig list sta" for association and signal strength information. At best, this seems like the hard way to get this info and it's darn ugly, too (polling sucks, but having to fork and exec ifconfig on every poll sucks even more). What's more, some of the information we want, such as signal quality ("n out of 5 bars", etc.), isn't really available. We can get RSSI from "ifconfig list sta", but it's not the same thing. So can anyone suggest how to go about getting this information straight from the system? The application is primarily written in Perl, but Perl is not a hard requirement for this portion of the code. The device runs FreeBSD 7 and the wireless hardware is Atheros- based. So far, I've been unsuccessful in finding helpful docs and the FreeBSD wireless code is big enough to make grokking it a challenge. Thanks in advance for any help you can provide. ++Jordan