Public Attributes | List of all members
PACKED_ATTRIBUTE Struct Reference

#include <ipcam_packet.h>

Public Attributes

uint32_t address
 Dataflash page address. More...
 
uint8_t address
 8-bit I2C Sensor Address (data returned will be 16-bit) More...
 
IPAddress cam_addr
 Camera address at power-on. More...
 
char cam_name [CAMERA_NAME_LEN]
 Should be zero terminated. Will be forcibly zero terminated otherwise. More...
 
IPAddress camera_ip
 The default power-up IP address for the camera. More...
 
char camera_name [40]
 The name assigned to this particular camera. Null terminated string. More...
 
uint16_t checksum
 Makes the sum of the page 0xFFFF. More...
 
uint8_t data [FLASH_PAGE_SIZE]
 32-bit address as specified in the PacketFlashPayload definition More...
 
uint16_t data
 Data payload. More...
 
uint32_t frame_number
 Frame number as reported by Imager peripheral. More...
 
uint32_t fw_version
 
PacketGeneric hdr
 Generic Command Packet Headers. More...
 
HeaderVideoLine header
 Standard video line header. More...
 
uint16_t horiz_resolution
 Number of 8-bit pixels per video line. More...
 
uint16_t horizontal
 Number of 8-bit video pixels per image row. More...
 
char hrt [16]
 A human-readable text field describing the packet contents. More...
 
uint32_t hw_version
 
uint16_t i2c [I2C_REGS_PER_FRAME]
 Storage for I2C values read during the frame. More...
 
uint32_t i2c_valid
 Flags that indicate which 'i2c' values were updated during the previous frame. More...
 
uint8_t index
 The index of the register in the EOF packet (range 0..3) More...
 
IPAddress ip_addr
 IP Address device should use when responding. More...
 
uint32_t ip_addr
 Configuration Section. More...
 
uint16_t line_number
 Frame/line number as reported by Imager peripheral. More...
 
MACAddress mac
 Camera Identification Section. More...
 
uint32_t magic_no
 The Willow Garage Magic number (always WG_MAGIC_NO) More...
 
uint32_t mode
 The mode number to select (range 0..9) More...
 
struct in_addr prev_host
 
uint32_t product_id
 Camera Identification Section. More...
 
char product_name [40]
 The fixed product name assigned to the WGE100 camera by Willow Garage. Null terminated string. More...
 
NetHost receiver
 Receiver Designation. More...
 
NetHost reply_to
 All packet replies should be directed to this host. More...
 
uint32_t ser_no
 Indicates the specific serial number of this unit from the flash. More...
 
uint32_t serial
 
uint32_t status_code
 Response code (Error type, etc) More...
 
uint32_t status_type
 Type of status report (OK, Error, etc) More...
 
uint32_t ticks_hi
 32 MSBs of system time base More...
 
uint32_t ticks_lo
 32 LSBs of system time base More...
 
uint32_t ticks_per_sec
 Number of time base ticks that occur per second. More...
 
uint32_t trig_state
 Trigger state configuration. More...
 
uint32_t type
 The packet type (see list of packet types, above) More...
 
uint16_t vert_resolution
 Number of video line packets per frame (not including EOF packet) More...
 
uint16_t vertical
 Number of video lines per frame. More...
 

Detailed Description

Structure of the last page of flash containing configuration information. The name is zero terminated. The 16-bit sum of the whole page should be 0xFFFF.

A PacketGeneric contains only the basic elements that are included in all camera command packets. In conjunction with GenericFrame it is used for pre-validating packets. Functions that generate packets with no data other than the 'type' field may also use a PacketGeneric.

A PacketDiscover is sent from the host in order to detect cameras on the network segment and receive information about them. It can be directed to the broadcast address (MAC ff:ff:ff:ff:ff:ff) to detect all cameras or to the unicast address of one camera to detect only that specific camera.

The PacketDiscover is valid in all camera modes. It consists of a PacketGeneric with the type field set to PKTT_DISCOVER and an IP Address. When received, the camera will reply with a PacketAnnounce using the specified IP Address

See also
PacketAnnounce

