Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 92206a7

Browse files
committed
docs/network: Move confusingly-named cc3200 Server class to its reference.
cc3200 port has network.Server class to control behavior of builtin Telnet/FTP server of that port.
1 parent 22ca539 commit 92206a7

File tree

2 files changed

+37
-46
lines changed

2 files changed

+37
-46
lines changed

docs/library/network.rst

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,52 +29,6 @@ For example::
2929
data = s.recv(1000)
3030
s.close()
3131

32-
.. only:: port_wipy
33-
34-
.. _network.Server:
35-
36-
class Server
37-
============
38-
39-
The ``Server`` class controls the behaviour and the configuration of the FTP and telnet
40-
services running on the WiPy. Any changes performed using this class' methods will
41-
affect both.
42-
43-
Example::
44-
45-
import network
46-
server = network.Server()
47-
server.deinit() # disable the server
48-
# enable the server again with new settings
49-
server.init(login=('user', 'password'), timeout=600)
50-
51-
Constructors
52-
------------
53-
54-
.. class:: network.Server(id, ...)
55-
56-
Create a server instance, see ``init`` for parameters of initialization.
57-
58-
Methods
59-
-------
60-
61-
.. method:: server.init(\*, login=('micro', 'python'), timeout=300)
62-
63-
Init (and effectively start the server). Optionally a new ``user``, ``password``
64-
and ``timeout`` (in seconds) can be passed.
65-
66-
.. method:: server.deinit()
67-
68-
Stop the server
69-
70-
.. method:: server.timeout([timeout_in_seconds])
71-
72-
Get or set the server timeout.
73-
74-
.. method:: server.isrunning()
75-
76-
Returns ``True`` if the server is running, ``False`` otherwise.
77-
7832
.. only:: port_pyboard
7933

8034
class CC3K

docs/wipy/general.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,40 @@ Unrelated function in machine module
323323
this function is not called then the default file main.py will be executed.
324324

325325
It only makes sense to call this function from within boot.py.
326+
327+
Adhoc way to control telnet/FTP server via network module
328+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
329+
330+
The ``Server`` class controls the behaviour and the configuration of the FTP and telnet
331+
services running on the WiPy. Any changes performed using this class' methods will
332+
affect both.
333+
334+
Example::
335+
336+
import network
337+
server = network.Server()
338+
server.deinit() # disable the server
339+
# enable the server again with new settings
340+
server.init(login=('user', 'password'), timeout=600)
341+
342+
.. class:: network.Server(id, ...)
343+
344+
Create a server instance, see ``init`` for parameters of initialization.
345+
346+
.. method:: server.init(\*, login=('micro', 'python'), timeout=300)
347+
348+
Init (and effectively start the server). Optionally a new ``user``, ``password``
349+
and ``timeout`` (in seconds) can be passed.
350+
351+
.. method:: server.deinit()
352+
353+
Stop the server
354+
355+
.. method:: server.timeout([timeout_in_seconds])
356+
357+
Get or set the server timeout.
358+
359+
.. method:: server.isrunning()
360+
361+
Returns ``True`` if the server is running, ``False`` otherwise.
362+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy