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

Go to the source code of this file.

Macros

#define TCP_SEND   "SET VALUE=%d\r\n"
 
#define TCP_RECEIVE   "GET RANDOM VALUE\r\n"
 
#define TCP_SET_RESPONSE   "SET OK"
 
#define TCP_GET_RESPONSE   "GET OK"
 
#define IP_REMOTE   80
 
#define IP_PROTO   18
 

Functions

uint8_t Tcp_start (char *ssid, uint32_t AuthMode, char *passw)
 
uint8_t Tcp_sendValue (char *ipAddress, uint32_t remotePort, uint32_t value)
 
int32_t Tcp_receiveValue (char *address, uint32_t remotePort)
 

Variables

xSemaphoreHandle xMutexTcp
 

Macro Definition Documentation

#define IP_PROTO   18

Definition at line 25 of file Tcp.c.

#define IP_REMOTE   80

Definition at line 24 of file Tcp.c.

#define TCP_GET_RESPONSE   "GET OK"

Definition at line 22 of file Tcp.c.

#define TCP_RECEIVE   "GET RANDOM VALUE\r\n"

Definition at line 20 of file Tcp.c.

Referenced by Tcp_receiveValue().

#define TCP_SEND   "SET VALUE=%d\r\n"

Definition at line 19 of file Tcp.c.

Referenced by Tcp_sendValue().

#define TCP_SET_RESPONSE   "SET OK"

Definition at line 21 of file Tcp.c.

Referenced by Tcp_sendValue().

Function Documentation

int32_t Tcp_receiveValue ( char *  address,
uint32_t  remotePort 
)

Send a TCP command and receive the server response.

Parameters
addressdestination IP address.
remotePortremote port number.
Returns
Returns whether the transmission was successful. SUCCESS = TRUE, ERROR = FALSE.

Definition at line 80 of file Tcp.c.

References resp, TCP_RECEIVE, TRUE, Wifly_TCPReceive(), Wifly_WLANConnectPing(), and xMutexTcp.

Here is the call graph for this function:

uint8_t Tcp_sendValue ( char *  ipAddress,
uint32_t  remotePort,
uint32_t  value 
)

Send a TCP command and send the server response.

Parameters
ipAddressdestination IP address.
remotePortremote port number.
valuenumerical value to send.
Returns
Returns whether the transmission was successful. SUCCESS = TRUE, ERROR = FALSE.

Definition at line 60 of file Tcp.c.

References FALSE, TCP_SEND, TCP_SET_RESPONSE, TRUE, Wifly_TCPSend(), Wifly_WLANConnectPing(), and xMutexTcp.

Here is the call graph for this function:

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

Start Tcp settings

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

Definition at line 41 of file Tcp.c.

References FALSE, NULL, and xMutexTcp.

Variable Documentation

xSemaphoreHandle xMutexTcp

Definition at line 27 of file Tcp.c.

Referenced by Tcp_receiveValue(), Tcp_sendValue(), and Tcp_start().