A PacketConfigure is generated by the host to configure the session IP address of a specific camera. After a reset, all camera will boot with the same default IP address; to prevent address conflicts, all cameras must be Configured before any further actions are taken.

Valid States: The PacketConfigure is valid in the Unconfigured and Configured states. It may not be sent while the camera is streaming video.

Addressing: This packet should normally be directed to the broadcast address to ensure that the desired camera receives it regardless of the state of the host system's ARP cache. If the product_id and ser_no fields do not match those stored in the camera, then the camera will drop it.

Response: Once a camera has received a PacketConfigure and set its IP address, it will generate an PacketAnnounce from the new address so that the remote host can verify it was correctly set.

Todo:
Review specified behavior when a camera is reconfigured

A PacketVidStart is generated by the host to instruct a camera to begin streaming video in the currently configured video mode. The 'receiver' field instructs the camera where to send the video.

Valid States: The PacketVidStart is only valid in the Configured state. Unconfigured cameras and cameras currently streaming will not respond to this packet.

Addressing: This packet may only be addressed to the unicast address of a single camera.

Response: Before starting the video stream, the camera will reply to the originator of the PacketVidStart with a Status packet indicating success.

A PacketVidStop is generated by the host to terminate video streaming from a camera. After the camera receives the PacketVidStop it will wait for the current frame to complete, then end transmission and revert to Configured mode. The PacketVidStop is a PacketGeneric with the type field set to PKTT_VIDSTOP.

Valid States: A PacketVidStop is only valid in the Video state.

Addressing: This packet may only be sent to the unicast address of a single camera.

Response: After the current frame has completed, the camera will reply to the originator of the PacketVidStop with a Status packet indicating success.

A PacketReset is generated by the host to immediately return the camera to its power-up default state. All operations are terminated and all temporary state is reset. The PacketReset is a PacketGeneric with the type field set to PKTT_RESET.

Valid States: The PacketReset is valid in all operating modes

Addressing: This packet may be sent either to a unicast address of a single camera, or to all cameras on an Ethernet segment via the broadcast address.

Response: The camera resets immediately after receipt of this packet. There is no response generated, but the reset can be confirmed by subsequently sending a PacketDiscover.

A TimeRequest packet is generated by the host to request a reading of the camera's system time base. The TimeRequest packet is a PacketGeneric with the type field set to PKTT_TIMEREQ.

Valid States: The TimeRequest packet is valid in both the Configured and Video states. Higher latency will be present during the Video state due to increased processor and network load.

Addressing: This packet may only be sent to the unicast address of a single camera.

Response: The camera will read the system time base and respond to the originator of the TimeRequest with a PacketTimer.

See also
PacketTimer

A PacketFlashRequest is sent by the host to request the contents of one Atmel dataflash page. Each page consists of 264 bytes and is requested by an address in the following format:

The address field Holds the 32 bit starting address:

If the start offset is non-zero, then the data will wrap back from the end of the page to the beginning. Normally, this is undesirable, so a start offset of zero should be used.

The AT45DB161D Atmel Dataflash used in this product has 4096 user-accessible flash pages of 264 bytes each.

Valid States: The PacketFlashRequest is only valid in the Configured state due to the processing time required.

Addressing: This packet may only be sent to the unicast address of a single camera.

Response: The camera will read the requested flash page and reply to the originator of the PacketFlashRequest with a PacketFlashPayload containing the data.

See also
PacketFlashPayload

A PacketFlashPayload may be generated by either the host or the camera. When generated by the camera, it is in response to a PacketFlashRequest and contains the flash data requested by that packet. In this case it will have type PKTT_FLASHDATA.

When generated by the host, it is sent to erase & write a page (264 bytes) worth of data into the Atmel dataflash. In this case it will have packet type PKTT_FLASHWRITE.

Valid States: A PKTT_FLASHWRITE is only valid in the Configured state due to the processing time required.

Addressing: A PKTT_FLASHWRITE packet may only be sent to the unicast address of a single camera.

Response: After the flash erase/write cycle has completed, the camera will respond to the originator of the PKTT_FLASHWRITE packet with a PacketStatus indicating success. The host should not send further packets until receiving the PacketStatus.

A PacketTrigControl will be generated by the host in order to set the type of trigger to use for a subsequent video stream. The change will not affect a stream in process; it is only activated at the reception of the next PacketVidStart.

Currently valid trigger types are Internal (0) and External (1).

Valid States: PacketTrigControl is valid in both Configured and Video states, but a change of trigger state will not take immediate effect when the camera is already in the Video state.

Addressing: A PKTT_FLASHWRITE packet may only be sent to the unicast address of a single camera.

Response: After the trigger type has been changed, the camera will respond to the originator of the PacketTrigControl with a Status packet indicating success.

A PacketSensorRequest is generated by the host to request the 16-bit value of a specific image sensor I2C register.

Valid States: PacketTrigControl is valid in both Configured and Video states. However, the Host should pace its requests during Video mode to avoid exceeding the available processor time and network bandwidth.

Addressing: A PacketSensorRequest packet may only be sent to the unicast address of a single camera.

Response: Once the camera has read the requested value, it will return a PacketSensorData packet to the host. This packet will contain the 16-bit data.

See also
PacketSensorData

A PacketSensorData may be generated by either the host or the camera. When generated by the camera it will have a type of PKTT_SENSORDATA and will contain the 16-bit data 'data' read from 8-bit image sensor I2C address 'address'.

When generated by the host, the type PKTT_SENSORWR will be assigned. A PKTT_SENSORWR packet is used to instruct the camera to write a 16-bit value ('data') into a location on the image sensor I2C bus specified by the 8-bit address 'address'.

Valid States: PacketTrigControl is valid in both Configured and Video states. However, the Host should pace its requests during Video mode to avoid exceeding the available processor time and network bandwidth.

Addressing: A PKTT_SENSORWR packet may only be sent to the unicast address of a single camera.

Response: Once the camera has written the requested value, it will return a PacketStatus to the originating host to indicate success.

A PacketSensorSelect is generated by the host to specify the address of one of the I2C registers to be automatically read once per video frame. In this product, a maximum of four registers can be read.

This packet can also be used to disable reading of a particular index position by specifying an address of I2C_AUTO_REG_UNUSED ((uint32_t)-1).

Valid States: PacketSensorSelect is valid in both Configured and Video states. However, in Video mode the value of the automatically read register at 'index' is undefined between the time the PacketSensorSelect is sent and the end of the frame after the PacketStatus response is received.

Addressing: A PacketSensorSelect packet may only be sent to the unicast address of a single camera.

Response: Once the camera has configured the requested value, it will return a PacketStatus to the originating host to indicate success.

A PacketImagerMode packet is generated by the host to request a change in image sensor mode (resolution, framerate and binning) to one in a predefined list. In this product, there are 10 modes (0..9). The default mode after a reset is mode 2 (640x480x30fps). The specifics of these modes are defined elsewhere.

Valid States: The host may only generate a PacketImagerMode packet when the system is in the Configured state. Changing video mode while streaming is not allowed.

Addressing: A PacketSensorSelect packet may only be sent to the unicast address of a single camera.

Response: Once the camera has configured the requested mode, it will return a PacketStatus to the originating host to indicate success.

The PacketImagerSetRes packet is used only when configuring non-standard image modes. It allows the host to manually configure the camera firmware for arbitrary image dimensions. The camera firmware must always be configured to match the dimensions of the frame coming out of the imager; if the camera is incorrectly configured, system failure could result.

In any case, the maximum value of the horizontal parameter is 752 bytes.

Valid States: The host may only send a PacketImagerSetRes packet when the camera is in the Configured state. Changing imager resolution while streaming is not allowed.

Addressing: A PacketImagerSetRes packet may only be sent to the unicast address of a single camera.

Response: Once the camera has configured the requested resolution, it will return a PacketStatus to the originating host to indicate success.

A PacketSysConfig is a one-time use packet generated by a host after a unit's initial programming. It specifies the permanent unique MAC address and serial number for a camera.

Valid States: The host may only send a PacketSysConfig packet when the camera is in the Configured state.

Addressing: A PacketImagerSetRes packet may only be sent to the unicast address of a single camera.

Warning
: Only ONE unprogrammed camera may be on the connected Ethernet segment when this command is sent
: Once the MAC and serial number have been set, the setting is permanent within the Atmel Dataflash chip.

Response: Once the camera has programmed the MAC and serial, it will return a PacketStatus to the originating host to indicate success. Once the PacketStatus has been received, a PacketReset should be sent for the changes to take effect.

A PacketReconfigureFPGA is generated by the host to immediately cause the camera to reconfigure the FPGA. All operations are terminated and all temporary state is reset. The PacketReconfigureCamera is a PacketGeneric with the type field set to PKTT_RECONFIG_FPGA.

Valid States: The PacketReset is valid in all operating modes

Addressing: This packet may be sent either to a unicast address of a single camera, or to all cameras on an Ethernet segment via the broadcast address.

Response: The camera reconfigures immediately about a second after receipt of this packet. There is no response generated, but the reconfiguration can be confirmed by subsequently sending a PacketDiscover.

A PacketStatus is generated by the camera in reply to a command from the host that does not require a detailed response. Normally it will indicate only success or failure. If failure, the type of failure is indicated by the status_code field.

A PacketTimer is generated by the camera in reply to a TimeRequest from the host. It contains the value of the 64-bit system time base, split between the ticks_hi and ticks_lo fields. The system time base is incremented once per clock cycle and is only reset after a hard reset of the camera board.

The system time base will roll over to zero after approximately 10,000 years of uptime.

An additional field 'ticks_per_sec' is supplied to convert time base clock ticks into seconds. To obtain microseconds from a PacketTimer, first combine ticks_hi and ticks_lo into a single 64-bit value, then divide by (ticks_per_sec/1000000). (Depending on host architecture, different numerical methods may be used to maintain precision)

The PacketAnnounce is generated by the camera in response to a PacketDiscover or PacketConfigure. It provides complete information about the camera and the versions of its subcomponents.

This frame header is added to the beginning of every video line packet.

This packet is a normal line of video.

The data field is sized to accomodate the widest frame possible.

Per Willow Garage request, the PacketEOF is a special case of the PacketVideoLine, with the line number field set to IMAGER_LINENO_NOERR (per client request).

This packet is sent at the end of every normal video frame. It is also generated when an Imager failure (pipeline error or overflow) is detected.

Per Willow Garage request, the PacketEOF is a special case of the HeaderVideoLine, with the line number field set to 0xFFFF (IMAGER_LINENO_EOF).

Definition at line 143 of file ipcam_packet.h.

Member Data Documentation

uint32_t PACKED_ATTRIBUTE::address

Dataflash page address.

8-bit I2C Sensor Address

The address of the register to read (range 0..255), or I2C_AUTO_REG_UNUSED.

Definition at line 349 of file ipcam_packet.h.

uint8_t PACKED_ATTRIBUTE::address

8-bit I2C Sensor Address (data returned will be 16-bit)

8-bit I2C Sensor Address

Definition at line 425 of file ipcam_packet.h.

IPAddress PACKED_ATTRIBUTE::cam_addr

Camera address at power-on.

Definition at line 145 of file ipcam_packet.h.

char PACKED_ATTRIBUTE::cam_name[CAMERA_NAME_LEN]

Should be zero terminated. Will be forcibly zero terminated otherwise.

Definition at line 144 of file ipcam_packet.h.

IPAddress PACKED_ATTRIBUTE::camera_ip

The default power-up IP address for the camera.

Definition at line 632 of file ipcam_packet.h.

char PACKED_ATTRIBUTE::camera_name[40]

The name assigned to this particular camera. Null terminated string.

Definition at line 631 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::checksum

Makes the sum of the page 0xFFFF.

Definition at line 146 of file ipcam_packet.h.

uint8_t PACKED_ATTRIBUTE::data

32-bit address as specified in the PacketFlashPayload definition

Definition at line 376 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::data

Data payload.

Definition at line 451 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::frame_number

Frame number as reported by Imager peripheral.

Definition at line 681 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::fw_version

System soft-core processor firmware version number, formatted as follows:

  • Bits 12..31: Reserved
  • Bits 8..11: Image Pipeline HDL Revision Number
  • Bits 0..7: FPGA Schematic Revision Number

Definition at line 648 of file ipcam_packet.h.

PacketGeneric PACKED_ATTRIBUTE::hdr

