ACKme Logo WiConnect Host Library- API Reference Guide
 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Miscellaneous Methods

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...
 

Detailed Description

Miscellaneous socket methods.

Function Documentation

WiconnectResult wiconnect::SocketInterface::closeAllSockets ( )

Close all opened sockets.

Note
This closes all open sockets on the MODULE side. Socket objects on the HOST side will be still open until issuing a read/write command to the module using the socket handle.
Returns
Result of method. See WiconnectResult
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.

Parameters
[out]socketWiconnectSocket object of opened connection.
[in]typeThe SocketType of connection to open
[in]hostThe host/IP address of the remote server
[in]remortPortThe port of the remote server
[in]localPortThe port of the module's side of the connection
[in]argsDepedent on the connection type
[in]irqPinData available external interrupt pin. See registerSocketIrqHandler() for more info
Returns
Result of method. See WiconnectResult
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:

  1. The supplied irqPin is configured as an external interrupt pin.
  2. A connection is opened and configured with the same irqPin. This irqPin physically connected to a GPIO on the WiFi module.
  3. When the WiFi module has data to send to the HOST it asserts the irqPin.
  4. The irqPin interrupt executes and calls the supplied handler.
  5. The handler should notify the HOST that the given irqPin has triggered and have the associated socket read data from the module.

    Note
    arg1 of the handler contains the irqPin
    Parameters
    [in]irqPinThe HOST pin to configure as an external interrupt. This pin should be physically connected to a module GPIO.
    [in]handlerCallback to be executed with the external irqPin interrupt triggers
    Returns
    Result of method. See WiconnectResult
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.

Parameters
[in]irqPinThe HOST pin to unregister
Returns
Result of method. See WiconnectResult