Growl Client Interface.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | tstrNotification |
Macros | |
#define | GROWL_CONNECT_RETRY 3 |
#define | GROWL_DNS_RETRY 3 |
#define | GROWL_HTTP_PORT 80 |
#define | GROWL_HTTPS_PORT 443 |
#define | GROWL_MSG_SIZE 256 |
#define | GROWL_RX_TIMEOUT (25 * 1000) |
#define | GROWL_STATE_IDLE ((uint8)0) |
#define | GROWL_STATE_REQ_PENDING ((uint8)1) |
#define | GROWL_STATE_WAITING_RESPONSE ((uint8)2) |
#define | MAX_REGISTERED_EVENTS 1 |
#define | NMA_API_KEY_SIZE 48 |
#define | NMA_CLIENT_STRING_ID "notifymyandroid" |
#define | NMA_DOMAIN_NAME "www.notifymyandroid.com" |
#define | PROWL_API_KEY_SIZE 40 |
#define | PROWL_CLIENT_STRING_ID "prowl" |
#define | PROWL_DOMAIN_NAME "api.prowlapp.com" |
Functions | |
static void | AppServerCb (uint8 *pu8HostName, uint32 u32ServerIP) |
NMI_API uint16 | Encode (uint8 *pcStr, uint8 *pcEncoded) |
NMI_API uint16 | FormatMsg (uint8 u8clientName, uint8 *pu8Msg) |
NMI_API uint8 | GetResponseCode (uint8 *pu8Buffer, uint16 u16BufferSize) |
static void | GROWL_APPSocketEventHandler (SOCKET sock, uint8 u8Msg, void *pvMsg) |
void | NMI_GrowldeInit (void) |
void | NMI_GrowlInit (uint8 *pu8PrwKey, uint8 *pu8NmaKey) |
sint8 | NMI_GrowlSendNotification (uint8 u8ClientName, uint8 *pu8App, uint8 *pu8Event, uint8 *pu8Description, uint8 bUseSSL) |
Variables | |
static volatile uint8 | au8Msg [GROWL_DESCRIPTION_MAX_LENGTH] |
static CONST uint8 | gau8HexDigits [] = "0123456789abcdef" |
static volatile uint8 * | gau8NmaKey |
static volatile uint8 * | gau8PrwKey |
static volatile tstrNotification | gstrNotificationNMA |
static volatile tstrNotification | gstrNotificationProwl |
#define GROWL_CONNECT_RETRY 3 |
Referenced by GROWL_APPSocketEventHandler().
#define GROWL_DNS_RETRY 3 |
Referenced by AppServerCb().
#define GROWL_HTTP_PORT 80 |
Referenced by NMI_GrowlSendNotification().
#define GROWL_HTTPS_PORT 443 |
Referenced by NMI_GrowlSendNotification().
#define GROWL_MSG_SIZE 256 |
Referenced by GROWL_APPSocketEventHandler().
#define GROWL_RX_TIMEOUT (25 * 1000) |
Referenced by GROWL_APPSocketEventHandler().
#define GROWL_STATE_IDLE ((uint8)0) |
Referenced by AppServerCb(), GROWL_APPSocketEventHandler(), and NMI_GrowlSendNotification().
#define GROWL_STATE_REQ_PENDING ((uint8)1) |
Referenced by NMI_GrowlSendNotification().
#define GROWL_STATE_WAITING_RESPONSE ((uint8)2) |
#define MAX_REGISTERED_EVENTS 1 |
#define NMA_API_KEY_SIZE 48 |
Referenced by FormatMsg().
#define NMA_CLIENT_STRING_ID "notifymyandroid" |
Referenced by AppServerCb().
#define NMA_DOMAIN_NAME "www.notifymyandroid.com" |
Referenced by AppServerCb(), FormatMsg(), GROWL_APPSocketEventHandler(), and NMI_GrowlSendNotification().
#define PROWL_API_KEY_SIZE 40 |
Referenced by FormatMsg().
#define PROWL_CLIENT_STRING_ID "prowl" |
Referenced by AppServerCb().
#define PROWL_DOMAIN_NAME "api.prowlapp.com" |
Referenced by AppServerCb(), FormatMsg(), GROWL_APPSocketEventHandler(), and NMI_GrowlSendNotification().
References _htons, AF_INET, close(), connect(), gethostbyname(), GROWL_DNS_RETRY, GROWL_ERR_RESOLVE_DNS, GROWL_STATE_IDLE, GrowlCb(), M2M_DBG, m2m_strstr(), NMA_CLIENT, NMA_CLIENT_STRING_ID, NMA_DOMAIN_NAME, NULL, PROWL_CLIENT, PROWL_CLIENT_STRING_ID, PROWL_DOMAIN_NAME, in_addr::s_addr, sockaddr_in::sin_addr, sockaddr_in::sin_family, and sockaddr_in::sin_port.
Referenced by GROWL_APPSocketEventHandler(), and NMI_GrowlInit().
References gau8HexDigits.
Referenced by FormatMsg().
References m2m_memcmp(), and NULL.
Referenced by GROWL_APPSocketEventHandler().
References AppServerCb(), au8Msg, close(), FormatMsg(), GetResponseCode(), GROWL_CONNECT_RETRY, GROWL_DESCRIPTION_MAX_LENGTH, GROWL_ERR_CONN_FAILED, GROWL_MSG_SIZE, GROWL_RX_TIMEOUT, GROWL_STATE_IDLE, GrowlCb(), M2M_DBG, M2M_ERR, NMA_CLIENT, NMA_DOMAIN_NAME, NULL, PROWL_CLIENT, PROWL_DOMAIN_NAME, tstrSocketRecvMsg::pu8Buffer, recv(), tstrSocketRecvMsg::s16BufferSize, tstrSocketConnectMsg::s8Error, send(), tstrNotification::Socket, SOCKET_MSG_CONNECT, SOCKET_MSG_RECV, SOCKET_MSG_SEND, tstrSocketRecvMsg::u16RemainingSize, tstrNotification::u32ServerIPAddress, and tstrNotification::u8State.
Referenced by NMI_GrowlInit().
void NMI_GrowldeInit | ( | void | ) |
References close(), m2m_memset(), and tstrNotification::Socket.
References AppServerCb(), gau8NmaKey, gau8PrwKey, GROWL_APPSocketEventHandler(), M2M_INFO, m2m_memset(), registerSocketCallback(), tstrNotification::Socket, and socketInit().
Referenced by wifi_cb().
sint8 NMI_GrowlSendNotification | ( | uint8 | u8ClientName, |
uint8 * | pu8App, | ||
uint8 * | pu8Event, | ||
uint8 * | pu8Description, | ||
uint8 | bUseSSL | ||
) |
References AF_INET, gau8NmaKey, gau8PrwKey, gethostbyname(), GROWL_APPNAME_MAX_LENGTH, GROWL_DESCRIPTION_MAX_LENGTH, GROWL_EVENT_MAX_LENGTH, GROWL_HTTP_PORT, GROWL_HTTPS_PORT, GROWL_STATE_IDLE, GROWL_STATE_REQ_PENDING, M2M_ERR, M2M_ERR_FAIL, M2M_INFO, m2m_strlen(), NMA_CLIENT, NMA_DOMAIN_NAME, NULL, PROWL_CLIENT, PROWL_DOMAIN_NAME, tstrNotification::pu8App, tstrNotification::pu8Event, tstrNotification::pu8Msg, SOCK_STREAM, tstrNotification::Socket, socket(), SOCKET_FLAGS_SSL, tstrNotification::u16Port, and tstrNotification::u8State.
Referenced by growl_send_message_handler().
|
static |
Referenced by GROWL_APPSocketEventHandler().
|
static |
Referenced by FormatMsg(), NMI_GrowlInit(), and NMI_GrowlSendNotification().
|
static |
Referenced by FormatMsg(), NMI_GrowlInit(), and NMI_GrowlSendNotification().
|
static |
|
static |