Classes | Defines | Typedefs | Functions
wge100lib.h File Reference
#include <stdint.h>
#include "list.h"
#include "ipcam_packet.h"
Include dependency graph for wge100lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wge100FrameInfo

Defines

#define CONFIG_PRODUCT_ID   6805018
#define ERR_CONFIG_ARPFAIL   200
#define ERR_TIMEOUT   100
#define TRIG_STATE_ALTERNATE   4
#define TRIG_STATE_EXTERNAL   1
#define TRIG_STATE_INTERNAL   0
#define TRIG_STATE_RISING   2
#define WGE100LIB_VERSION   ((WGE100LIB_VERSION_MAJOR <<8) | WGE100LIB_VERSION_MINOR )
#define WGE100LIB_VERSION_MAJOR   0x01
#define WGE100LIB_VERSION_MINOR   0x05

Typedefs

typedef int(* FrameHandler )(wge100FrameInfo *frame_info, void *userData)
 A FrameHandler function returns zero to continue to receive data, non-zero otherwise.

Functions

int wge100Configure (IpCamList *camInfo, const char *ipAddress, unsigned wait_us)
int wge100ConfigureBoard (const IpCamList *camInfo, uint32_t serial, MACAddress *mac)
int wge100Discover (const char *ifName, IpCamList *ipCamList, const char *ipAddress, unsigned wait_us)
int wge100FindByUrl (const char *url, IpCamList *camera, unsigned wait_us, const char **errmsg)
int wge100FlashRead (const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut)
int wge100FlashWrite (const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn)
int wge100GetTimer (const IpCamList *camInfo, uint64_t *time_us)
int wge100ImagerModeSelect (const IpCamList *camInfo, uint32_t mode)
int wge100ImagerSetRes (const IpCamList *camInfo, uint16_t horizontal, uint16_t vertical)
int wge100LibVersion (void)
int wge100ReconfigureFPGA (IpCamList *camInfo)
int wge100ReliableFlashRead (const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut, int *retries)
int wge100ReliableFlashWrite (const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn, int *retries)
int wge100ReliableSensorRead (const IpCamList *camInfo, uint8_t reg, uint16_t *data, int *retries)
int wge100ReliableSensorWrite (const IpCamList *camInfo, uint8_t reg, uint16_t data, int *retries)
int wge100Reset (IpCamList *camInfo)
int wge100SensorRead (const IpCamList *camInfo, uint8_t reg, uint16_t *data)
int wge100SensorSelect (const IpCamList *camInfo, uint8_t index, uint32_t reg)
int wge100SensorWrite (const IpCamList *camInfo, uint8_t reg, uint16_t data)
int wge100StartVid (const IpCamList *camInfo, const uint8_t mac[6], const char *ipAddress, uint16_t port)
int wge100StopVid (const IpCamList *camInfo)
int wge100TriggerControl (const IpCamList *camInfo, uint32_t triggerType)
int wge100VidReceive (const char *ifName, uint16_t port, size_t height, size_t width, FrameHandler frameHandler, void *userData)
int wge100VidReceiveAuto (IpCamList *camera, size_t height, size_t width, FrameHandler frameHandler, void *userData)

Define Documentation

#define CONFIG_PRODUCT_ID   6805018

Definition at line 114 of file wge100lib.h.

#define ERR_CONFIG_ARPFAIL   200

Definition at line 116 of file wge100lib.h.

#define ERR_TIMEOUT   100

Definition at line 115 of file wge100lib.h.

#define TRIG_STATE_ALTERNATE   4

Definition at line 60 of file wge100lib.h.

#define TRIG_STATE_EXTERNAL   1

Definition at line 59 of file wge100lib.h.

#define TRIG_STATE_INTERNAL   0

Definition at line 58 of file wge100lib.h.

#define TRIG_STATE_RISING   2

Definition at line 61 of file wge100lib.h.

Definition at line 51 of file wge100lib.h.

#define WGE100LIB_VERSION_MAJOR   0x01