Generic Command Packet Headers.

Definition at line 202 of file ipcam_packet.h.

HeaderVideoLine PACKED_ATTRIBUTE::header

Standard video line header.

Definition at line 697 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::horiz_resolution

Number of 8-bit pixels per video line.

Definition at line 683 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::horizontal

Number of 8-bit video pixels per image row.

Definition at line 520 of file ipcam_packet.h.

char PACKED_ATTRIBUTE::hrt[16]

A human-readable text field describing the packet contents.

Definition at line 157 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::hw_version

FPGA and system board revision, formatted as follows:

  • Bits 16..31: Reserved
  • Bits 4..15: FPGA revision
  • Bits 0..3: Hardware (PCBA) revision

Definition at line 640 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::i2c[I2C_REGS_PER_FRAME]

Storage for I2C values read during the frame.

Definition at line 721 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::i2c_valid

Flags that indicate which 'i2c' values were updated during the previous frame.

Definition at line 722 of file ipcam_packet.h.

uint8_t PACKED_ATTRIBUTE::index

The index of the register in the EOF packet (range 0..3)

Definition at line 474 of file ipcam_packet.h.

IPAddress PACKED_ATTRIBUTE::ip_addr

IP Address device should use when responding.

Definition at line 205 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::ip_addr

Configuration Section.

The unique session IP address for the camera to use

Definition at line 238 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::line_number

Frame/line number as reported by Imager peripheral.

Definition at line 682 of file ipcam_packet.h.

MACAddress PACKED_ATTRIBUTE::mac

Camera Identification Section.

The unique six-byte IEEE MAC address assigned to this camera

Definition at line 544 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::magic_no

The Willow Garage Magic number (always WG_MAGIC_NO)

Definition at line 155 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::mode

The mode number to select (range 0..9)

Definition at line 495 of file ipcam_packet.h.

struct in_addr PACKED_ATTRIBUTE::prev_host

Definition at line 650 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::product_id

Camera Identification Section.

The fixed four-byte product ID assigned to the WGE100 camera by Willow Garage.

Always CONFIG_PRODUCT_ID (6805018) for this product

Definition at line 234 of file ipcam_packet.h.

char PACKED_ATTRIBUTE::product_name[40]

The fixed product name assigned to the WGE100 camera by Willow Garage. Null terminated string.

Definition at line 630 of file ipcam_packet.h.

NetHost PACKED_ATTRIBUTE::receiver

Receiver Designation.

The Ethernet MAC, IP address, and UDP port to which to send video

Definition at line 263 of file ipcam_packet.h.

NetHost PACKED_ATTRIBUTE::reply_to

All packet replies should be directed to this host.

Definition at line 158 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::ser_no

Indicates the specific serial number of this unit from the flash.

The unique four-byte serial number assigned to this camera.

Definition at line 235 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::serial

Definition at line 545 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::status_code

Response code (Error type, etc)

See also
Complete listing of all possible PacketStatus status_codes.

Definition at line 592 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::status_type

Type of status report (OK, Error, etc)

See also
Complete listing of all possible PacketStatus status_types.

Definition at line 591 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::ticks_hi

32 MSBs of system time base

End time of frame in ticks (MS word of system time base)

Definition at line 612 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::ticks_lo

32 LSBs of system time base

End time of frame in ticks (LS word of system time base)

Definition at line 613 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::ticks_per_sec

Number of time base ticks that occur per second.

Number of system time base ticks per second.

Definition at line 615 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::trig_state

Trigger state configuration.

Definition at line 401 of file ipcam_packet.h.

uint32_t PACKED_ATTRIBUTE::type

The packet type (see list of packet types, above)

Definition at line 156 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::vert_resolution

Number of video line packets per frame (not including EOF packet)

Definition at line 684 of file ipcam_packet.h.

uint16_t PACKED_ATTRIBUTE::vertical

Number of video lines per frame.

Definition at line 521 of file ipcam_packet.h.


The documentation for this struct was generated from the following file:


wge100_camera
Author(s): Blaise Gassend, Patrick Mihelich, Eric MacIntosh, David Palchak
autogenerated on Mon Jun 10 2019 15:44:16