40 #ifndef _IPCAM_PACKET_H_ 41 #define _IPCAM_PACKET_H_ 46 #warning Building for DEVICE 49 #include "ipcam_network.h" 50 #include "ipcam_flash.h" 54 #error Multiple builds defined 59 #define FLASH_MAX_PAGENO 4095 60 #define FLASH_PAGE_SIZE 264 62 #define FLASH_NAME_PAGENO FLASH_MAX_PAGENO 63 #define FLASH_CALIBRATION_PAGENO (FLASH_MAX_PAGENO - 2) 64 #define CAMERA_NAME_LEN 40 69 #include <sys/socket.h> 70 #include <netinet/in.h> 71 #include <arpa/inet.h> 86 #error Multiple builds defined 89 #endif //LIBRARY_BUILD 94 #define WG_MAGIC_NO 0x00DEAF42UL 101 #define WG_CAMCMD_PORT 1627 109 #define PKTT_DISCOVER 0 110 #define PKTT_CONFIGURE 1 111 #define PKTT_VIDSTART 2 112 #define PKTT_VIDSTOP 3 114 #define PKTT_TIMEREQ 5 115 #define PKTT_FLASHREAD 6 116 #define PKTT_FLASHWRITE 7 117 #define PKTT_TRIGCTRL 8 118 #define PKTT_SENSORRD 9 119 #define PKTT_SENSORWR 10 120 #define PKTT_SENSORSEL 11 121 #define PKTT_IMGRMODE 12 122 #define PKTT_IMGRSETRES 13 123 #define PKTT_SYSCONFIG 14 124 #define PKTT_RECONFIG_FPGA 15 125 #define PKT_MAX_ID PKTT_RECONFIG_FPGA 127 #define PKTT_ANNOUNCE 0x80 128 #define PKTT_TIMEREPLY 0x81 129 #define PKTT_STATUS 0x82 130 #define PKTT_FLASHDATA 0x83 131 #define PKTT_SENSORDATA 0x84 139 #if CAMERA_NAME_LEN != 40 140 #error CAMERA_NAME_LEN should be 40. 161 #ifdef DEVICE_BUILD // The host uses the Linux network stack so doesn't require this section 186 #endif //DEVICE_BUILD 569 #define PKT_STATUST_OK 0 570 #define PKT_STATUST_ERROR 1 577 #define PKT_ERROR_TIMEOUT 0 578 #define PKT_ERROR_SYSERR 1 579 #define PKT_ERROR_INVALID 2 587 typedef struct PACKED_ATTRIBUTE { 630 char product_name[40];
631 char camera_name[40];
650 struct in_addr prev_host;
656 #define IMAGER_MAGICLINE_MASK 0xFFF0 659 #define IMAGER_LINENO_EOF 0xFFFF 662 #define IMAGER_LINENO_ERR 0xFFFE 665 #define IMAGER_LINENO_OVF 0xFFFD 668 #define IMAGER_LINENO_ABORT 0xFFFC 671 #define IMAGER_LINENO_SHORT 0xFFFB 674 #define IMAGER_LINENO_XOR 0xFFFA 704 #define I2C_REGS_PER_FRAME 4 719 uint32_t ticks_per_sec;
727 #define I2C_AUTO_REG_UNUSED ((uint32_t)-1) 730 #endif //_IPCAM_PACKET_H_
struct PACKED_ATTRIBUTE PacketStatus
struct PACKED_ATTRIBUTE PacketGeneric
uint32_t type
The packet type (see list of packet types, above)
struct PACKED_ATTRIBUTE PacketVidStart
struct PACKED_ATTRIBUTE PacketSensorSelect
struct PACKED_ATTRIBUTE PacketReconfigureFPGA
HeaderVideoLine header
Standard video line header.
uint8_t index
The index of the register in the EOF packet (range 0..3)
struct PACKED_ATTRIBUTE PacketImagerMode
uint16_t line_number
Frame/line number as reported by Imager peripheral.
struct PACKED_ATTRIBUTE PacketTimeRequest
struct PACKED_ATTRIBUTE PacketSysConfig
struct PACKED_ATTRIBUTE PacketSensorRequest
IPAddress camera_ip
The default power-up IP address for the camera.
NetHost reply_to
All packet replies should be directed to this host.
uint32_t status_code
Response code (Error type, etc)
uint32_t ip_addr
Configuration Section.
IPAddress ip_addr
IP Address device should use when responding.
struct PACKED_ATTRIBUTE PacketConfigure
uint16_t data
Data payload.
uint32_t ser_no
Indicates the specific serial number of this unit from the flash.
uint32_t ticks_lo
32 LSBs of system time base
struct PACKED_ATTRIBUTE PacketTimer
struct PACKED_ATTRIBUTE PacketVideoLine
uint32_t frame_number
Frame number as reported by Imager peripheral.
uint16_t vert_resolution
Number of video line packets per frame (not including EOF packet)
uint8_t address
8-bit I2C Sensor Address (data returned will be 16-bit)
uint32_t trig_state
Trigger state configuration.
IPAddress cam_addr
Camera address at power-on.
uint16_t vertical
Number of video lines per frame.
NetHost receiver
Receiver Designation.
struct PACKED_ATTRIBUTE PacketDiscover
struct PACKED_ATTRIBUTE PacketVidStop
struct PACKED_ATTRIBUTE PacketReset
uint16_t horiz_resolution
Number of 8-bit pixels per video line.
struct PACKED_ATTRIBUTE PacketImagerSetRes
struct PACKED_ATTRIBUTE HeaderVideoLine
uint32_t ticks_per_sec
Number of time base ticks that occur per second.
struct PACKED_ATTRIBUTE PacketFlashPayload
struct PACKED_ATTRIBUTE PacketEOF
uint32_t product_id
Camera Identification Section.
struct PACKED_ATTRIBUTE IdentityFlashPage
uint32_t mode
The mode number to select (range 0..9)
struct PACKED_ATTRIBUTE PacketAnnounce
uint32_t magic_no
The Willow Garage Magic number (always WG_MAGIC_NO)
PacketGeneric hdr
Generic Command Packet Headers.
uint16_t checksum
Makes the sum of the page 0xFFFF.
uint32_t address
Dataflash page address.
uint32_t i2c_valid
Flags that indicate which 'i2c' values were updated during the previous frame.
MACAddress mac
Camera Identification Section.
struct PACKED_ATTRIBUTE PacketSensorData
struct PACKED_ATTRIBUTE PacketFlashRequest
uint32_t ticks_hi
32 MSBs of system time base
uint32_t status_type
Type of status report (OK, Error, etc)
uint16_t horizontal
Number of 8-bit video pixels per image row.
#define I2C_REGS_PER_FRAME
Number of I2C register to read during each video frame interval.
struct PACKED_ATTRIBUTE PacketTrigControl