Definition at line 49 of file wge100lib.h.

#define WGE100LIB_VERSION_MINOR   0x05

Definition at line 50 of file wge100lib.h.


Typedef Documentation

typedef int(* FrameHandler)(wge100FrameInfo *frame_info, void *userData)

A FrameHandler function returns zero to continue to receive data, non-zero otherwise.

Definition at line 110 of file wge100lib.h.


Function Documentation

int wge100Configure ( IpCamList camInfo,
const char *  ipAddress,
unsigned  wait_us 
)

Configures the IP address of one specific camera.

Parameters:
camInfoStructure describing the camera to configure
ipAddressAn ASCII string containing the new IP address to assign (e.g., "192.168.0.5"). If it is NULL or empty, the address in camInfo is used, and the configure packet is not broadcast.
wait_usThe number of microseconds to wait for a reply from the camera
Returns:
Returns -1 with errno set for system call failures. Returns 0 for success Returns ERR_TIMEOUT if no reply is received before the timeout expires

Definition at line 532 of file wge100lib.c.

int wge100ConfigureBoard ( const IpCamList camInfo,
uint32_t  serial,
MACAddress mac 
)

Sets the permanent serial number and MAC configuration for one camera

Warning:
: This command can only be sent once per camera. The changes are permanent.
Parameters:
camInfoDescribes the camera to connect to
serialIs the 32-bit unique serial number to assign (the product ID portion is already fixed)
macIs the 48-bit unique MAC address to assign to the board
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1194 of file wge100lib.c.

int wge100Discover ( const char *  ifName,
IpCamList ipCamList,
const char *  ipAddress,
unsigned  wait_us 
)

Discovers all WGE100 cameras that are connected to the 'ifName' ethernet interface and adds new ones to the 'ipCamList' list.

Parameters:
ifNameThe ethernet interface name to use. Null terminated string (e.g., "eth0"). Empty means to query all interfaces.
ipCamListThe list to which the new cameras should be added
wait_usThe number of microseconds to wait for replies
Returns:
Returns -1 with errno set for system call errors. Otherwise returns number of new cameras found.

Definition at line 372 of file wge100lib.c.

int wge100FindByUrl ( const char *  url,
IpCamList camera,
unsigned  wait_us,
const char **  errmsg 
)

Finds a camera matching the given name

Names are of the form:

name://camera_name[@camera_ip][#local_interface]
serial://serial_number[@camera_ip][#local_interface]
any://[@camera_ip][#local_interface] 

A name URL indicates the name of the camera to be found. A serial URL indicates the serial number of the camera to be found. An any URL will match any camera, but if more than one camera is found, it will fail.

Optionally, the ip address that the camera should be set to can be specified by prefixing it with a @ sign, and the interface through which to access the camera can be specified by prefixing it with a # sign.

When an ip address is specified, it will be copied into the camera struct.

Parameters:
urlThe url of the camera to find
cameraThe structure to fill the camera information into
wait_usThe number of microseconds to wait before timing out
errmsgString containing a descriptive parse error message
Returns:
Returns 0 if a camera was found, -1 and sets errmsg if an error occurred.

Definition at line 94 of file wge100lib.c.

int wge100FlashRead ( const IpCamList camInfo,
uint32_t  address,
uint8_t *  pageDataOut 
)

Reads one FLASH_PAGE_SIZE byte page of the camera's onboard Atmel dataflash.

Parameters:
camInfoDescribes the camera to connect to.
addressSpecifies the 12-bit flash page address to read (0-4095)
pageDataOutPoints to at least FLASH_PAGE_SIZE bytes of storage in which to place the flash data.
retriesIndicates the maximum allowed number of retries.
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 940 of file wge100lib.c.

int wge100FlashWrite ( const IpCamList camInfo,
uint32_t  address,
const uint8_t *  pageDataIn 
)

Writes one FLASH_PAGE_SIZE byte page to the camera's onboard Atmel dataflash.

