#include <string.h>
#include <stdio.h>
#include <dev/board.h>
#include <dev/gpio.h>
#include <sys/heap.h>
#include <sys/thread.h>
#include <sys/timer.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <net/route.h>
#include <netdb.h>
#include <pro/dhcp.h>
Go to the source code of this file.
Defines | |
#define | MY_MAC {0x00,0x06,0x98,0x20,0x00,0x00} |
#define | MY_IP "192.168.192.100" |
#define | MY_MASK "255.255.255.0" |
#define | MY_PORT 12345 |
Functions | |
void | ProcessRequests (FILE *stream) |
void | init_dio (void) |
void | service (void) |
void | service_thread (void *arg) |
int | main (void) |
#define MY_MAC {0x00,0x06,0x98,0x20,0x00,0x00} |
#define MY_PORT 12345 |
void ProcessRequests | ( | FILE * | stream | ) |
Definition at line 184 of file portdio.c.
References fflush(), fgets(), fprintf(), fputs(), GpioPinSetHigh(), GpioPinSetLow(), NutHeapAvailable, NutThreadYield(), strchr(), strlen(), and strncmp().
Referenced by main(), and service().
void init_dio | ( | void | ) |
Definition at line 333 of file portdio.c.
References GPIO_CFG_OUTPUT, GPIO_CFG_PULLUP, GpioPinConfigSet(), and GpioPinSetLow().
Referenced by main().
void service | ( | void | ) |
Definition at line 374 of file portdio.c.
References _fdopen(), fclose(), MY_PORT, NutTcpAccept(), NutTcpCloseSocket(), NutTcpCreateSocket(), and ProcessRequests().
Referenced by main(), and service_thread().
void service_thread | ( | void * | arg | ) |
Definition at line 415 of file portdio.c.
References service().
Referenced by main().
int main | ( | void | ) |
Definition at line 428 of file portdio.c.
References DEV_ETHER, DEV_ETHER_NAME, inet_addr(), init_dio(), MY_IP, MY_MAC, MY_MASK, NutDhcpIfConfig(), NutNetIfConfig(), NutRegisterDevice(), NutThreadCreate(), service(), and service_thread().