Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Data Structures | Defines | Functions | Variables

humarobotics-wifiblock.h File Reference

HumaRobotics WiFiBlock driver. More...

#include "common.h"

Go to the source code of this file.

Data Structures

struct  tNetworkInfo
struct  tGetRequest
struct  tPostRequest
struct  tTCPRequest
struct  tUDPRequest

Defines

#define HRWB_I2C_ADDR   0x20
#define HRWB_SIMPLE_WRITE   0x01
#define HRWB_MASKED_WRITE   0x02
#define HRWB_SENSORTYPE   0x0008
#define HRWB_BATTLVL   0x000C
#define HRWB_HTTP_RESULT_CODE   0x001F
#define HRWB_RESET   0x000E
#define HRWB_RESET_WIFIBLOCK   0x00
#define HRWB_RESET_ERRORCODE   0x01
#define HRWB_WIFI_STATUS   0x0200
#define HRWB_WIFI_SIGNAL   0x0201
#define HRWB_WIFI_SSID   0x0202
#define HRWB_WIFI_IP_ADDR   0x0222
#define HRWB_WIFI_IP_MASK   0x0226
#define HRWB_WIFI_IP_GATEWAY   0x022A
#define HRWB_WIFI_SECURITY_TYPE   0x022E
#define HRWB_WIFI_SECURITY_KEY   0x022F
#define HRWB_WIFI_SCANRESULT   0x026F
#define HRWB_WIFI_SCANSEL   0x0270
#define HRWB_WIFI_SCANSIGNAL   0x0271
#define HRWB_WIFI_SCANSEC   0x0272
#define HRWB_WIFI_SCANSSID   0x0273
#define HRWB_WIFI_STATUS_ENABLE   0x01
#define HRWB_WIFI_STATUS_SAVE_CONF   0x02
#define HRWB_WIFI_STATUS_START_SCAN   0x04
#define HRWB_WIFI_STATUS_SCAN_DONE   0x08
#define HRWB_WIFI_STATUS_CONN_STAT   0x10
#define HRWB_WIFI_STATUS_RESERVED   0x20
#define HRWB_WIFI_STATUS_RECONN   0x40
#define HRWB_WIFI_STATUS_DEL_CONF   0x80
#define HRWB_SECURITY_OPEN   0x00
#define HRWB_SECURITY_WEP   0x01
#define HRWB_SECURITY_WPA   0x02
#define HRWB_SECURITY_WPA2   0x03
#define HRWB_GET_STATUS   0x1000
#define HRWB_GET_LENGTH   0x1001
#define HRWB_GET_IP_ADDR   0x1002
#define HRWB_GET_PORT   0x1006
#define HRWB_GET_URL   0x1008
#define HRWB_GET_DATA   0x1048
#define HRWB_GET_STATUS_READY   0x01
#define HRWB_GET_STATUS_RESERVED1   0x02
#define HRWB_GET_STATUS_SEND_REQ   0x04
#define HRWB_GET_STATUS_REQ_DONE   0x08
#define HRWB_GET_STATUS_RESERVED2   0x10
#define HRWB_GET_STATUS_RESERVED3   0x20
#define HRWB_GET_STATUS_RESERVED4   0x40
#define HRWB_GET_STATUS_REQ_ERROR   0x80
#define HRWB_POST_STATUS   0x2000
#define HRWB_POST_LENGTH   0x2001
#define HRWB_POST_IP_ADDR   0x2002
#define HRWB_POST_PORT   0x2006
#define HRWB_POST_URL   0x2008
#define HRWB_POST_DATA   0x2048
#define HRWB_POST_STATUS_READY   0x01
#define HRWB_POST_STATUS_RESERVED1   0x02
#define HRWB_POST_STATUS_SEND_REQ   0x04
#define HRWB_POST_STATUS_REQ_DONE   0x08
#define HRWB_POST_STATUS_EN_FL_STO   0x10
#define HRWB_POST_STATUS_EN_FL_RTX   0x20
#define HRWB_POST_STATUS_RESERVED2   0x40
#define HRWB_POST_STATUS_REQ_ERROR   0x80
#define HRWB_TCP_STATUS   0x4000
#define HRWB_TCP_IP_ADDR   0x4001
#define HRWB_TCP_PORT   0x4005
#define HRWB_TCP_TX_LENGTH   0x4007
#define HRWB_TCP_TX_DATA   0x4008
#define HRWB_TCP_RX_LENGTH   0x4028
#define HRWB_TCP_RX_DATA   0x4029
#define HRWB_TCP_STATUS_READY   0x01
#define HRWB_TCP_STATUS_SEND_REQ   0x02
#define HRWB_TCP_STATUS_REQ_DONE   0x04
#define HRWB_TCP_STATUS_RESERVED1   0x08
#define HRWB_TCP_STATUS_RESERVED2   0x10
#define HRWB_TCP_STATUS_RESERVED3   0x20
#define HRWB_TCP_STATUS_RESERVED4   0x40
#define HRWB_TCP_STATUS_REQ_ERROR   0x80
#define HRWB_UDP_STATUS   0x3000
#define HRWB_UDP_IP_ADDR   0x3001
#define HRWB_UDP_DPORT   0x3005
#define HRWB_UDP_SPORT   0x3007
#define HRWB_UDP_TX_LENGTH   0x3009
#define HRWB_UDP_TX_DATA   0x300A
#define HRWB_UDP_RX_LENGTH   0x302A
#define HRWB_UDP_RX_DATA   0x302B
#define HRWB_UDP_STATUS_READY   0x01
#define HRWB_UDP_STATUS_SEND_REQ   0x02
#define HRWB_UDP_STATUS_REQ_DONE   0x04
#define HRWB_UDP_STATUS_RXD_RDY   0x08
#define HRWB_UDP_STATUS_RXD_READ   0x10
#define HRWB_UDP_STATUS_RESERVED1   0x20
#define HRWB_UDP_STATUS_RESERVED2   0x40
#define HRWB_UDP_STATUS_REQ_ERROR   0x80

