![]() |
WiConnect Host Library- API Reference Guide | ||
Miscellaneous socket methods. More...
Functions | |
WiconnectResult | wiconnect::SocketInterface::closeAllSockets () |
Close all opened sockets. More... | |
WiconnectResult | wiconnect::SocketInterface::registerSocketIrqHandler (Pin irqPin, const Callback &handler) |
Register a host pin as an external interrupt. When the external interrupt is triggered, the supplied callback is executed. More... | |
WiconnectResult | wiconnect::SocketInterface::unregisterSocketIrqHandler (Pin irqPin) |
Unregister a previously registered IRQ pin. More... | |
WiconnectResult | wiconnect::SocketInterface::connect (WiconnectSocket &socket, SocketType type, const char *host, uint16_t remortPort, uint16_t localPort, const void *args, Pin irqPin) |
Connect to remote server. More... | |
Miscellaneous socket methods.
WiconnectResult wiconnect::SocketInterface::closeAllSockets | ( | ) |
Close all opened sockets.
WiconnectResult wiconnect::SocketInterface::connect | ( | WiconnectSocket & | socket, |
SocketType | type, | ||
const char * | host, | ||
uint16_t | remortPort, | ||
uint16_t | localPort, | ||
const void * | args, | ||
Pin | irqPin | ||
) |
Connect to remote server.
This is the base method used by all the other connect methods.
[out] | socket | WiconnectSocket object of opened connection. |
[in] | type | The SocketType of connection to open |
[in] | host | The host/IP address of the remote server |
[in] | remortPort | The port of the remote server |
[in] | localPort | The port of the module's side of the connection |
[in] | args | Depedent on the connection type |
[in] | irqPin | Data available external interrupt pin. See registerSocketIrqHandler() for more info |
WiconnectResult wiconnect::SocketInterface::registerSocketIrqHandler | ( | Pin | irqPin, |
const Callback & | handler | ||
) |
Register a host pin as an external interrupt. When the external interrupt is triggered, the supplied callback is executed.
This should be called before calling one of the connect methods below with an irqPin parameter.
Basically how this works is:
The handler should notify the HOST that the given irqPin has triggered and have the associated socket read data from the module.
[in] | irqPin | The HOST pin to configure as an external interrupt. This pin should be physically connected to a module GPIO. |
[in] | handler | Callback to be executed with the external irqPin interrupt triggers |
WiconnectResult wiconnect::SocketInterface::unregisterSocketIrqHandler | ( | Pin | irqPin | ) |
Unregister a previously registered IRQ pin.
This disables the given irqPin as an external interrupt. Refer to registerSocketIrqHandler() for more information.
[in] | irqPin | The HOST pin to unregister |