coapthon.server package¶
Submodules¶
coapthon.server.coap module¶
- class coapthon.server.coap.CoAP(server_address, multicast=False, starting_mid=None, sock=None, cb_ignore_listen_exception=None)[source]¶
Bases: object
Implementation of the CoAP server
- add_resource(path, resource)[source]¶
Helper function to add resources to the resource directory during server initialization.
Parameters: - path – the path for the new created resource
- resource (Resource) – the resource to be added
- listen(timeout=10)[source]¶
Listen for incoming messages. Timeout is used to check if the server must be switched off.
Parameters: timeout – Socket Timeout in seconds
- notify(resource)[source]¶
Notifies the observers of a certain resource.
Parameters: resource – the resource
- receive_request(transaction)[source]¶
Handle requests coming from the udp socket.
Parameters: transaction – the transaction created to manage the request