Microchip® Advanced Software Framework

simple_growl_example/main21.c File Reference

WINC1500 Simple Growl Example.

Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "main.h"
#include "driver/source/nmasic.h"
#include "growl/growl.h"

Macros

#define STRING_EOL   "\r\n"
 
#define STRING_HEADER
 

Functions

static void configure_console (void)
 Configure UART console. More...
 
static int growl_send_message_handler (void)
 Send a specific notification to a registered Android(NMA) or IOS(PROWL) More...
 
void GrowlCb (uint8_t u8Code, uint8_t u8ClientID)
 Growl notification callback. More...
 
int main (void)
 Main application function. More...
 
static void set_dev_name_to_mac (uint8_t *name, uint8_t *mac_addr)
 
static void wifi_cb (uint8_t u8MsgType, void *pvMsg)
 Callback to get the Wi-Fi status update. More...
 

Variables

static struct usart_module cdc_uart_module
 UART module for debug. More...
 

#define STRING_EOL   "\r\n"
#define STRING_HEADER
Value:
"-- WINC1500 simple growl example --"STRING_EOL \
"-- "BOARD_NAME " --"STRING_EOL \
"-- Compiled: "__DATE__ " "__TIME__ " --"STRING_EOL
#define BOARD_NAME
Definition: app_init.h:140
#define STRING_EOL
Definition: simple_growl_example/main21.c:111

Referenced by main().

static int growl_send_message_handler ( void  )
static

Send a specific notification to a registered Android(NMA) or IOS(PROWL)

References NMA_CLIENT, NMA_CONNECTION_TYPE, and NMI_GrowlSendNotification().

Referenced by wifi_cb().

void GrowlCb ( uint8_t  u8Code,
uint8_t  u8ClientID 
)

Growl notification callback.

Pointer to a function delivering growl events.

Parameters
[u8Code]Possible error codes could be returned by the nma server and refer to the comments in the growl.h.
[u8ClientID]client id returned by the nma server.

Referenced by AppServerCb(), and GROWL_APPSocketEventHandler().

static void set_dev_name_to_mac ( uint8_t *  name,
uint8_t *  mac_addr 
)
static

References m2m_strlen(), and MAIN_HEX2ASCII.

Referenced by main().

static void wifi_cb ( uint8_t  u8MsgType,
void *  pvMsg 
)
static

Callback to get the Wi-Fi status update.

Parameters
[in]u8MsgTypetype of Wi-Fi notification. Possible types are:
[in]pvMsgA pointer to a buffer containing the notification parameters (if any). It should be casted to the correct data type corresponding to the notification type.

init growl

References tstrM2MProvisionInfo::au8Password, tstrM2MProvisionInfo::au8SSID, gbRespProvInfo, growl_send_message_handler(), M2M_SUCCESS, M2M_WIFI_CH_ALL, m2m_wifi_connect(), M2M_WIFI_CONNECTED, M2M_WIFI_DISCONNECTED, M2M_WIFI_REQ_DHCP_CONF, m2m_wifi_request_dhcp_client(), M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_RESP_PROVISION_INFO, NMA_API_KEY, NMI_GrowlInit(), PROWL_API_KEY, tstrM2mWifiStateChanged::u8CurrState, tstrM2MProvisionInfo::u8SecType, and tstrM2MProvisionInfo::u8Status.

Referenced by main().

struct usart_module cdc_uart_module
static

UART module for debug.