Parameters:
camInfoDescribes the camera to connect to.
addressSpecifies the 12-bit flash page address to write (0-4095)
pageDataOutPoints to at least FLASH_PAGE_SIZE bytes of storage from which to get the flash data.
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1077 of file wge100lib.c.

int wge100GetTimer ( const IpCamList camInfo,
uint64_t *  time_us 
)

Gets the system time of a specified camera.

In the camera, system time is tracked as a number of clock 'ticks' since the last hard reset. This function receives the number of 'ticks' as well as a 'ticks_per_sec' conversion factor to return a 64-bit time result in microseconds.

Parameters:
camInfoDescribes the camera to connect to
time_usPoints to the location to store the system time in us
Returns:
Returns 0 for success, -1 for system error, or 1 for protocol error.

Definition at line 832 of file wge100lib.c.

int wge100ImagerModeSelect ( const IpCamList camInfo,
uint32_t  mode 
)

Selects one of the 10 pre-programmed imager modes in the specified camera.

Parameters:
camInfoDescribes the camera to connect to
modeThe mode number to select, range (0..9)
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1491 of file wge100lib.c.

int wge100ImagerSetRes ( const IpCamList camInfo,
uint16_t  horizontal,
uint16_t  vertical 
)

Provides for manually setting non-standard imager modes. Use only with extreme caution.

Warning:
The imager frame size set by I2C must match the one used by the firmware, or system failure could result.
Parameters:
camInfoDescribes the camera to connect to
horizontalThe number of 8-bit image pixels per line of video. Maximum value 752.
verticalThe number of video lines per frame.
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1548 of file wge100lib.c.

int wge100LibVersion ( void  )
int wge100ReconfigureFPGA ( IpCamList camInfo)

Instructs one camera to reconfigure its FPGA.

Parameters:
camInfoDescribes the camera that should reconfigure its FPGA.
Returns:
Returns 0 for success Returns -1 for system errors

Definition at line 750 of file wge100lib.c.

int wge100ReliableFlashRead ( const IpCamList camInfo,
uint32_t  address,
uint8_t *  pageDataOut,
int *  retries 
)

Reads one FLASH_PAGE_SIZE byte page of the camera's onboard Atmel dataflash. Does repeated attempts if an error occurs.

Parameters:
camInfoDescribes the camera to connect to.
addressSpecifies the 12-bit flash page address to read (0-4095)
pageDataOutPoints to at least FLASH_PAGE_SIZE bytes of storage in which to place the flash data.
retriesMaximum number of retries. Decremented for each retry. NULL does 10 retries.
Returns:
Returns 0 for success Returns -2 for out of retries Returns -1 for system error Returns 1 for protocol error

Definition at line 906 of file wge100lib.c.

int wge100ReliableFlashWrite ( const IpCamList camInfo,
uint32_t  address,
const uint8_t *  pageDataIn,
int *  retries 
)

Writes one FLASH_PAGE_SIZE byte page to the camera's onboard Atmel dataflash. Repeats the write until the written value matches, and reads back the written page to check that it has been correctly written.

Parameters:
camInfoDescribes the camera to connect to.
addressSpecifies the 12-bit flash page address to write (0-4095)
pageDataOutPoints to at least FLASH_PAGE_SIZE bytes of storage from which to get the flash data.
retriesMaximum number of retries. Decremented for each retry. NULL does 10 retries.
Returns:
Returns 0 for success Returns -2 for out of retries Returns -1 for system error Returns 1 for protocol error

Definition at line 1014 of file wge100lib.c.

int wge100ReliableSensorRead ( const IpCamList camInfo,
uint8_t  reg,
uint16_t *  data,
int *  retries 
)

Reads the value of one image sensor I2C register on one camera. Retries if there are any errors.

Parameters:
camInfoDescribes the camera to connect to
regThe 8-bit register address to read from data Pointer to 16 bits of storage to write the value to
retriesMaximum number of retries. Decremented for each retry. NULL does 10 retries.
Returns:
Returns 0 for success Returns -2 for out of retries Returns -1 for system error Returns 1 for protocol error

