94 printf(
"Link is up. Time: %lu ms", time_ms);
95 printf(
", IP: %s", link_status->
ip_addr);
96 printf(
", Netmask: %s", link_status->
netmask);
97 printf(
", Gateway: %s\n", link_status->
gateway);
101 printf(
"Link is down. Time: %lu ms\n", time_ms);
113 if (state == BUTTON_RELEASED)
130 cb(BUTTON_ID_USER0, BUTTON_RELEASED);
134 cb(BUTTON_ID_USER0, BUTTON_PRESSED);
148 printf(
"\n\nMorse Emmet Demo (Built " __DATE__
" " __TIME__
")\n\n");
166 printf(
"Error initializing network interface.\n");
static void link_status_callback(const struct mmipal_link_status *link_status)
Link status callback.
void app_init(void)
Main entry point to the application.
void emmet_hal_trigger_button_event(enum emmet_button_state state)
Trigger a button event to the application as if a user had pushed or released the button.
void emmet_hal_set_led(uint8_t led_id, uint8_t level)
Set LED state.
enum emmet_button_state emmet_hal_get_button_state(void)
Get the current button state.
void emmet_start(void)
Start Emmet.
enum mmwlan_status emmet_set_reg_db(const struct mmwlan_regulatory_db *reg_db)
Set the regulatory database for Emmet to use.
void emmet_init(void)
Initialize Emmet.
emmet_button_state
Enumeration of button states used by the Emmet HAL.
@ EMMET_BUTTON_PRESSED
Button pressed state.
@ EMMET_BUTTON_RELEASED
Button released state.
void(* mmhal_button_state_cb_t)(enum mmhal_button_id button_id, enum mmhal_button_state button_state)
Button state callback function prototype.
mmhal_button_state
Enumeration for button states.
mmhal_button_state_cb_t mmhal_get_button_callback(enum mmhal_button_id button_id)
Returns the registered callback handler for button state changes.
void mmhal_set_led(uint8_t led, uint8_t level)
Set the specified LED to the requested level.
enum mmhal_button_state mmhal_get_button(enum mmhal_button_id button_id)
Reads the state of the specified button.
enum mmipal_status mmipal_init(const struct mmipal_init_args *args)
Initialize the IP stack and enable the MMWLAN interface.
#define MMIPAL_INIT_ARGS_DEFAULT
Default values for mmipal_init_args.
void mmipal_set_link_status_callback(mmipal_link_status_cb_fn_t fn)
Sets the callback function to be invoked on link status changes.
@ MMIPAL_LINK_UP
Link is up.
@ MMIPAL_SUCCESS
Completed successfully.
#define MMOSAL_ASSERT(expr)
Assert that the given expression evaluates to true and abort execution if not.
uint32_t mmosal_get_time_ms(void)
Get the system time in milliseconds.
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_BOOT_ARGS_INIT
Initializer for mmwlan_boot_args.
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.
Morse Micro application helper routines for initializing/de-initializing the Wireless LAN interface a...
void app_print_version_info(void)
Prints various version information.
const struct mmwlan_s1g_channel_list * load_channel_list(void)
Looks up country code and returns appropriate channel list.
void load_mmipal_init_args(struct mmipal_init_args *args)
Loads the provided structure with initialization parameters read from config store.
Initialize arguments structure.
Structure representing the current status of the link.
mmipal_ip_addr_t netmask
Current netmask.
mmipal_ip_addr_t ip_addr
Current IP address.
mmipal_ip_addr_t gateway
Current gateway IP address.
enum mmipal_link_state link_state
State of the link (up/down).
Arguments data structure for mmwlan_boot().