Wifly Driver  V1.0
Macros | Functions | Variables
Udp.c File Reference
#include "LPC17xx.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "Type.h"
#include "WiFly.h"
#include "Udp.h"
#include "FreeRTOS.h"
#include "semphr.h"
Include dependency graph for Udp.c:

Go to the source code of this file.

Macros

#define UDP_SEND   "SET VALUE=%d"
 
#define UDP_RECEIVE   "GET RANDOM VALUE"
 
#define UDP_SET_RESPONSE   "SET OK"
 
#define UDP_GET_RESPONSE   "GET OK"
 
#define IP_REMOTE   80
 
#define IP_PROTO   18
 

Functions

uint8_t Udp_start (char *ssid, uint32_t AuthMode, char *passw)
 
uint8_t Udp_sendValue (char *ipAddress, uint32_t localPort, uint32_t remotePort, uint32_t value)
 
int32_t Udp_receiveValue (char *address, uint32_t localPort, uint32_t remotePort)
 

Variables

xSemaphoreHandle xMutexUdp
 

Macro Definition Documentation

#define IP_PROTO   18

Definition at line 25 of file Udp.c.

#define IP_REMOTE   80

Definition at line 24 of file Udp.c.

#define UDP_GET_RESPONSE   "GET OK"

Definition at line 22 of file Udp.c.

#define UDP_RECEIVE   "GET RANDOM VALUE"

Definition at line 20 of file Udp.c.

Referenced by Udp_receiveValue().

#define UDP_SEND   "SET VALUE=%d"

Definition at line 19 of file Udp.c.

Referenced by Udp_sendValue().

#define UDP_SET_RESPONSE   "SET OK"

Definition at line 21 of file Udp.c.

Referenced by Udp_sendValue().

Function Documentation

int32_t Udp_receiveValue ( char *  address,
uint32_t  localPort,
uint32_t  remotePort 
)

Send a UDP command and receive the server response.

Parameters
addressDestination IP address.
localPortLocal port number.
remotePortRemote port number.
Returns
Returns whether the transmission was successful. SUCCESS = TRUE, ERROR = FALSE.

Definition at line 80 of file Udp.c.

References resp, TRUE, UDP_RECEIVE, Wifly_UDPReceive(), Wifly_WLANConnectPing(), and xMutexUdp.

Here is the call graph for this function:

uint8_t Udp_sendValue ( char *  ipAddress,
uint32_t  localPort,
uint32_t  remotePort,
uint32_t  value 
)

Send a UDP command and send the server response.

Parameters
ipAddressDestination IP address.
localPortLocal port number.
remotePortRemote port number.
valueNumerical value to send.
Returns
Returns whether the transmission was successful. SUCCESS = TRUE, ERROR = FALSE.

Definition at line 60 of file Udp.c.

References FALSE, TRUE, UDP_SEND, UDP_SET_RESPONSE, Wifly_UDPSend(), Wifly_WLANConnectPing(), and xMutexUdp.

Here is the call graph for this function:

uint8_t Udp_start ( char *  ssid,
uint32_t  AuthMode,
char *  passw 
)

Start Udp settings

Parameters
ssidSSID name.
AuthModeAuthentication mode:
passwpassword
Returns
TRUE, FALSE

Definition at line 41 of file Udp.c.

References FALSE, NULL, and xMutexUdp.

Variable Documentation

xSemaphoreHandle xMutexUdp

Definition at line 27 of file Udp.c.

Referenced by Udp_receiveValue(), Udp_sendValue(), and Udp_start().