From 51ec2c7c473c0379c5a4ac5ac0ffe19ce2daa9d1 Mon Sep 17 00:00:00 2001 From: Joerg Deckert Date: Fri, 13 Dec 2013 09:12:42 +0100 Subject: [PATCH] handle is long (not byte) --- lib/reg-ios.spin | 32 ++++++++++++++-------------- system/administra/admnet/admnet.spin | 32 ++++++++++++++-------------- system/regnatix/ftp.spin | 11 +++++----- 3 files changed, 37 insertions(+), 38 deletions(-) diff --git a/lib/reg-ios.spin b/lib/reg-ios.spin index dc06d6e..fd8832b 100644 --- a/lib/reg-ios.spin +++ b/lib/reg-ios.spin @@ -1054,7 +1054,7 @@ PUB lan_connect(ipaddr, remoteport): handle '' : (driver_socket.spin handelt per default bis 4 Sockets) ''eingabe : - ''ausgabe : - -''busprotokoll : [073][sub_putlong.ipaddr][sub_putword.remoteport][get.handle] +''busprotokoll : [073][sub_putlong.ipaddr][sub_putword.remoteport][sub_getlong.handle] '' : ipaddr - ipv4 address packed into a long (ie: 1.2.3.4 => $01_02_03_04) '' : remoteport - port number to connect to '' : handle - lfd. Nr. der Verbindung @@ -1062,7 +1062,7 @@ PUB lan_connect(ipaddr, remoteport): handle bus_putchar1(gc#a_lanConnect) bus_putlong1(ipaddr) bus_putword1(remoteport) - handle := bus_getchar1 + handle := bus_getlong1 PUB lan_listen PUB lan_relisten @@ -1071,12 +1071,12 @@ PUB lan_isconnected(handle): connected ''funktion : Abfrage, ob Socket verbunden ''eingabe : - ''ausgabe : - -''busprotokoll : [076][put.handle][get.connected] +''busprotokoll : [076][sub_putlong.handle][get.connected] '' : handle - lfd. Nr. der zu testenden Verbindung '' : connected - True, if connected bus_putchar1(gc#a_lanIsConnected) - bus_putchar1(handle) + bus_putlong1(handle) connected := bus_getchar1 PUB lan_rxcount @@ -1085,24 +1085,24 @@ PUB lan_resetbuffers(handle) ''funktion : Sende- und Empfangspuffer zurücksetzen ''eingabe : - ''ausgabe : - -''busprotokoll : [078][put.handle] +''busprotokoll : [078][sub_putlong.handle] '' : handle - lfd. Nr. der Verbindung bus_putchar1(gc#a_lanResetBuffers) - bus_putchar1(handle) + bus_putlong1(handle) PUB lan_waitconntimeout(handle, timeout): connected ''funktionsgruppe : lan ''funktion : bestimmte Zeit auf Verbindung warten ''eingabe : - ''ausgabe : - -''busprotokoll : [079][put.handle][sub_putword.timeout][get.connected] +''busprotokoll : [079][sub_putlong.handle][sub_putword.timeout][get.connected] '' : handle - lfd. Nr. der zu testenden Verbindung '' : timeout - Timeout in Millisekunden '' : connected - True, if connected bus_putchar1(gc#a_lanWaitConnTimeout) - bus_putchar1(handle) + bus_putlong1(handle) bus_putword1(timeout) connected := bus_getchar1 @@ -1111,11 +1111,11 @@ PUB lan_close(handle) ''funktion : TCP-Verbindung (ein- oder ausgehend) schließen ''eingabe : - ''ausgabe : - -''busprotokoll : [080][put.handle] +''busprotokoll : [080][sub_putlong.handle] '' : handle - lfd. Nr. der zu schließenden Verbindung bus_putchar1(gc#a_lanClose) - bus_putchar1(handle) + bus_putlong1(handle) PUB lan_rxflush PUB lan_rxcheck(handle): rxbyte @@ -1125,14 +1125,14 @@ PUB lan_rxcheck(handle): rxbyte '' : (vor allem nicht, wenn -1 und -3 enthalten sein können) ''eingabe : - ''ausgabe : - -''busprotokoll : [082][put.handle][get.rxbyte] +''busprotokoll : [082][sub_putlong.handle][get.rxbyte] '' : handle - lfd. Nr. der Verbindung '' : rxbyte - empfangenes Zeichen (0 - 127) oder '' : sock#RETBUFFEREMPTY (-1) wenn Puffer leer '' : sock#ERRSOCKETCLOSED (-3) wenn keine Verbindung mehr bus_putchar1(gc#a_lanRXCheck) - bus_putchar1(handle) + bus_putlong1(handle) rxbyte := bus_getchar1 PUB lan_rxtime(handle, timeout): rxbyte @@ -1141,14 +1141,14 @@ PUB lan_rxtime(handle, timeout): rxbyte '' : nicht verwenden, wenn anderes als ASCII (0 - 127) empfangen wird ''eingabe : - ''ausgabe : - -''busprotokoll : [083][put.handle][sub_putword.timeout][get.rxbyte] +''busprotokoll : [083][sub_putlong.handle][sub_putword.timeout][get.rxbyte] '' : handle - lfd. Nr. der Verbindung '' : timeout - Timeout in Millisekunden '' : rxbyte - empfangenes Zeichen (0 - 127) oder '' : sock#RETBUFFEREMPTY (-1) wenn Timeout oder keine Verbindung mehr bus_putchar1(gc#a_lanRXTime) - bus_putchar1(handle) + bus_putlong1(handle) bus_putword1(timeout) rxbyte := bus_getchar1 @@ -1163,13 +1163,13 @@ PUB lan_txcheck(handle, txbyte): error '' : (vor allem nicht, wenn -1 enthalten sein kann) ''eingabe : - ''ausgabe : - -''busprotokoll : [088][put.handle][put.tybyte][get.error] +''busprotokoll : [088][sub_putlong.handle][put.tybyte][get.error] '' : handle - lfd. Nr. der Verbindung '' : txbyte - zu sendendes Zeichen '' : error - ungleich Null bei Fehler bus_putchar1(gc#a_lanTXCheck) - bus_putchar1(handle) + bus_putlong1(handle) bus_putchar1(txbyte) error := bus_getchar1 diff --git a/system/administra/admnet/admnet.spin b/system/administra/admnet/admnet.spin index f18fdac..f9ca32b 100644 --- a/system/administra/admnet/admnet.spin +++ b/system/administra/admnet/admnet.spin @@ -1182,7 +1182,7 @@ PRI lan_connect | ipaddr, remoteport, handle '' : (driver_socket.spin handelt per default bis 4 Sockets) ''eingabe : - ''ausgabe : - -''busprotokoll : [073][sub_getlong.ipaddr][sub_getword.remoteport][put.handle] +''busprotokoll : [073][sub_getlong.ipaddr][sub_getword.remoteport][sub_putlong.handle] '' : ipaddr - ipv4 address packed into a long (ie: 1.2.3.4 => $01_02_03_04) '' : remoteport - port number to connect to '' : handle - lfd. Nr. der Verbindung @@ -1192,7 +1192,7 @@ PRI lan_connect | ipaddr, remoteport, handle handle := sock.connect(ipaddr, remoteport, @bufrxconn, rxlen, @buftxconn, txlen) - bus_putchar(handle) 'handle senden + sub_putlong(handle) 'handle senden PRI lan_listen @@ -1202,11 +1202,11 @@ PRI lan_isconnected | handle ''funktion : Abfrage, ob Socket verbunden ''eingabe : - ''ausgabe : - -''busprotokoll : [076][get.handle][put.connected] +''busprotokoll : [076][sub_getlong.handle][put.connected] '' : handle - lfd. Nr. der zu testenden Verbindung '' : connected - True, if connected - handle := bus_getchar + handle := sub_getlong bus_putchar(sock.isConnected(handle)) @@ -1216,10 +1216,10 @@ PRI lan_resetbuffers | handle ''funktion : Sende- und Empfangspuffer zurücksetzen ''eingabe : - ''ausgabe : - -''busprotokoll : [078][get.handle] +''busprotokoll : [078][sub_getlong.handle] '' : handle - lfd. Nr. der Verbindung - handle := bus_getchar + handle := sub_getlong sock.resetBuffers(handle) @@ -1228,12 +1228,12 @@ PRI lan_waitconntimeout | handle, timeout, t, connected ''funktion : bestimmte Zeit auf Verbindung warten ''eingabe : - ''ausgabe : - -''busprotokoll : [079][get.handle][sub_getword.timeout][put.connected] +''busprotokoll : [079][sub_getlong.handle][sub_getword.timeout][put.connected] '' : handle - lfd. Nr. der zu testenden Verbindung '' : timeout - Timeout in Millisekunden '' : connected - True, if connected - handle := bus_getchar + handle := sub_getlong timeout := sub_getword t := cnt @@ -1246,10 +1246,10 @@ PRI lan_close | handle ''funktion : TCP-Verbindung (ein- oder ausgehend) schließen ''eingabe : - ''ausgabe : - -''busprotokoll : [080][get.handle] +''busprotokoll : [080][sub_getlong.handle] '' : handle - lfd. Nr. der zu schließenden Verbindung - handle := bus_getchar + handle := sub_getlong sock.close(handle) @@ -1261,13 +1261,13 @@ PRI lan_rxcheck | handle, rxbyte '' : (vor allem nicht, wenn -1 und -3 enthalten sein können) ''eingabe : - ''ausgabe : - -''busprotokoll : [082][get.handle][put.rxbyte] +''busprotokoll : [082][sub_getlong.handle][put.rxbyte] '' : handle - lfd. Nr. der Verbindung '' : rxbyte - empfangenes Zeichen (0 - 127) oder '' : sock#RETBUFFEREMPTY (-1) wenn Puffer leer '' : sock#ERRSOCKETCLOSED (-3) wenn keine Verbindung mehr - handle := bus_getchar + handle := sub_getlong rxbyte := sock.readByteNonBlocking(handle) if (not sock.isConnected(handle)) and (rxbyte == -1) @@ -1281,13 +1281,13 @@ PRI lan_rxtime | handle, timeout, t, rxbyte '' : nicht verwenden, wenn anderes als ASCII (0 - 127) empfangen wird ''eingabe : - ''ausgabe : - -''busprotokoll : [083][get.handle][sub_getword.timeout][put.rxbyte] +''busprotokoll : [083][sub_getlong.handle][sub_getword.timeout][put.rxbyte] '' : handle - lfd. Nr. der Verbindung '' : timeout - Timeout in Millisekunden '' : rxbyte - empfangenes Zeichen (0 - 127) oder '' : sock#RETBUFFEREMPTY (-1) wenn Timeout oder keine Verbindung mehr - handle := bus_getchar + handle := sub_getlong timeout := sub_getword t := cnt @@ -1306,12 +1306,12 @@ PRI lan_txcheck | handle, txbyte '' : (vor allem nicht, wenn -1 enthalten sein kann) ''eingabe : - ''ausgabe : - -''busprotokoll : [088][get.handle][get.tybyte][put.error] +''busprotokoll : [088][sub_getlong.handle][get.tybyte][put.error] '' : handle - lfd. Nr. der Verbindung '' : txbyte - zu sendendes Zeichen '' : error - ungleich Null bei Fehler - handle := bus_getchar + handle := sub_getlong txbyte := bus_getchar ifnot sock.isConnected(handle) diff --git a/system/regnatix/ftp.spin b/system/regnatix/ftp.spin index 9928794..ca23bbc 100644 --- a/system/regnatix/ftp.spin +++ b/system/regnatix/ftp.spin @@ -46,8 +46,8 @@ VAR byte parastr[64] byte strTemp[128] byte addrset - byte handle_control 'Handle FTP Control Verbindung - byte handle_data 'Handle FTP Data Verbindung + long handle_control 'Handle FTP Control Verbindung + long handle_data 'Handle FTP Data Verbindung PUB main @@ -68,16 +68,15 @@ PUB main ios.print(string("Starte LAN...")) ios.printnl ios.lanstart - delay_ms(5000) 'nach ios.lanstart dauert es, bis der Stack funktioniert + delay_ms(1000) 'nach ios.lanstart dauert es, bis der Stack funktioniert ios.print(string("Verbinde mit FTP-Server...")) ios.printnl handle_control := ios.lan_connect(ip_addr, 21) - ios.lan_resetbuffers(handle_control) +'' ios.lan_resetbuffers(handle_control) ios.print(string("Handle Connect: ")) - ios.print(num.ToStr(handle_control, num#DEC)) + ios.print(num.ToStr(handle_control, num#HEX)) ios.printnl if (ios.lan_waitconntimeout(handle_control, 2000)) - delay_ms(5000) ios.print(string("Verbindung mit FTP-Server hergestellt.")) ios.printnl if getResponse(string("220 "))