|
HumaBotics WiFiBlock Sensor
#define HRWB_BATTLVL 0x000C |
Register for battery level in 0.1V
Definition at line 48 of file humarobotics-wifiblock.h.
#define HRWB_GET_DATA 0x1048 |
Register for received data
Definition at line 91 of file humarobotics-wifiblock.h.
#define HRWB_GET_IP_ADDR 0x1002 |
Register for IP address to send request to
Definition at line 88 of file humarobotics-wifiblock.h.
#define HRWB_GET_LENGTH 0x1001 |
Register for received data length
Definition at line 87 of file humarobotics-wifiblock.h.
#define HRWB_GET_PORT 0x1006 |
Register for port to send request to
Definition at line 89 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS 0x1000 |
Register for status of GET command - see HRWB_GET_STATUS_* for bit masks
Definition at line 86 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_READY 0x01 |
Bit mask for GET port readiness status
Definition at line 93 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_REQ_DONE 0x08 |
Bit mask for checking whether GET request is done
Definition at line 96 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_REQ_ERROR 0x80 |
Bit mask for checking if an error has occurred
Definition at line 100 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_RESERVED1 0x02 |
RESERVED
Definition at line 94 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_RESERVED2 0x10 |
RESERVED
Definition at line 97 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_RESERVED3 0x20 |
RESERVED
Definition at line 98 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_RESERVED4 0x40 |
RESERVED
Definition at line 99 of file humarobotics-wifiblock.h.
#define HRWB_GET_STATUS_SEND_REQ 0x04 |
Bit mask for sending the GET request
Definition at line 95 of file humarobotics-wifiblock.h.
#define HRWB_GET_URL 0x1008 |
Register for URL (everything after the host name)
Definition at line 90 of file humarobotics-wifiblock.h.
#define HRWB_HTTP_RESULT_CODE 0x001F |
Register for HTTP result code
Definition at line 50 of file humarobotics-wifiblock.h.
#define HRWB_I2C_ADDR 0x20 |
WiFiBlock I2C address
Definition at line 43 of file humarobotics-wifiblock.h.
#define HRWB_MASKED_WRITE 0x02 |
Command for a masked write
Definition at line 45 of file humarobotics-wifiblock.h.
#define HRWB_POST_DATA 0x2048 |
Register for POST data
Definition at line 108 of file humarobotics-wifiblock.h.
#define HRWB_POST_IP_ADDR 0x2002 |
Register for IP address to send request to
Definition at line 105 of file humarobotics-wifiblock.h.
#define HRWB_POST_LENGTH 0x2001 |
Register for POST data length
Definition at line 104 of file humarobotics-wifiblock.h.
#define HRWB_POST_PORT 0x2006 |
Register for port to send request to
Definition at line 106 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS 0x2000 |
Register for status of POST command - see HRWB_POST_STATUS_* for bit masks
Definition at line 103 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_EN_FL_RTX 0x20 |
Bit mask to store POST requests in the DataFlash in case of network loss and then automatically retransmits them when the network is up again
Definition at line 115 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_EN_FL_STO 0x10 |
Bit mask to store POST requests in the dataflash in case of network loss
Definition at line 114 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_READY 0x01 |
Bit mask for POST port readiness status
Definition at line 110 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_REQ_DONE 0x08 |
Bit mask for checking whether POST request is done
Definition at line 113 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_REQ_ERROR 0x80 |
Bit mask for checking if an error has occurred
Definition at line 118 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_RESERVED1 0x02 |
RESERVED
Definition at line 111 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_RESERVED2 0x40 |
RESERVED
Definition at line 117 of file humarobotics-wifiblock.h.
#define HRWB_POST_STATUS_SEND_REQ 0x04 |
Bit mask for sending the POST request
Definition at line 112 of file humarobotics-wifiblock.h.
#define HRWB_POST_URL 0x2008 |
Register for URL (everything after the host name)
Definition at line 107 of file humarobotics-wifiblock.h.
#define HRWB_RESET 0x000E |
Register to reset the WiFiblock
Definition at line 52 of file humarobotics-wifiblock.h.
#define HRWB_RESET_ERRORCODE 0x01 |
Command to reset the error code WiFiblock
Definition at line 54 of file humarobotics-wifiblock.h.
#define HRWB_RESET_WIFIBLOCK 0x00 |
Command to reset the WiFiblock
Definition at line 53 of file humarobotics-wifiblock.h.
#define HRWB_SECURITY_OPEN 0x00 |
HRWB_WIFI_SECURITY_TYPE value for Open Network (no crypto)
Definition at line 80 of file humarobotics-wifiblock.h.
#define HRWB_SECURITY_WEP 0x01 |
HRWB_WIFI_SECURITY_TYPE value for WEP crypto
Definition at line 81 of file humarobotics-wifiblock.h.
#define HRWB_SECURITY_WPA 0x02 |
HRWB_WIFI_SECURITY_TYPE value for WPA
Definition at line 82 of file humarobotics-wifiblock.h.
#define HRWB_SECURITY_WPA2 0x03 |
HRWB_WIFI_SECURITY_TYPE value for WPA2
Definition at line 83 of file humarobotics-wifiblock.h.
#define HRWB_SENSORTYPE 0x0008 |
Register for Sensortype - WIFI
Definition at line 47 of file humarobotics-wifiblock.h.
#define HRWB_SIMPLE_WRITE 0x01 |
Command for a simple write
Definition at line 44 of file humarobotics-wifiblock.h.
#define HRWB_TCP_IP_ADDR 0x4001 |
Register for IP address to send request to
Definition at line 122 of file humarobotics-wifiblock.h.
#define HRWB_TCP_PORT 0x4005 |
Register for port to send request to
Definition at line 123 of file humarobotics-wifiblock.h.
#define HRWB_TCP_RX_DATA 0x4029 |
Register for received data
Definition at line 127 of file humarobotics-wifiblock.h.
#define HRWB_TCP_RX_LENGTH 0x4028 |
Register for received data length
Definition at line 126 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS 0x4000 |
Register for status of TCP command - see HRWB_TCP_STATUS_* for bit masks
Definition at line 121 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_READY 0x01 |
Bit mask for TCP port readiness status
Definition at line 129 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_REQ_DONE 0x04 |
Bit mask for checking whether TCP request is done
Definition at line 131 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_REQ_ERROR 0x80 |
Bit mask for checking if an error has occurred
Definition at line 136 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_RESERVED1 0x08 |
RESERVED
Definition at line 132 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_RESERVED2 0x10 |
RESERVED
Definition at line 133 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_RESERVED3 0x20 |
RESERVED
Definition at line 134 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_RESERVED4 0x40 |
RESERVED
Definition at line 135 of file humarobotics-wifiblock.h.
#define HRWB_TCP_STATUS_SEND_REQ 0x02 |
Bit mask for sending the TCP request
Definition at line 130 of file humarobotics-wifiblock.h.
#define HRWB_TCP_TX_DATA 0x4008 |
Register for tramsmitted data
Definition at line 125 of file humarobotics-wifiblock.h.
#define HRWB_TCP_TX_LENGTH 0x4007 |
Register for tramsmitted data length
Definition at line 124 of file humarobotics-wifiblock.h.
#define HRWB_UDP_DPORT 0x3005 |
Register for port to send request to
Definition at line 141 of file humarobotics-wifiblock.h.
#define HRWB_UDP_IP_ADDR 0x3001 |
Register for IP address to send request to
Definition at line 140 of file humarobotics-wifiblock.h.
#define HRWB_UDP_RX_DATA 0x302B |
Register for received data
Definition at line 146 of file humarobotics-wifiblock.h.
#define HRWB_UDP_RX_LENGTH 0x302A |
Register for received data length
Definition at line 145 of file humarobotics-wifiblock.h.
#define HRWB_UDP_SPORT 0x3007 |
Register for port to send request from
Definition at line 142 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS 0x3000 |
Register for status of UDP command - see HRWB_UDP_STATUS_* for bit masks
Definition at line 139 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_READY 0x01 |
Bit mask for UDP port readiness status
Definition at line 148 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_REQ_DONE 0x04 |
Bit mask for checking whether UDP request is done
Definition at line 150 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_REQ_ERROR 0x80 |
Bit mask for checking if an error has occurred
Definition at line 155 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_RESERVED1 0x20 |
RESERVED
Definition at line 153 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_RESERVED2 0x40 |
RESERVED
Definition at line 154 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_RXD_RDY 0x08 |
Bit mask for checking whether UDP data is ready for reading
Definition at line 151 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_RXD_READ 0x10 |
Bit mask start reading UDP data
Definition at line 152 of file humarobotics-wifiblock.h.
#define HRWB_UDP_STATUS_SEND_REQ 0x02 |
Bit mask for sending the UDP request
Definition at line 149 of file humarobotics-wifiblock.h.
#define HRWB_UDP_TX_DATA 0x300A |
Register for tramsmitted data
Definition at line 144 of file humarobotics-wifiblock.h.
#define HRWB_UDP_TX_LENGTH 0x3009 |
Register for tramsmitted data length
Definition at line 143 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_IP_ADDR 0x0222 |
Register for IPv4 address
Definition at line 60 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_IP_GATEWAY 0x022A |
Register for default gateway
Definition at line 62 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_IP_MASK 0x0226 |
Register for Netmask
Definition at line 61 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SCANRESULT 0x026F |
Register for number of SSIDs found after a scan
Definition at line 65 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SCANSEC 0x0272 |
Register for the security type of the specified SSID
Definition at line 68 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SCANSEL 0x0270 |
Register for selecting the SSID to get more info on
Definition at line 66 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SCANSIGNAL 0x0271 |
Register for the signal strength of the specified SSID
Definition at line 67 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SCANSSID 0x0273 |
Register for specifying the SSID to scan
Definition at line 69 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SECURITY_KEY 0x022F |
Register for WiFi key
Definition at line 64 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SECURITY_TYPE 0x022E |
Register for WiFi security type - see HRWB_SECURITY_* for values
Definition at line 63 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SIGNAL 0x0201 |
Register for signal strength
Definition at line 58 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_SSID 0x0202 |
Register for SSID
Definition at line 59 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS 0x0200 |
Register for WiFi Status - see HRWB_WIFI_STATUS_* for bit masks
Definition at line 57 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_CONN_STAT 0x10 |
Bit mask for selecting status of the current WiFi connection
Definition at line 75 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_DEL_CONF 0x80 |
Bit mask for selecting command to delete current configuration
Definition at line 78 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_ENABLE 0x01 |
Bit mask for selecting WiFi status
Definition at line 71 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_RECONN 0x40 |
Bit mask for selecting whether or not to reconnect when disconnected
Definition at line 77 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_RESERVED 0x20 |
RESERVED
Definition at line 76 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_SAVE_CONF 0x02 |
Bit mask for selecting command to save current configuration
Definition at line 72 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_SCAN_DONE 0x08 |
Bit mask for selecting whether scan is done
Definition at line 74 of file humarobotics-wifiblock.h.
#define HRWB_WIFI_STATUS_START_SCAN 0x04 |
Bit mask for selecting command to start scanning network
Definition at line 73 of file humarobotics-wifiblock.h.
bool _HRWBwriteRegPrivate | ( | tSensors | link, |
int | reg, | ||
tByteArray & | data, | ||
int | size | ||
) |
Write data array to a register
Note: this is an internal function and shouldn't be used directly
link | the port number |
reg | register to write to |
data | value to write to the register |
size | amount of data to send |
Definition at line 330 of file humarobotics-wifiblock.h.
bool HRWBconfigNetwork | ( | tSensors | link, |
tNetworkInfo & | netInfo | ||
) |
Configure the IP and WiFi settings
link | the port number |
netInfo | tNetworkInfo struct containing network connection parameters |
Definition at line 681 of file humarobotics-wifiblock.h.
bool HRWBdisableWifi | ( | tSensors | link ) |
Disable the WiFi
link | the port number |
Definition at line 562 of file humarobotics-wifiblock.h.
bool HRWBdoGET | ( | tSensors | link, |
tGetRequest & | getrequest | ||
) |
Perform a HTTP GET transaction
link | the port number |
getrequest | tGetRequest struct containing transaction parameters |
Definition at line 749 of file humarobotics-wifiblock.h.
bool HRWBdoPOST | ( | tSensors | link, |
tPostRequest & | postrequest | ||
) |
Perform a HTTP POST transaction
link | the port number |
postrequest | tPostRequest struct containing transaction parameters |
Definition at line 825 of file humarobotics-wifiblock.h.
bool HRWBdoTCP | ( | tSensors | link, |
tTCPRequest & | tcprequest | ||
) |
Perform a TCP transaction
link | the port number |
tcprequest | tTCPRequest struct containing transaction parameters |
Definition at line 889 of file humarobotics-wifiblock.h.
bool HRWBdoUDP | ( | tSensors | link, |
tUDPRequest & | udprequest | ||
) |
Perform a UDP transaction
link | the port number |
udprequest | tUDPRequest struct containing transaction parameters |
Definition at line 963 of file humarobotics-wifiblock.h.
bool HRWBenableWifi | ( | tSensors | link ) |
Enable the WiFi
link | the port number |
Definition at line 550 of file humarobotics-wifiblock.h.
bool HRWBeraseConfig | ( | tSensors | link ) |
Erase the current network configuration
Use in combination with HRWBresetWifiBlock() to start with a clean configuration
link | the port number |
Definition at line 588 of file humarobotics-wifiblock.h.
float HRWBreadBatt | ( | tSensors | link ) |
Read the current voltage level
link | the port number |
Definition at line 519 of file humarobotics-wifiblock.h.
bool HRWBreadBigReg | ( | tSensors | link, |
int | reg, | ||
int | size | ||
) |
Read a register. Data read is stored in HRWB_HugeArray
link | the port number |
reg | register to read |
size | amount of data to read |
Definition at line 466 of file humarobotics-wifiblock.h.
int HRWBreadHTTPCode | ( | tSensors | link ) |
Read the HTTP result code of the last HTTP transaction.
link | the port number |
Definition at line 492 of file humarobotics-wifiblock.h.
bool HRWBreadReg | ( | tSensors | link, |
int | reg, | ||
int | size | ||
) |
Read a register. Data read is stored in HRWB_I2CReply
link | the port number |
reg | register to read |
size | amount of data to read |
Definition at line 441 of file humarobotics-wifiblock.h.
bool HRWBreadSensorType | ( | tSensors | link, |
string & | sType | ||
) |
Read the type of sensor. Should be WIFI, unless there's something really freaky going on
link | the port number |
sType | string to hold the sensor type string. |
Definition at line 534 of file humarobotics-wifiblock.h.
bool HRWBresetWifiBlock | ( | tSensors | link ) |
Reset the WiFiBlock.
link | the port number |
Definition at line 507 of file humarobotics-wifiblock.h.
bool HRWBsaveConfig | ( | tSensors | link ) |
Save the current network configuration
link | the port number |
Definition at line 574 of file humarobotics-wifiblock.h.
bool HRWBwriteReg | ( | tSensors | link, |
int | reg, | ||
tByteArray & | data, | ||
int | size | ||
) |
Write a tByteArray struct to a register
link | the port number |
reg | register to write to |
data | tByteArray to write to the register |
size | amount of data to send |
Write a tHugeByteArray struct to a register
link | the port number |
reg | register to write to |
data | tHugeByteArray to write to the register |
size | amount of data to send |
Write a tBigByteArray struct to a register
link | the port number |
reg | register to write to |
data | tBigByteArray to write to the register |
size | amount of data to send |
Definition at line 357 of file humarobotics-wifiblock.h.
bool HRWBwriteReg | ( | tSensors | link, |
int | reg, | ||
ubyte | data | ||
) |
Write a single byte to a register
link | the port number |
reg | register to write to |
data | value to write to the register |
Definition at line 304 of file humarobotics-wifiblock.h.
bool HRWBwriteRegMasked | ( | tSensors | link, |
int | reg, | ||
ubyte | data, | ||
ubyte | mask | ||
) |
Perform a masked write, which allows you to select a single bit in a register.
link | the port number |
reg | register to write to |
data | value to write to the register |
mask | to use when writing to the register |
Definition at line 280 of file humarobotics-wifiblock.h.
void stringToIp | ( | const string | address, |
tIPaddr & | addr | ||
) |
Convert a string to a tIPaddr struct. This is an IPv4 address.
address | string representation of the IPv4 address |
addr | tIPaddr struct to hold the IPv4 address |
Definition at line 253 of file humarobotics-wifiblock.h.
int strsize | ( | tHugeByteArray & | array ) |
Calculate the size of a string in an array. Counts up to the NULL.
array | the array to check the length of |
Definition at line 236 of file humarobotics-wifiblock.h.
Array to hold scratch data, only more of it
Definition at line 160 of file humarobotics-wifiblock.h.
Array to hold I2C reply data
Definition at line 158 of file humarobotics-wifiblock.h.
Array to hold I2C command data
Definition at line 157 of file humarobotics-wifiblock.h.
Array to hold scratch data
Definition at line 159 of file humarobotics-wifiblock.h.