95#define DEFAULT_OUI {0x4D, 0x4D, 0x42};
98#define DEFAULT_LOG_LEN_BYTES 30
100#define DEFAULT_STATS_UPDATE_PERIOD_MS 1000
104#define FILTER_INDEX 0
106#define RGB_DATA_LENGTH_BYTES 3
148 length = ies[offset + 1];
166 printf(
"Failed to alloc memory for ie data.");
172 memcpy(stat->
ie_data, (ies + offset), length);
197 for (ii = 0; (ii < stat->
ie_len) && (ii < max_data_log_len); ii++)
199 printf(
"%02x", stat->
ie_data[ii]);
202 printf(
"%s\n", (stat->
ie_len >= max_data_log_len) ?
"..." :
"");
236 printf(
"\n\nMorse Beacon Stuffing Demo (Built " __DATE__
" " __TIME__
")\n\n");
250 printf(
"Failed to register beacon vendor ie filter.\n");
254 printf(
"\nFiltering for Vendor Specific IE with OUI: 0x%02x%02x%02x\n", oui[0], oui[1], oui[2]);
256 printf(
"Occurrences | Length (bytes) | Data (hex)\n");
#define DEFAULT_STATS_UPDATE_PERIOD_MS
How often the contents for the stat struct is logged.
struct mmwlan_beacon_vendor_ie_filter filter
Filter structure used when calling mmwlan_update_beacon_vendor_ie_filter().
#define DEFAULT_LOG_LEN_BYTES
Length of the data to print when logging the stat struct.
#define DEFAULT_OUI
OUI to look for in the Vendor Specific IE.
#define FILTER_INDEX
Filter index to install the OUI.
#define RGB_DATA_LENGTH_BYTES
Length of data required for updating the LED state.
void app_init(void)
Main entry point to the application.
static void beacon_vendor_ie_stat_log(struct beacon_vendor_ie_stat *stat, uint32_t max_data_log_len)
Print the contents of the given stat struct using printf().
static void beacon_vendor_ie_callback(const uint8_t *ies, uint32_t ies_len, void *arg)
Callback function that gets executed every time a beacon containing a matching Vendor Specific IE is ...
int mmconfig_read_bytes(const char *key, void *buffer, uint32_t buffsize, uint32_t offset)
Returns the persistent store data identified by the key.
int mmconfig_read_uint32(const char *key, uint32_t *value)
Returns the unsigned integer stored in persistent store identified by the key.
void mmhal_set_led(uint8_t led, uint8_t level)
Set the specified LED to the requested level.
#define mmosal_malloc(size)
Allocate memory of the given size and return a pointer to it (malloc).
void mmosal_free(void *p)
Free the given memory allocation.
void mmosal_task_sleep(uint32_t duration_ms)
Sleep for a period of time, yielding during that time.
static int mm_find_vendor_specific_ie(const uint8_t *ies, uint32_t ies_len, const uint8_t *id, size_t id_len)
Search through the given list of Information Elements (IEs) to find the first Vendor Specific IE that...
enum mmwlan_status mmwlan_update_beacon_vendor_ie_filter(const struct mmwlan_beacon_vendor_ie_filter *filter)
Function to update the filter used to pass beacon back.
mmwlan_status
Enumeration of status return codes.
#define MMWLAN_OUI_SIZE
Size of an 802.11 OUI element in octets.
@ MMWLAN_SUCCESS
The operation was successful.
Morse Micro application helper routines for initializing/de-initializing the Wireless LAN interface a...
void app_wlan_init(void)
Initializes the WLAN interface (and dependencies) using settings specified in the config store.
void app_wlan_start(void)
Starts the WLAN interface and connects to Wi-Fi using settings specified in the config store.
Structure to store some basic statistics for the beacon Vendor Specific IE reception.
uint32_t occurrences
Number of times the Vendor Specific IE in the beacon was seen.
uint8_t * ie_data
If not NULL, the most recent IE data received.
uint32_t ie_len
The length in bytes of ie_data.
Structure for storing beacon vendor ie filter parameter.
void * cb_arg
Opaque argument to be passed to the callbacks.
mmwlan_beacon_vendor_ie_filter_cb_t cb
Callback that will be executed upon reception of a beacon containing a Vendor Specific information el...
mmwlan_oui_t ouis[MMWLAN_BEACON_VENDOR_IE_MAX_OUI_FILTERS]
List of OUIs to filter on.
uint8_t n_ouis
Number of OUIs contained within ouis.