;********************************************************************** ; ; Copyright (C) 2007-2008 Elmar Hanlhofer http://www.plop.at ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; ; ;********************************************************************** .equ AF_INET = 2 ; address format .equ SOCK_STREAM = 1 ; address type TCP .equ SOCK_DGRAM = 2 ; address type UDP ;-------------------------------------------- ;.equ EM01_PORT = PORTC ;.equ EM01_PIN = PINC ;.equ EM01_DDR = DDRC ;.equ EM01_BAUD0 = PC0 ;.equ EM01_BAUD1 = PC1 ;.equ EM01_BAUD2 = PC2 ;.equ EM01_CTS = PC3 ;.equ EM01_RTS = PC4 ;.equ EM01_RESET = PC5 ;-------------------------------------------- .equ NET_ID_DATAPACKET = 0x50 .equ NET_CMDSTARTBYTE = 0x21 .equ NET_TERMINATORBYTE = 0x2C .equ NET_ENDBYTE = 0x3B .equ NET_CMDID_SETLOCALIP = 0x01 .equ NET_CMDSUBID_SETLOCALIP = 0x04 .equ NET_CMDLEN_SETLOCALIP = 0x0f .equ NET_CMDID_OPENSOCKET = 0x03 .equ NET_CMDLEN_OPENSOCKET = 0x07 .equ NET_CMDID_BIND = 0x04 .equ NET_CMDLEN_BIND = 28 .equ NET_CMDID_CONNECT = 0x05 .equ NET_CMDLEN_CONNECT = 33 .equ NET_CMDID_LISTEN = 0x06 .equ NET_CMDLEN_LISTEN = 13 .equ NET_CMDID_CLOSESOCKET = 0x07 .equ NET_CMDLEN_CLOSESOCKET = 0x09 .equ NET_CMDID_SENDDATATCP = 0x08 ;-------------------------------------------- .equ NET_ACTIONID_ONACCEPT = 64 .equ NET_ACTIONID_ONRECEIVEDATA_TCP = 65 .equ NET_ACTIONID_ONREMOTECLOSE = 66 ;-------------------------------------------- .equ NET_INITSOCKET_CONNECT = 1 .equ NET_INITSOCKET_LISTEN = 2 .equ NET_INITSOCKET_ACCEPT = 3