SmartCard reader. PC is interface through USB or TCPport. SmartCard is interfaced through UART@ 1MHz, DIV372

Dependencies:   EthernetNetIf mbed

Committer:
bcalin1984
Date:
Sun Feb 27 22:20:40 2011 +0000
Revision:
0:5bf6fcf71548

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcalin1984 0:5bf6fcf71548 1 #include "EthernetNetIf.h"
bcalin1984 0:5bf6fcf71548 2 #include "TCPSocket.h"
bcalin1984 0:5bf6fcf71548 3
bcalin1984 0:5bf6fcf71548 4 class TcpServer
bcalin1984 0:5bf6fcf71548 5 {
bcalin1984 0:5bf6fcf71548 6 EthernetNetIf eth;
bcalin1984 0:5bf6fcf71548 7 /*
bcalin1984 0:5bf6fcf71548 8 EthernetNetIf eth(
bcalin1984 0:5bf6fcf71548 9 IpAddr(192,168,0,25), //IP Address
bcalin1984 0:5bf6fcf71548 10 IpAddr(255,255,255,0), //Network Mask
bcalin1984 0:5bf6fcf71548 11 IpAddr(192,168,0,1), //Gateway
bcalin1984 0:5bf6fcf71548 12 IpAddr(192,168,0,1) //DNS
bcalin1984 0:5bf6fcf71548 13 );*/
bcalin1984 0:5bf6fcf71548 14
bcalin1984 0:5bf6fcf71548 15
bcalin1984 0:5bf6fcf71548 16 TCPSocket ListeningSock;
bcalin1984 0:5bf6fcf71548 17 TCPSocket* pConnectedSock; // for ConnectedSock
bcalin1984 0:5bf6fcf71548 18 Host client;
bcalin1984 0:5bf6fcf71548 19 TCPSocketErr err;
bcalin1984 0:5bf6fcf71548 20 char buff[256];
bcalin1984 0:5bf6fcf71548 21
bcalin1984 0:5bf6fcf71548 22 void (*onReceive)(char* buf, int len);
bcalin1984 0:5bf6fcf71548 23 int Setup(int port);
bcalin1984 0:5bf6fcf71548 24 void onConnectedTCPSocketEvent(TCPSocketEvent e);
bcalin1984 0:5bf6fcf71548 25 void onListeningTCPSocketEvent(TCPSocketEvent e);
bcalin1984 0:5bf6fcf71548 26
bcalin1984 0:5bf6fcf71548 27 void noprintf(const char * format, ...);
bcalin1984 0:5bf6fcf71548 28 public:
bcalin1984 0:5bf6fcf71548 29 TcpServer(int port);
bcalin1984 0:5bf6fcf71548 30 static void doEvents();
bcalin1984 0:5bf6fcf71548 31 void Tprintf(const char * format, ...);
bcalin1984 0:5bf6fcf71548 32 void SetReceiveCallback(void (*f)(char*buf, int len));
bcalin1984 0:5bf6fcf71548 33 };