Microchip® Advanced Software Framework

growl.c File Reference

Growl Client Interface.

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

#include "growl/growl.h"
#include "socket/include/socket.h"
#include "common/include/nm_common.h"

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 uint8gau8NmaKey
 
static volatile uint8gau8PrwKey
 
static volatile tstrNotification gstrNotificationNMA
 
static volatile tstrNotification gstrNotificationProwl
 

#define GROWL_CONNECT_RETRY   3
#define GROWL_DNS_RETRY   3

Referenced by AppServerCb().

#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

Referenced by FormatMsg().

#define NMA_CLIENT_STRING_ID   "notifymyandroid"

Referenced by AppServerCb().

#define NMA_DOMAIN_NAME   "www.notifymyandroid.com"
#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"

uint16 Encode ( uint8 pcStr,
uint8 pcEncoded 
)

References gau8HexDigits.

Referenced by FormatMsg().

uint8 GetResponseCode ( uint8 pu8Buffer,
uint16  u16BufferSize 
)

References m2m_memcmp(), and NULL.

Referenced by GROWL_APPSocketEventHandler().

void NMI_GrowldeInit ( void  )

volatile uint8 au8Msg[GROWL_DESCRIPTION_MAX_LENGTH]
static
CONST uint8 gau8HexDigits[] = "0123456789abcdef"
static

Referenced by Encode().

volatile uint8* gau8NmaKey
static
volatile uint8* gau8PrwKey
static
volatile tstrNotification gstrNotificationNMA
static
volatile tstrNotification gstrNotificationProwl
static