state

Description

Returns the state of the Ethernet object

Syntax

<ENet object>.state()

Return Value

Parameter

Description

Remarks

1

Connected

(In the case of UDP, just opening it will be considered a connection. In the case of TCP, connecting after opening will be considered a connection.)

0

Not connected

-1

Failed to create the Ethernet socket

-2

Failed to bind the Ethernet device

Example

ret = enet_to_sensor.state()

Last updated

Was this helpful?