Definition at line 1349 of file wge100lib.c.

int wge100ReliableSensorWrite ( const IpCamList camInfo,
uint8_t  reg,
uint16_t  data,
int *  retries 
)

Writes to one image sensor I2C register on one camera. Repeats reads and reads back written value until it gets a match.

Parameters:
camInfoDescribes the camera to connect to
regThe 8-bit register address to write into data 16-bit value to write into the register
retriesMaximum number of retries. Decremented for each retry. NULL does 10 retries.
Returns:
Returns 0 for success Returns -2 for out of retries Returns -1 for system error Returns 1 for protocol error

Definition at line 1252 of file wge100lib.c.

int wge100Reset ( IpCamList camInfo)

Instructs one camera to execute a soft reset.

Parameters:
camInfoDescribes the camera to reset.
Returns:
Returns 0 for success Returns -1 for system errors

Definition at line 788 of file wge100lib.c.

int wge100SensorRead ( const IpCamList camInfo,
uint8_t  reg,
uint16_t *  data 
)

Reads the value of one image sensor I2C register on one camera.

Parameters:
camInfoDescribes the camera to connect to
regThe 8-bit register address to read from data Pointer to 16 bits of storage to write the value to
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1378 of file wge100lib.c.

int wge100SensorSelect ( const IpCamList camInfo,
uint8_t  index,
uint32_t  reg 
)

Sets the address of one of the four automatically read I2C registers on one camera.

Parameters:
camInfoDescribes the camera to connect to
indexThe index (0..3) of the register to set
regThe 8-bit address of the register to read at position 'index', or I2C_AUTO_REG_UNUSED.
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1438 of file wge100lib.c.

int wge100SensorWrite ( const IpCamList camInfo,
uint8_t  reg,
uint16_t  data 
)

Writes to one image sensor I2C register on one camera.

Parameters:
camInfoDescribes the camera to connect to
regThe 8-bit register address to write into data 16-bit value to write into the register
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1291 of file wge100lib.c.

int wge100StartVid ( const IpCamList camInfo,
const uint8_t  mac[6],
const char *  ipAddress,
uint16_t  port 
)

Instructs one camera to begin streaming video to the host/port specified.

Parameters:
camInfoStructure that describes the camera to contact
macContains the MAC address of the host that will receive the video
ipAddressAn ASCII string in dotted quad form containing the IP address of the host that will receive the video (e.g., "192.168.0.5")
portThe port number that the video should be sent to. Host byte order.
Returns:
Returns -1 with errno set for system call failures Returns 0 for success Returns 1 for protocol failures (timeout, etc)

Definition at line 638 of file wge100lib.c.

int wge100StopVid ( const IpCamList camInfo)

Instructs one camera to stop sending video.

Parameters:
camInfoDescribes the camera to send the stop to.
Returns:
Returns 0 for success Returns -1 with errno set for system errors Returns 1 for protocol errors

Definition at line 700 of file wge100lib.c.

int wge100TriggerControl ( const IpCamList camInfo,
uint32_t  triggerType 
)

Sets the trigger type (internal or external) for one camera.

Parameters:
camInfoDescribes the camera to connect to
triggerTypeCan be either TRIG_STATE_INTERNAL or TRIG_STATE_EXTERNAL
Returns:
Returns 0 for success Returns -1 for system error Returns 1 for protocol error

Definition at line 1135 of file wge100lib.c.

int wge100VidReceive ( const char *  ifName,
uint16_t  port,
size_t  height,
size_t  width,
FrameHandler  frameHandler,
void *  userData 
)

Definition at line 1889 of file wge100lib.c.

int wge100VidReceiveAuto ( IpCamList camera,
size_t  height,
size_t  width,
FrameHandler  frameHandler,
void *  userData 
)

Definition at line 1908 of file wge100lib.c.



wge100_camera
Author(s): Blaise Gassend, Patrick Mihelich, Eric MacIntosh, David Palchak
autogenerated on Fri Jan 3 2014 12:16:01