@@ -1,4 +1,4 | |||||
1 | import tftpy |
|
1 | #import tftpy | |
2 | import socket |
|
2 | import socket | |
3 |
|
3 | |||
4 | class UDPServer: |
|
4 | class UDPServer: | |
@@ -72,7 +72,7 | |||||
72 | # Send messages |
|
72 | # Send messages | |
73 | if(self.socket_c.sendto(TxFrame, self.multicast_addr)): |
|
73 | if(self.socket_c.sendto(TxFrame, self.multicast_addr)): | |
74 | print "Sending message:[" + TxFrame + "]" |
|
74 | print "Sending message:[" + TxFrame + "]" | |
75 |
|
75 | |||
76 | data_rx, server_rx = self.socket_c.recvfrom(16) |
|
76 | data_rx, server_rx = self.socket_c.recvfrom(16) | |
77 |
|
77 | |||
78 | print "Data received ", data_rx, server_rx |
|
78 | print "Data received ", data_rx, server_rx | |
@@ -127,12 +127,12 | |||||
127 | if(self.socket_c.sendto(TxFrame, self.addr)): |
|
127 | if(self.socket_c.sendto(TxFrame, self.addr)): | |
128 | print "Sending message:[" + TxFrame + "]" |
|
128 | print "Sending message:[" + TxFrame + "]" | |
129 |
|
129 | |||
130 | data_rx, server_rx = self.socket_c.recvfrom(16) |
|
130 | # data_rx, server_rx = self.socket_c.recvfrom(16) | |
131 |
|
131 | # | ||
132 | print "Data received ", data_rx, server_rx |
|
132 | # print "Data received ", data_rx, server_rx | |
133 |
|
133 | |||
134 | # Close socket |
|
134 | # Close socket | |
135 | self.socket_c.close() |
|
135 | #self.socket_c.close() | |
136 |
|
136 | |||
137 | def sendTxRxCommand(self, cmd, data, nbytes = 16384): |
|
137 | def sendTxRxCommand(self, cmd, data, nbytes = 16384): | |
138 |
|
138 | |||
@@ -176,25 +176,25 | |||||
176 |
|
176 | |||
177 | return ipSource, ipDestino, cmd, data |
|
177 | return ipSource, ipDestino, cmd, data | |
178 |
|
178 | |||
179 | class FTPComm: |
|
179 | #class FTPComm: | |
180 |
|
180 | # | ||
181 | ftp_servidor = 'ftp.servidor.com' |
|
181 | # ftp_servidor = 'ftp.servidor.com' | |
182 | ftp_usuario = 'miusuario' |
|
182 | # ftp_usuario = 'miusuario' | |
183 | ftp_clave = 'miclave' |
|
183 | # ftp_clave = 'miclave' | |
184 | ftp_raiz = '/public_html' |
|
184 | # ftp_raiz = '/public_html' | |
185 |
|
185 | # | ||
186 | def __init__(self): |
|
186 | # def __init__(self): | |
187 |
|
187 | # | ||
188 | self.client = tftpy.TftpClient(self.ftp_servidor, '69') |
|
188 | # self.client = tftpy.TftpClient(self.ftp_servidor, '69') | |
189 |
|
189 | # | ||
190 |
|
190 | # | ||
191 | def sendFile(self, filename): |
|
191 | # def sendFile(self, filename): | |
192 |
|
192 | # | ||
193 | self.client.upload(filename) |
|
193 | # self.client.upload(filename) | |
194 |
|
194 | # | ||
195 | if __name__ == '__main__': |
|
195 | #if __name__ == '__main__': | |
196 |
|
196 | # | ||
197 | obj = FTPComm() |
|
197 | # obj = FTPComm() | |
198 |
|
198 | |||
199 |
|
199 | |||
200 | No newline at end of file |
|
200 |
General Comments 0
You need to be logged in to leave comments.
Login now