31#if !(defined(ANSI_ESCAPE_ENABLED) && ANSI_ESCAPE_ENABLED == 0)
33#define ANSI_BOLD "\x1b[1m"
35#define ANSI_RESET "\x1b[0m"
45#define MAC_ADDR_STR_LEN (18)
68 snprintf(ssid_str, (result->
ssid_len+1),
"%s", result->
ssid);
71 printf(
" Operating BW: %u MHz\n", result->
op_bw_mhz);
72 printf(
" BSSID: %s\n", bssid_str);
73 printf(
" RSSI: %3d\n", result->
rssi);
90 printf(
" Security: None\n");
94 printf(
" Invalid RSN IE in probe response\n");
101 printf(
" S1G Operation:\n");
102 printf(
" Operating class: %u\n",
104 printf(
" Primary channel: %u\n",
106 printf(
" Primary channel width: %u MHz\n",
108 printf(
" Operating channel: %u\n",
110 printf(
" Operating channel width: %u MHz\n",
125 printf(
"Scanning completed.\n");
137 printf(
"\n\nMorse Scan Demo (Built "__DATE__
" " __TIME__
")\n\n");
145 printf(
"Failed to set country code %s\n", channel_list->
country_code);
155 printf(
"Morse firmware version %s, morselib version %s, Morse chip ID 0x%lx\n\n",
164 printf(
"Scan started on %s channels, Waiting for results...\n", channel_list->
country_code);
#define MMOSAL_ASSERT(expr)
Assert that the given expression evaluates to true and abort execution if not.
const char * mm_akm_suite_to_string(uint32_t akm_suite_oui)
Get the name of the given AKM Suite as a string.
int mm_parse_s1g_operation(const uint8_t *ies, uint32_t ies_len, struct mm_s1g_operation *output)
Find the S1G Operation information element from within a block of IEs and extract useful information ...
int mm_parse_rsn_information(const uint8_t *ies, uint32_t ies_len, struct mm_rsn_information *output)
Search through the given list of information elements to find the RSN IE then parse it to extract rel...
mmwlan_scan_state
Enumeration of states in Scan mode.
enum mmwlan_status mmwlan_get_version(struct mmwlan_version *version)
Retrieve version information from morselib and the connected Morse transceiver.
enum mmwlan_status mmwlan_boot(const struct mmwlan_boot_args *args)
Boot the Morse Micro transceiver and leave it in an idle state.
#define MMWLAN_SCAN_REQ_INIT
Initializer for mmwlan_scan_req.
#define MMWLAN_BOOT_ARGS_INIT
Initializer for mmwlan_boot_args.
enum mmwlan_status mmwlan_scan_request(const struct mmwlan_scan_req *scan_req)
Request a scan.
void mmwlan_init(void)
Initialize the MMWLAN subsystem.
enum mmwlan_status mmwlan_set_channel_list(const struct mmwlan_s1g_channel_list *channel_list)
Set the list of channels that are supported by the regulatory domain in which the device resides.
mmwlan_status
Enumeration of status return codes.
#define MMWLAN_SSID_MAXLEN
Maximum allowable length of an SSID.
@ MMWLAN_SUCCESS
The operation was successful.
const struct mmwlan_s1g_channel_list * load_channel_list(void)
Looks up country code and returns appropriate channel list.
static void scan_complete_callback(enum mmwlan_scan_state state, void *arg)
Scan complete callback.
#define MAC_ADDR_STR_LEN
Length of string representation of a MAC address (i.e., "XX:XX:XX:XX:XX:XX") including null terminato...
#define ANSI_BOLD
ANSI escape sequence for bold text.
static void scan_rx_callback(const struct mmwlan_scan_result *result, void *arg)
Scan rx callback.
void app_init(void)
Main entry point to the application.
static int num_scan_results
Number of results found.
#define ANSI_RESET
ANSI escape sequence to reset font.
Data structure to represent information extracted from an S1G Operation information element.
uint8_t operating_channel_width_mhz
Width of the operating channel in MHz.
uint8_t operating_channel_number
Channel number of the operating channel.
uint8_t primary_channel_width_mhz
Width of the primary channel in MHz.
uint8_t primary_channel_number
Channel number of the primary channel.
uint8_t operating_class
Operating class.
Arguments data structure for mmwlan_boot().
A list of S1G channels supported by a given regulatory domain.
uint8_t country_code[MMWLAN_COUNTRY_CODE_LEN]
Two character country code (null-terminated) used to identify the regulatory domain.
Structure to hold arguments specific to a given instance of a scan.
mmwlan_scan_rx_cb_t scan_rx_cb
Scan response receive callback.
mmwlan_scan_complete_cb_t scan_complete_cb
Scan complete callback.
Result of the scan request.
uint8_t ssid_len
Length of the SSID (ssid).
const uint8_t * ies
Pointer to the start of the Information Elements within the Probe Response frame.
uint16_t capability_info
Value of the Capability Information field.
uint16_t ies_len
Length of the Information Elements (ies).
const uint8_t * bssid
Pointer to the BSSID field within the Probe Response frame.
uint16_t beacon_interval
Value of the Beacon Interval field.
uint8_t op_bw_mhz
Operating bandwidth, in MHz, of the access point.
int16_t rssi
RSSI of the received frame.
const uint8_t * ssid
Pointer to the SSID within the SSID IE of the Probe Response frame.
Structure for retrieving version information from the mmwlan subsystem.
char morselib_version[MMWLAN_MORSELIB_VERSION_MAXLEN]
Morselib version string.
char morse_fw_version[MMWLAN_FW_VERSION_MAXLEN]
Morse transceiver firmware version string.
uint32_t morse_chip_id
Morse transceiver chip ID.