Simulated product dispenser

Dependencies:   HTS221

Fork of mbed-cloud-workshop-connect-HTS221 by Jim Carver

Embed: (wiki syntax)

« Back to documentation index

ISM43362 Class Reference

ISM43362 Class Reference

ISM43362Interface class. More...

#include <ISM43362.h>

Public Member Functions

uint32_t get_firmware_version (void)
 Check firmware version of ISM43362.
bool reset (void)
 Reset ISM43362.
bool dhcp (bool enabled)
 Enable/Disable DHCP.
int connect (const char *ap, const char *passPhrase, ism_security_t ap_sec)
 Connect ISM43362 to AP.
bool disconnect (void)
 Disconnect ISM43362 from AP.
const char * getIPAddress (void)
 Get the IP address of ISM43362.
const char * getMACAddress (void)
 Get the MAC address of ISM43362.
const char * getGateway ()
 Get the local gateway.
const char * getNetmask ()
 Get the local network mask.
bool isConnected (void)
 Check if ISM43362 is conenected.
int scan (WiFiAccessPoint *res, unsigned limit)
 Scan for available networks.
bool dns_lookup (const char *name, char *ip)
 Perform a dns query.
bool open (const char *type, int id, const char *addr, int port)
 Open a socketed connection.
bool send (int id, const void *data, uint32_t amount)
 Sends data to an open socket.
int32_t recv (int id, void *data, uint32_t amount)
 Receives data from an open socket.
bool close (int id)
 Closes a socket.
bool readable ()
 Checks if data is available.
bool writeable ()
 Checks if data can be written.
void attach (Callback< void()> func)
 Attach a function to call whenever network state has changed.
int check_recv_status (int id, void *data)
 Check is datas are available to read for a socket.
template<typename T , typename M >
void attach (T *obj, M method)
 Attach a function to call whenever network state has changed.

Detailed Description

ISM43362Interface class.

This is an interface to a ISM43362 radio.

Definition at line 49 of file ISM43362.h.


Member Function Documentation

void attach ( Callback< void()>  func )

Attach a function to call whenever network state has changed.

Parameters:
funcA pointer to a void function, or 0 to set as none

Definition at line 695 of file ISM43362.cpp.

void attach ( T *  obj,
method 
)

Attach a function to call whenever network state has changed.

Parameters:
objpointer to the object to call the member function on
methodpointer to the member function to call

Definition at line 222 of file ISM43362.h.

int check_recv_status ( int  id,
void *  data 
)

Check is datas are available to read for a socket.

Parameters:
idsocket id
dataplaceholder for returned information
amountsize to read for the check
Returns:
amount of read value, or -1 for errors

Definition at line 601 of file ISM43362.cpp.

bool close ( int  id )

Closes a socket.

Parameters:
idid of socket to close, valid only 0-4
Returns:
true only if socket is closed successfully

Definition at line 664 of file ISM43362.cpp.

int connect ( const char *  ap,
const char *  passPhrase,
ism_security_t  ap_sec 
)

Connect ISM43362 to AP.

Parameters:
apthe name of the AP
passPhrasethe password of AP
ap_secthe security level of network AP
Returns:
nsapi_error enum

Definition at line 195 of file ISM43362.cpp.

bool dhcp ( bool  enabled )

Enable/Disable DHCP.

Parameters:
enabledDHCP enabled when true
Returns:
true only if ISM43362 enables/disables DHCP successfully

Definition at line 190 of file ISM43362.cpp.

bool disconnect ( void   )

Disconnect ISM43362 from AP.

Returns:
true only if ISM43362 is disconnected successfully

Definition at line 235 of file ISM43362.cpp.

bool dns_lookup ( const char *  name,
char *  ip 
)

Perform a dns query.

Parameters:
nameHostname to resolve
ipBuffer to store IP address
Returns:
0 true on success, false on failure

Definition at line 546 of file ISM43362.cpp.

uint32_t get_firmware_version ( void   )

Check firmware version of ISM43362.

Returns:
fw version or null if no version is read

Definition at line 86 of file ISM43362.cpp.

const char * getGateway (  )

Get the local gateway.

Returns:
Null-terminated representation of the local gateway or null if no network mask has been recieved

Definition at line 285 of file ISM43362.cpp.

const char * getIPAddress ( void   )

Get the IP address of ISM43362.

Returns:
null-teriminated IP address or null if no IP address is assigned

Definition at line 240 of file ISM43362.cpp.

const char * getMACAddress ( void   )

Get the MAC address of ISM43362.

Returns:
null-terminated MAC address or null if no MAC address is assigned

Definition at line 273 of file ISM43362.cpp.

const char * getNetmask (  )

Get the local network mask.

Returns:
Null-terminated representation of the local network mask or null if no network mask has been recieved

Definition at line 311 of file ISM43362.cpp.

bool isConnected ( void   )

Check if ISM43362 is conenected.

Returns:
true only if the chip has an IP address

Definition at line 421 of file ISM43362.cpp.

bool open ( const char *  type,
int  id,
const char *  addr,
int  port 
)

Open a socketed connection.

Parameters:
typethe type of socket to open "UDP" or "TCP"
idid to give the new socket, valid 0-4
portport to open connection with
addrthe IP address of the destination
Returns:
true only if socket opened successfully

Definition at line 495 of file ISM43362.cpp.

bool readable ( void   )

Checks if data is available.

Definition at line 683 of file ISM43362.cpp.

int32_t recv ( int  id,
void *  data,
uint32_t  amount 
)

Receives data from an open socket.

Parameters:
idid to receive from
dataplaceholder for returned information
amountnumber of bytes to be received
Returns:
the number of bytes received
bool reset ( void   )

Reset ISM43362.

Returns:
true only if ISM43362 resets successfully

Definition at line 113 of file ISM43362.cpp.

int scan ( WiFiAccessPoint *  res,
unsigned  limit 
)

Scan for available networks.

Parameters:
apPointer to allocated array to store discovered AP
limitSize of allocated res array, or 0 to only count available AP
Returns:
Number of entries in res, or if count was 0 number of available networks, negative on error see nsapi_error

Definition at line 426 of file ISM43362.cpp.

bool send ( int  id,
const void *  data,
uint32_t  amount 
)

Sends data to an open socket.

Parameters:
idid of socket to send to
datadata to be sent
amountamount of data to be sent - max 1024
Returns:
true only if data sent successfully

Definition at line 562 of file ISM43362.cpp.

bool writeable ( void   )

Checks if data can be written.

Definition at line 689 of file ISM43362.cpp.