Functions

int strsize (tHugeByteArray &array)
void stringToIp (const string address, tIPaddr &addr)
bool HRWBwriteRegMasked (tSensors link, int reg, ubyte data, ubyte mask)
bool HRWBwriteReg (tSensors link, int reg, ubyte data)
bool _HRWBwriteRegPrivate (tSensors link, int reg, tByteArray &data, int size)
bool HRWBwriteReg (tSensors link, int reg, tByteArray &data, int size)
bool HRWBreadReg (tSensors link, int reg, int size)
bool HRWBreadBigReg (tSensors link, int reg, int size)
int HRWBreadHTTPCode (tSensors link)
bool HRWBresetWifiBlock (tSensors link)
float HRWBreadBatt (tSensors link)
bool HRWBreadSensorType (tSensors link, string &sType)
bool HRWBenableWifi (tSensors link)
bool HRWBdisableWifi (tSensors link)
bool HRWBsaveConfig (tSensors link)
bool HRWBeraseConfig (tSensors link)
bool HRWBconfigNetwork (tSensors link, tNetworkInfo &netInfo)
bool HRWBdoGET (tSensors link, tGetRequest &getrequest)
bool HRWBdoPOST (tSensors link, tPostRequest &postrequest)
bool HRWBdoTCP (tSensors link, tTCPRequest &tcprequest)
bool HRWBdoUDP (tSensors link, tUDPRequest &udprequest)

Variables

tByteArray HRWB_I2CRequest
tByteArray HRWB_I2CReply
tByteArray HRWB_scratch
tHugeByteArray HRWB_HugeArray

Detailed Description

HumaRobotics WiFiBlock driver.

humarobotics-wifiblock.h provides an API for the HumaRobotics WiFiBlock Sensor. This program demonstrates how to use that API.

Changelog:

Credits:

License: You may use this code as you wish, provided you give credit where its due.

THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.

Author:
Xander Soldaat (xander_at_botbench.com)
Date:
02 April 2012
Version:
0.1

Definition in file humarobotics-wifiblock.h.