Microchip® Advanced Software Framework

MCHP_ATWx.c File Reference
#include "MQTTClient/Wrapper/mqtt.h"
#include "driver/include/m2m_wifi.h"
#include "socket/include/socket.h"
#include "string.h"

Macros

#define IPV4_BYTE(val, index)   ((val >> (index * 8)) & 0xFF)
 Copyright (C) 2017 Microchip Technology Inc. More...
 
#define MQTT_RX_POOL_SIZE   256
 

Functions

int ConnectNetwork (Network *n, char *addr, int port, int TLSFlag)
 
void dnsResolveCallback (uint8_t *hostName, uint32_t hostIp)
 
static bool isMQTTSocket (SOCKET sock)
 
void NetworkInit (Network *n)
 
void SysTick_Handler (void)
 
void tcpClientSocketEventHandler (SOCKET sock, uint8_t u8Msg, void *pvMsg)
 
void TimerCountdown (Timer *timer, unsigned int timeout)
 
void TimerCountdownMS (Timer *timer, unsigned int timeout)
 
void TimerInit (Timer *timer)
 
char TimerIsExpired (Timer *timer)
 
int TimerLeftMS (Timer *timer)
 
static void WINC1500_disconnect (Network *n)
 
static int WINC1500_read (Network *n, unsigned char *buffer, int len, int timeout_ms)
 
static int WINC1500_write (Network *n, unsigned char *buffer, int len, int timeout_ms)
 

Variables

static bool gbMQTTBrokerConnected =false
 
static bool gbMQTTBrokerIpresolved =false
 
static bool gbMQTTBrokerRecvDone =false
 
static bool gbMQTTBrokerSendDone =false
 
static unsigned char gcMQTTRxFIFO [MQTT_RX_POOL_SIZE]
 
static int32_t gi32MQTTBrokerIp =0
 
static int32_t gi32MQTTBrokerRxLen =0
 
static char * gpcHostAddr
 
static uint32_t gu32MQTTRxFIFOLen =0
 
static uint32_t gu32MQTTRxFIFOPtr =0
 
static unsigned long MilliTimer =0
 

#define IPV4_BYTE (   val,
  index 
)    ((val >> (index * 8)) & 0xFF)

Copyright (C) 2017 Microchip Technology Inc.

and its subsidiaries (Microchip). All rights reserved.

You are permitted to use the software and its derivatives with Microchip products.

SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL OR EQUITABLE THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR OTHER SIMILAR COSTS. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP AND ITS LICENSORS LIABILITY WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU PAID DIRECTLY TO MICROCHIP TO USE THIS SOFTWARE. MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE TERMS.

THIRD PARTY SOFTWARE: Notwithstanding anything to the contrary, any third party software accompanying this software is subject to the terms and conditions of the third party’s license agreement or open source software license. To the extent required by third party or open source licenses covering such third party software, the terms of such license will apply in lieu of the terms provided herein. To the extent the terms of such third party licenses prohibit any of the restrictions described herein, such restrictions will not apply to such third party software. THIRD PARTY SOFTWARE IS SUBJECT TO THE FOREGOING WARRANTY DISCLAIMER AND LIMIT ON LIABILITY PROVIDED IN THE PARAGRAPH ABOVE.

Referenced by dnsResolveCallback().

#define MQTT_RX_POOL_SIZE   256

Referenced by WINC1500_read().

void dnsResolveCallback ( uint8_t *  hostName,
uint32_t  hostIp 
)
void SysTick_Handler ( void  )

References MilliTimer.

void TimerCountdown ( Timer timer,
unsigned int  timeout 
)

References Timer::end_time, and MilliTimer.

Referenced by MQTTConnect(), and sendPacket().

void TimerCountdownMS ( Timer timer,
unsigned int  timeout 
)
char TimerIsExpired ( Timer timer)

References Timer::end_time, and MilliTimer.

Referenced by keepalive(), MQTTYield(), sendPacket(), and waitfor().

int TimerLeftMS ( Timer timer)

References Timer::end_time, and MilliTimer.

Referenced by readPacket(), and sendPacket().

static void WINC1500_disconnect ( Network n)
static
static int WINC1500_read ( Network n,
unsigned char *  buffer,
int  len,
int  timeout_ms 
)
static
static int WINC1500_write ( Network n,
unsigned char *  buffer,
int  len,
int  timeout_ms 
)
static

bool gbMQTTBrokerConnected =false
static
bool gbMQTTBrokerIpresolved =false
static
bool gbMQTTBrokerRecvDone =false
static
bool gbMQTTBrokerSendDone =false
static
unsigned char gcMQTTRxFIFO[MQTT_RX_POOL_SIZE]
static

Referenced by WINC1500_read().

int32_t gi32MQTTBrokerIp =0
static
int32_t gi32MQTTBrokerRxLen =0
static
char* gpcHostAddr
static
uint32_t gu32MQTTRxFIFOLen =0
static

Referenced by WINC1500_read().

uint32_t gu32MQTTRxFIFOPtr =0
static

Referenced by WINC1500_read().

unsigned long MilliTimer =0
static