[aravis] gv: add more GigE vision register definitions.



commit 0d0780e0cbd4dc3c025a8555719ba741e4b19515
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Mon May 2 17:36:09 2011 +0200

    gv: add more GigE vision register definitions.

 docs/reference/aravis/aravis-sections.txt |  101 ++++++++++++++++++++-----
 src/arvfakecamera.c                       |   34 +++++----
 src/arvfakegvcamera.c                     |    2 +-
 src/arvgvcp.c                             |   14 ++--
 src/arvgvcp.h                             |  115 +++++++++++++++++++++++++----
 src/arvgvdevice.c                         |   24 +++---
 src/arvgvinterface.c                      |    9 +-
 tests/arvtest.c                           |    6 +-
 8 files changed, 227 insertions(+), 78 deletions(-)
---
diff --git a/docs/reference/aravis/aravis-sections.txt b/docs/reference/aravis/aravis-sections.txt
index 7931d1c..3c02265 100644
--- a/docs/reference/aravis/aravis-sections.txt
+++ b/docs/reference/aravis/aravis-sections.txt
@@ -791,29 +791,92 @@ arv_gvcp_packet_new_packet_resend_cmd
 arv_gvcp_packet_to_string
 arv_gvcp_packet_debug
 <SUBSECTION Private>
-ARV_GVCP_PORT
-ARV_GVBS_CURRENT_IP_ADDRESS
-ARV_GVBS_MANUFACTURER_NAME
+ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_CONTROL
+ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_EXCLUSIVE
+ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET
+ARV_GVBS_CURRENT_GATEWAY_OFFSET
+ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET
+ARV_GVBS_CURRENT_IP_CONFIGURATION_OFFSET
+ARV_GVBS_CURRENT_SUBNET_MASK_OFFSET
+ARV_GVBS_DEVICE_LINK_SPEED_0_OFFSET
+ARV_GVBS_DEVICE_MAC_ADDRESS_HIGH_OFFSET
+ARV_GVBS_DEVICE_MAC_ADDRESS_LOW_OFFSET
+ARV_GVBS_DEVICE_MODE_CHARACTER_SET_MASK
+ARV_GVBS_DEVICE_MODE_CHARACTER_SET_POS
+ARV_GVBS_DEVICE_MODE_ENDIANESS
+ARV_GVBS_DEVICE_MODE_OFFSET
+ARV_GVBS_DEVICE_VERSION_OFFSET
+ARV_GVBS_GVCP_CAPABILITY_CONCATENATION
+ARV_GVBS_GVCP_CAPABILITY_EVENT
+ARV_GVBS_GVCP_CAPABILITY_EVENT_DATA
+ARV_GVBS_GVCP_CAPABILITY_NAME_REGISTER
+ARV_GVBS_GVCP_CAPABILITY_OFFSET
+ARV_GVBS_GVCP_CAPABILITY_PACKET_RESEND
+ARV_GVBS_GVCP_CAPABILITY_SERIAL_NUMBER
+ARV_GVBS_GVCP_CAPABILITY_WRITE_MEMORY
+ARV_GVBS_HEARTBEAT_TIMEOUT_OFFSET
+ARV_GVBS_IP_CONFIGURATION_DHCP
+ARV_GVBS_IP_CONFIGURATION_LLA
+ARV_GVBS_IP_CONFIGURATION_PERSISTENT
+ARV_GVBS_MANUFACTURER_INFORMATIONS_OFFSET
+ARV_GVBS_MANUFACTURER_INFORMATIONS_SIZE
+ARV_GVBS_MANUFACTURER_NAME_OFFSET
+ARV_GVBS_MODEL_NAME_OFFSET
+ARV_GVBS_N_MESSAGE_CHANNELS_OFFSET
+ARV_GVBS_N_NETWORK_INTERFACES_OFFSET
+ARV_GVBS_N_STREAM_CHANNELS_OFFSET
+ARV_GVBS_PERSISTENT_GATEWAY_0_OFFSET
+ARV_GVBS_PERSISTENT_IP_ADDRESS_0_OFFSET
+ARV_GVBS_PERSISTENT_SUBNET_MASK_0_OFFSET
+ARV_GVBS_SERIAL_NUMBER_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_ASSIGNED_BANDWIDTH_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_ACCUMULATION_MAX_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_ACCUMULATION_MIN_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_ACCUMULATION_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_MAX_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_MIN_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_CURRENT_THOURGHPUT_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_FRAME_JITTER_MAX_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_FRAME_TRANSMISSION_DELAY_MAX_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_FRAME_TRANSMISSION_DELAY_MIN_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_FRAME_TRANSMISSION_DELAY_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_IP_ADDRESS_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_BIG_ENDIAN
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_DELAY_MAX_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_DELAY_MIN_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_DELAY_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_DO_NOT_FRAGMENT
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_FIRE_TEST
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_MASK
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_MAX_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_MIN_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_POS
+ARV_GVBS_STREAM_CHANNEL_0_PORT_OFFSET
+ARV_GVBS_STREAM_CHANNEL_0_THROUGHPUT_MAX_OFFSET
+ARV_GVBS_SUPPORTED_IP_CONFIGURATION_OFFSET
+ARV_GVBS_TIMESTAMP_CONTROL_OFFSET
+ARV_GVBS_TIMESTAMP_LATCHED_VALUE_HIGH_OFFSET
+ARV_GVBS_TIMESTAMP_LATCHED_VALUE_LOW_OFFSET
+ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH_OFFSET
+ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW_OFFSET
+ARV_GVBS_USER_DEFINED_NAME_OFFSET
+ARV_GVBS_VERSION_MAJOR_MASK
+ARV_GVBS_VERSION_MAJOR_POS
+ARV_GVBS_VERSION_MINOR_MASK
+ARV_GVBS_VERSION_MINOR_POS
+ARV_GVBS_VERSION_OFFSET
+ARV_GVBS_XML_URL_0_OFFSET
+ARV_GVBS_XML_URL_1_OFFSET
+ARV_GVBS_DEVICE_VERSION_SIZE
+ARV_GVBS_DISCOVERY_DATA_SIZE
 ARV_GVBS_MANUFACTURER_NAME_SIZE
-ARV_GVBS_MODEL_NAME
 ARV_GVBS_MODEL_NAME_SIZE
-ARV_GVBS_DEVICE_VERSION
-ARV_GVBS_DEVICE_VERSION_SIZE
-ARV_GVBS_USER_DEFINED_NAME
-ARV_GVBS_USER_DEFINED_NAME_SIZE
-ARV_GVBS_SERIAL_NUMBER
 ARV_GVBS_SERIAL_NUMBER_SIZE
-ARV_GVBS_DISCOVERY_DATA_SIZE
-ARV_GVBS_FIRST_XML_URL
-ARV_GVBS_SECOND_XML_URL
+ARV_GVBS_USER_DEFINED_NAME_SIZE
 ARV_GVBS_XML_URL_SIZE
-ARV_GVBS_HEARTBEAT_TIMEOUT
-ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH
-ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW
-ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE
-ARV_GVBS_FIRST_STREAM_CHANNEL_PORT
-ARV_GVBS_FIRST_STREAM_CHANNEL_PACKET_SIZE
-ARV_GVBS_FIRST_STREAM_CHANNEL_IP_ADDRESS
+ARV_GVCP_PORT
 ARV_GVCP_DATA_SIZE_MAX
 ArvGvcpPacket
 ArvGvcpPacketType
diff --git a/src/arvfakecamera.c b/src/arvfakecamera.c
index 0f81833..3c1930b 100644
--- a/src/arvfakecamera.c
+++ b/src/arvfakecamera.c
@@ -280,7 +280,7 @@ arv_fake_camera_set_inet_address (ArvFakeCamera *camera, GInetAddress *address)
 
 	bytes = g_inet_address_to_bytes (address);
 
-	arv_fake_camera_write_memory (camera, ARV_GVBS_CURRENT_IP_ADDRESS,
+	arv_fake_camera_write_memory (camera, ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET,
 				      g_inet_address_get_native_size (address), (char *) bytes);
 }
 
@@ -306,10 +306,12 @@ arv_fake_camera_get_stream_address (ArvFakeCamera *camera)
 
 	g_return_val_if_fail (ARV_IS_FAKE_CAMERA (camera), NULL);
 
-	inet_address = g_inet_address_new_from_bytes (camera->priv->memory + ARV_GVBS_FIRST_STREAM_CHANNEL_IP_ADDRESS,
+	inet_address = g_inet_address_new_from_bytes (camera->priv->memory +
+						      ARV_GVBS_STREAM_CHANNEL_0_IP_ADDRESS_OFFSET,
 						      G_SOCKET_FAMILY_IPV4);
-	stream_socket_address = g_inet_socket_address_new (inet_address,
-							   _get_register (camera, ARV_GVBS_FIRST_STREAM_CHANNEL_PORT));
+	stream_socket_address = g_inet_socket_address_new
+		(inet_address,
+		 _get_register (camera, ARV_GVBS_STREAM_CHANNEL_0_PORT_OFFSET));
 	g_object_unref (inet_address);
 
 	return stream_socket_address;
@@ -330,7 +332,7 @@ arv_fake_camera_get_control_channel_privilege (ArvFakeCamera *camera)
 {
 	guint32 value;
 
-	arv_fake_camera_read_register (camera, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE, &value);
+	arv_fake_camera_read_register (camera, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET, &value);
 
 	return value;
 }
@@ -338,7 +340,7 @@ arv_fake_camera_get_control_channel_privilege (ArvFakeCamera *camera)
 void
 arv_fake_camera_set_control_channel_privilege (ArvFakeCamera *camera, guint32 privilege)
 {
-	arv_fake_camera_write_register (camera, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE, privilege);
+	arv_fake_camera_write_register (camera, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET, privilege);
 }
 
 guint32
@@ -346,7 +348,7 @@ arv_fake_camera_get_heartbeat_timeout (ArvFakeCamera *camera)
 {
 	guint32 value;
 
-	arv_fake_camera_read_register (camera, ARV_GVBS_HEARTBEAT_TIMEOUT, &value);
+	arv_fake_camera_read_register (camera, ARV_GVBS_HEARTBEAT_TIMEOUT_OFFSET, &value);
 
 	return value;
 }
@@ -419,16 +421,16 @@ arv_fake_camera_new (const char *serial_number)
 	fake_camera->priv->genicam_xml = arv_get_fake_camera_genicam_xml (&fake_camera->priv->genicam_xml_size);
 	fake_camera->priv->memory = memory;
 
-	strcpy (memory + ARV_GVBS_MANUFACTURER_NAME, "Aravis");
-	strcpy (memory + ARV_GVBS_MODEL_NAME, "Fake");
-	strcpy (memory + ARV_GVBS_DEVICE_VERSION, PACKAGE_VERSION);
-	strcpy (memory + ARV_GVBS_SERIAL_NUMBER, serial_number);
+	strcpy (memory + ARV_GVBS_MANUFACTURER_NAME_OFFSET, "Aravis");
+	strcpy (memory + ARV_GVBS_MODEL_NAME_OFFSET, "Fake");
+	strcpy (memory + ARV_GVBS_DEVICE_VERSION_OFFSET, PACKAGE_VERSION);
+	strcpy (memory + ARV_GVBS_SERIAL_NUMBER_OFFSET, serial_number);
 
 	xml_url = g_strdup_printf ("Local:arv-fake-camera-%s.xml;%x;%x",
 				   PACKAGE_VERSION,
 				   ARV_FAKE_CAMERA_MEMORY_SIZE,
 				   (unsigned int) fake_camera->priv->genicam_xml_size);
-	strcpy (memory + ARV_GVBS_FIRST_XML_URL, xml_url);
+	strcpy (memory + ARV_GVBS_XML_URL_0_OFFSET, xml_url);
 	g_free (xml_url);
 
 	arv_fake_camera_write_register (fake_camera, ARV_FAKE_CAMERA_REGISTER_SENSOR_WIDTH,
@@ -457,10 +459,10 @@ arv_fake_camera_new (const char *serial_number)
 	arv_fake_camera_write_register (fake_camera, ARV_FAKE_CAMERA_REGISTER_GAIN_RAW, 0);
 	arv_fake_camera_write_register (fake_camera, ARV_FAKE_CAMERA_REGISTER_GAIN_MODE, 0);
 
-	arv_fake_camera_write_register (fake_camera, ARV_GVBS_HEARTBEAT_TIMEOUT, 3000);
-	arv_fake_camera_write_register (fake_camera, ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH, 0);
-	arv_fake_camera_write_register (fake_camera, ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW, 1000000000);
-	arv_fake_camera_write_register (fake_camera, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE, 0);
+	arv_fake_camera_write_register (fake_camera, ARV_GVBS_HEARTBEAT_TIMEOUT_OFFSET, 3000);
+	arv_fake_camera_write_register (fake_camera, ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH_OFFSET, 0);
+	arv_fake_camera_write_register (fake_camera, ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW_OFFSET, 1000000000);
+	arv_fake_camera_write_register (fake_camera, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET, 0);
 
 	return fake_camera;
 }
diff --git a/src/arvfakegvcamera.c b/src/arvfakegvcamera.c
index 5bb1bd6..bd5ad97 100644
--- a/src/arvfakegvcamera.c
+++ b/src/arvfakegvcamera.c
@@ -403,7 +403,7 @@ handle_control_packet (ArvFakeGvCamera *gv_camera, GSocket *socket,
 			ack_packet = arv_gvcp_packet_new_read_register_ack (register_value, packet_count,
 									    &ack_packet_size);
 
-			if (register_address == ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE)
+			if (register_address == ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET)
 				clock_gettime (CLOCK_MONOTONIC, &gv_camera->controller_time);
 
 			break;
diff --git a/src/arvgvcp.c b/src/arvgvcp.c
index 5a3b155..e5e04f7 100644
--- a/src/arvgvcp.c
+++ b/src/arvgvcp.c
@@ -456,16 +456,16 @@ arv_gvcp_packet_to_string (const ArvGvcpPacket *packet)
 			break;
 		case ARV_GVCP_COMMAND_DISCOVERY_ACK:
 			g_string_append_printf (string, "manufacturer = %s\n",
-						&data[ARV_GVBS_MANUFACTURER_NAME]);
+						&data[ARV_GVBS_MANUFACTURER_NAME_OFFSET]);
 			g_string_append_printf (string, "name         = %s\n",
-						&data[ARV_GVBS_USER_DEFINED_NAME]);
+						&data[ARV_GVBS_USER_DEFINED_NAME_OFFSET]);
 			g_string_append_printf (string, "model        = %s\n",
-						&data[ARV_GVBS_MODEL_NAME]);
+						&data[ARV_GVBS_MODEL_NAME_OFFSET]);
 			g_string_append_printf (string, "address      = %d.%d.%d.%d\n",
-						data[ARV_GVBS_CURRENT_IP_ADDRESS] & 0xff,
-						data[ARV_GVBS_CURRENT_IP_ADDRESS + 1] & 0xff,
-						data[ARV_GVBS_CURRENT_IP_ADDRESS + 2] & 0xff,
-						data[ARV_GVBS_CURRENT_IP_ADDRESS + 3] & 0xff);
+						data[ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET] & 0xff,
+						data[ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET + 1] & 0xff,
+						data[ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET + 2] & 0xff,
+						data[ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET + 3] & 0xff);
 			break;
 		case ARV_GVCP_COMMAND_WRITE_REGISTER_CMD:
 			value = g_ntohl (*((guint32 *) &data[0]));
diff --git a/src/arvgvcp.h b/src/arvgvcp.h
index 0856d89..fc4524f 100644
--- a/src/arvgvcp.h
+++ b/src/arvgvcp.h
@@ -29,32 +29,115 @@ G_BEGIN_DECLS
 
 #define ARV_GVCP_PORT	3956
 
-#define ARV_GVBS_CURRENT_IP_ADDRESS			0x00000024
-#define ARV_GVBS_MANUFACTURER_NAME			0x00000048
+#define ARV_GVBS_VERSION_OFFSET				0x00000000
+#define ARV_GVBS_VERSION_MINOR_MASK			0xffff0000
+#define ARV_GVBS_VERSION_MINOR_POS			16
+#define ARV_GVBS_VERSION_MAJOR_MASK			0x0000ffff
+#define ARV_GVBS_VERSION_MAJOR_POS			0
+
+#define ARV_GVBS_DEVICE_MODE_OFFSET			0x00000004
+#define ARV_GVBS_DEVICE_MODE_ENDIANESS			1 << 0
+#define ARV_GVBS_DEVICE_MODE_CHARACTER_SET_MASK		0xffff0000
+#define ARV_GVBS_DEVICE_MODE_CHARACTER_SET_POS		16
+
+#define ARV_GVBS_DEVICE_MAC_ADDRESS_HIGH_OFFSET		0x00000008
+#define ARV_GVBS_DEVICE_MAC_ADDRESS_LOW_OFFSET		0x0000000c
+
+#define ARV_GVBS_SUPPORTED_IP_CONFIGURATION_OFFSET	0x00000010
+#define ARV_GVBS_CURRENT_IP_CONFIGURATION_OFFSET	0x00000014
+#define ARV_GVBS_IP_CONFIGURATION_LLA			1 << 29
+#define ARV_GVBS_IP_CONFIGURATION_DHCP			1 << 30
+#define ARV_GVBS_IP_CONFIGURATION_PERSISTENT		1 << 31
+
+#define ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET		0x00000024
+#define ARV_GVBS_CURRENT_SUBNET_MASK_OFFSET		0x00000034
+#define ARV_GVBS_CURRENT_GATEWAY_OFFSET			0x00000044
+
+#define ARV_GVBS_MANUFACTURER_NAME_OFFSET		0x00000048
 #define ARV_GVBS_MANUFACTURER_NAME_SIZE			32
-#define ARV_GVBS_MODEL_NAME				0x00000068
+
+#define ARV_GVBS_MODEL_NAME_OFFSET			0x00000068
 #define ARV_GVBS_MODEL_NAME_SIZE			32
-#define ARV_GVBS_DEVICE_VERSION 			0x00000088
+
+#define ARV_GVBS_DEVICE_VERSION_OFFSET			0x00000088
 #define ARV_GVBS_DEVICE_VERSION_SIZE			32
-#define ARV_GVBS_USER_DEFINED_NAME			0x000000e8
-#define ARV_GVBS_USER_DEFINED_NAME_SIZE			16
-#define ARV_GVBS_SERIAL_NUMBER				0x000000d8
+
+#define ARV_GVBS_MANUFACTURER_INFORMATIONS_OFFSET	0x000000a8
+#define ARV_GVBS_MANUFACTURER_INFORMATIONS_SIZE		48
+
+#define ARV_GVBS_SERIAL_NUMBER_OFFSET			0x000000d8
 #define ARV_GVBS_SERIAL_NUMBER_SIZE			16
 
+#define ARV_GVBS_USER_DEFINED_NAME_OFFSET		0x000000e8
+#define ARV_GVBS_USER_DEFINED_NAME_SIZE			16
+
 #define ARV_GVBS_DISCOVERY_DATA_SIZE			0xf8
 
-#define ARV_GVBS_FIRST_XML_URL				0x00000200
-#define ARV_GVBS_SECOND_XML_URL				0x00000400
+#define ARV_GVBS_XML_URL_0_OFFSET			0x00000200
+#define ARV_GVBS_XML_URL_1_OFFSET			0x00000400
 #define ARV_GVBS_XML_URL_SIZE				512
 
-#define ARV_GVBS_HEARTBEAT_TIMEOUT			0x00000938
-#define ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH		0x0000093c
-#define ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW		0x00000940
+#define ARV_GVBS_N_NETWORK_INTERFACES_OFFSET		0x00000600
+
+#define	ARV_GVBS_PERSISTENT_IP_ADDRESS_0_OFFSET		0x0000064c
+#define	ARV_GVBS_PERSISTENT_SUBNET_MASK_0_OFFSET	0x0000065c
+#define	ARV_GVBS_PERSISTENT_GATEWAY_0_OFFSET		0x0000066c
+
+#define ARV_GVBS_N_MESSAGE_CHANNELS_OFFSET		0x00000900
+#define ARV_GVBS_N_STREAM_CHANNELS_OFFSET		0x00000904
+
+#define ARV_GVBS_GVCP_CAPABILITY_OFFSET			0x00000934
+#define ARV_GVBS_GVCP_CAPABILITY_NAME_REGISTER		1 << 0
+#define ARV_GVBS_GVCP_CAPABILITY_SERIAL_NUMBER		1 << 1
+#define ARV_GVBS_GVCP_CAPABILITY_EVENT_DATA		1 << 27
+#define ARV_GVBS_GVCP_CAPABILITY_EVENT			1 << 28
+#define ARV_GVBS_GVCP_CAPABILITY_PACKET_RESEND		1 << 29
+#define ARV_GVBS_GVCP_CAPABILITY_WRITE_MEMORY		1 << 30
+#define ARV_GVBS_GVCP_CAPABILITY_CONCATENATION		1 << 31
+
+#define ARV_GVBS_HEARTBEAT_TIMEOUT_OFFSET		0x00000938
+#define ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH_OFFSET	0x0000093c
+#define ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW_OFFSET	0x00000940
+#define ARV_GVBS_TIMESTAMP_CONTROL_OFFSET		0x00000944
+#define ARV_GVBS_TIMESTAMP_LATCHED_VALUE_HIGH_OFFSET	0x00000948
+#define ARV_GVBS_TIMESTAMP_LATCHED_VALUE_LOW_OFFSET	0x0000094c
+
+#define ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET	0x00000a00
+#define ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_CONTROL	1 << 30
+#define ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_EXCLUSIVE	1 << 31
+
+#define ARV_GVBS_STREAM_CHANNEL_0_PORT_OFFSET		0x00000d00
+
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_OFFSET		0x00000d04
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_MASK		0xffff0000
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_POS		16
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_FIRE_TEST		1 << 0
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_DO_NOT_FRAGMENT	1 << 1
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_BIG_ENDIAN		1 << 2
+
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_DELAY_OFFSET		0x00000d08
+
+#define ARV_GVBS_STREAM_CHANNEL_0_IP_ADDRESS_OFFSET		0x00000d18
+
+#define ARV_GVBS_DEVICE_LINK_SPEED_0_OFFSET			0x0000b000
 
-#define ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE		0x00000a00
-#define ARV_GVBS_FIRST_STREAM_CHANNEL_PORT		0x00000d00
-#define ARV_GVBS_FIRST_STREAM_CHANNEL_PACKET_SIZE	0x00000d04
-#define ARV_GVBS_FIRST_STREAM_CHANNEL_IP_ADDRESS	0x00000d18
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_MIN_OFFSET		0x0000c000
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_MAX_OFFSET		0x0000c004
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_DELAY_MIN_OFFSET		0x0000c008
+#define ARV_GVBS_STREAM_CHANNEL_0_PACKET_DELAY_MAX_OFFSET		0x0000c00c
+#define ARV_GVBS_STREAM_CHANNEL_0_FRAME_TRANSMISSION_DELAY_OFFSET	0x0000c010
+#define ARV_GVBS_STREAM_CHANNEL_0_FRAME_TRANSMISSION_DELAY_MIN_OFFSET	0x0000c014
+#define ARV_GVBS_STREAM_CHANNEL_0_FRAME_TRANSMISSION_DELAY_MAX_OFFSET	0x0000c018
+#define ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_OFFSET		0x0000c01c
+#define ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_MIN_OFFSET		0x0000c020
+#define ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_MAX_OFFSET		0x0000c024
+#define ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_ACCUMULATION_OFFSET	0x0000c028
+#define ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_ACCUMULATION_MIN_OFFSET	0x0000c02c
+#define ARV_GVBS_STREAM_CHANNEL_0_BANDWITDH_RESERVE_ACCUMULATION_MAX_OFFSET	0x0000c030
+#define ARV_GVBS_STREAM_CHANNEL_0_THROUGHPUT_MAX_OFFSET			0x0000c100
+#define ARV_GVBS_STREAM_CHANNEL_0_CURRENT_THOURGHPUT_OFFSET		0x0000c104
+#define ARV_GVBS_STREAM_CHANNEL_0_ASSIGNED_BANDWIDTH_OFFSET		0x0000c108
+#define ARV_GVBS_STREAM_CHANNEL_0_FRAME_JITTER_MAX_OFFSET		0x0000c10c
 
 #define ARV_GVCP_DATA_SIZE_MAX				512
 
diff --git a/src/arvgvdevice.c b/src/arvgvdevice.c
index e5c758f..ffa8b72 100644
--- a/src/arvgvdevice.c
+++ b/src/arvgvdevice.c
@@ -277,7 +277,7 @@ arv_gv_device_heartbeat_thread (void *data)
 
 	do {
 		g_usleep (thread_data->period_us);
-		_read_register (io_data, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE, &value);
+		_read_register (io_data, ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET, &value);
 		arv_debug ("device", "[GvDevice::Heartbeat] (%d)", value);
 	} while (!thread_data->cancel);
 
@@ -290,7 +290,7 @@ static gboolean
 arv_gv_device_take_control (ArvGvDevice *gv_device)
 {
 	gv_device->priv->is_controller = arv_device_write_register (ARV_DEVICE (gv_device),
-								    ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE, 2);
+								    ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET, 2);
 
 	return gv_device->priv->is_controller;
 }
@@ -301,7 +301,7 @@ arv_gv_device_leave_control (ArvGvDevice *gv_device)
 	gboolean result;
 
 	result = arv_device_write_register (ARV_DEVICE (gv_device),
-					    ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE, 0);
+					    ARV_GVBS_CONTROL_CHANNEL_PRIVILEGE_OFFSET, 0);
 	gv_device->priv->is_controller = FALSE;
 
 	return result;
@@ -316,10 +316,10 @@ arv_gv_device_get_timestamp_tick_frequency (ArvGvDevice *gv_device)
 	g_return_val_if_fail (ARV_IS_GV_DEVICE (gv_device), 0);
 
 	if (arv_device_read_register (ARV_DEVICE (gv_device),
-				      ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH,
+				      ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_HIGH_OFFSET,
 				      &timestamp_tick_frequency_high) &&
 	    arv_device_read_register (ARV_DEVICE (gv_device),
-				      ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW,
+				      ARV_GVBS_TIMESTAMP_TICK_FREQUENCY_LOW_OFFSET,
 				      &timestamp_tick_frequency_low)) {
 		guint64 timestamp_tick_frequency;
 
@@ -339,7 +339,7 @@ arv_gv_device_get_packet_size (ArvGvDevice *gv_device)
 	g_return_val_if_fail (ARV_IS_GV_DEVICE (gv_device), 0);
 
 	arv_device_read_register (ARV_DEVICE (gv_device),
-				  ARV_GVBS_FIRST_STREAM_CHANNEL_PACKET_SIZE,
+				  ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_OFFSET,
 				  &packet_size);
 
 	return packet_size;
@@ -444,9 +444,9 @@ arv_gv_device_get_genicam_xml (ArvDevice *device, size_t *size)
 
 	*size = 0;
 
-	xml = _load_genicam (gv_device, ARV_GVBS_FIRST_XML_URL, size);
+	xml = _load_genicam (gv_device, ARV_GVBS_XML_URL_0_OFFSET, size);
 	if (xml == NULL)
-		xml = _load_genicam (gv_device, ARV_GVBS_SECOND_XML_URL, size);
+		xml = _load_genicam (gv_device, ARV_GVBS_XML_URL_1_OFFSET, size);
 
 	gv_device->priv->genicam_xml = xml;
 	gv_device->priv->genicam_xml_size = *size;
@@ -492,11 +492,11 @@ arv_gv_device_create_stream (ArvDevice *device, ArvStreamCallback callback, void
 
 	stream_port = arv_gv_stream_get_port (ARV_GV_STREAM (stream));
 
-	arv_device_write_register (device, ARV_GVBS_FIRST_STREAM_CHANNEL_PACKET_SIZE, 0x000005dc);
-	arv_device_write_register (device, ARV_GVBS_FIRST_STREAM_CHANNEL_IP_ADDRESS,
+	arv_device_write_register (device, ARV_GVBS_STREAM_CHANNEL_0_PACKET_SIZE_OFFSET, 0x000005dc);
+	arv_device_write_register (device, ARV_GVBS_STREAM_CHANNEL_0_IP_ADDRESS_OFFSET,
 				   g_htonl(*((guint32 *) address_bytes)));
-	arv_device_write_register (device, ARV_GVBS_FIRST_STREAM_CHANNEL_PORT, stream_port);
-	arv_device_read_register (device, ARV_GVBS_FIRST_STREAM_CHANNEL_PORT, &stream_port);
+	arv_device_write_register (device, ARV_GVBS_STREAM_CHANNEL_0_PORT_OFFSET, stream_port);
+	arv_device_read_register (device, ARV_GVBS_STREAM_CHANNEL_0_PORT_OFFSET, &stream_port);
 
 	arv_debug ("device", "[GvDevice::create_stream] stream port = %d", stream_port);
 
diff --git a/src/arvgvinterface.c b/src/arvgvinterface.c
index 5b964f2..636e18d 100644
--- a/src/arvgvinterface.c
+++ b/src/arvgvinterface.c
@@ -249,9 +249,9 @@ arv_gv_interface_receive_hello_packet (ArvGvInterface *gv_interface)
 
 						arv_gvcp_packet_debug (packet);
 
-						manufacturer = g_strndup (&data[ARV_GVBS_MANUFACTURER_NAME],
+						manufacturer = g_strndup (&data[ARV_GVBS_MANUFACTURER_NAME_OFFSET],
 									  ARV_GVBS_MANUFACTURER_NAME_SIZE);
-						serial_number = g_strndup (&data[ARV_GVBS_SERIAL_NUMBER],
+						serial_number = g_strndup (&data[ARV_GVBS_SERIAL_NUMBER_OFFSET],
 									   ARV_GVBS_SERIAL_NUMBER_SIZE);
 						key = g_strdup_printf ("%s-%s", manufacturer, serial_number);
 						g_free (manufacturer);
@@ -321,8 +321,9 @@ arv_gv_interface_open_device (ArvInterface *interface, const char *device_id)
 	if (device_infos == NULL)
 		return NULL;
 
-	device_address = g_inet_address_new_from_bytes (&device_infos->discovery_data[ARV_GVBS_CURRENT_IP_ADDRESS],
-							G_SOCKET_FAMILY_IPV4);
+	device_address = g_inet_address_new_from_bytes
+		(&device_infos->discovery_data[ARV_GVBS_CURRENT_IP_ADDRESS_OFFSET],
+		 G_SOCKET_FAMILY_IPV4);
 	device = arv_gv_device_new (device_infos->interface_address, device_address);
 	g_object_unref (device_address);
 
diff --git a/tests/arvtest.c b/tests/arvtest.c
index c59be8f..c84e62e 100644
--- a/tests/arvtest.c
+++ b/tests/arvtest.c
@@ -181,13 +181,13 @@ main (int argc, char **argv)
 		for (i = 0; i < 30; i++)
 			arv_stream_push_buffer (stream, arv_buffer_new (value, NULL));
 
-		arv_device_read_register (device, ARV_GVBS_FIRST_STREAM_CHANNEL_PORT, &value);
+		arv_device_read_register (device, ARV_GVBS_STREAM_CHANNEL_0_PORT_OFFSET, &value);
 		g_print ("stream port = %d (%d)\n", value, arv_gv_stream_get_port (ARV_GV_STREAM (stream)));
 
 		arv_device_read_memory (device, 0x00014150, 8, memory_buffer);
 		arv_device_read_memory (device, 0x000000e8, 16, memory_buffer);
 		arv_device_read_memory (device,
-					ARV_GVBS_USER_DEFINED_NAME,
+					ARV_GVBS_USER_DEFINED_NAME_OFFSET,
 					ARV_GVBS_USER_DEFINED_NAME_SIZE, memory_buffer);
 
 		node = arv_gc_get_node (genicam, "AcquisitionStart");
@@ -205,7 +205,7 @@ main (int argc, char **argv)
 			} while (buffer != NULL);
 		} while (!cancel);
 
-		arv_device_read_register (device, ARV_GVBS_FIRST_STREAM_CHANNEL_PORT, &value);
+		arv_device_read_register (device, ARV_GVBS_STREAM_CHANNEL_0_PORT_OFFSET, &value);
 		g_print ("stream port = %d (%d)\n", value, arv_gv_stream_get_port (ARV_GV_STREAM (stream)));
 
 		arv_stream_get_statistics (stream, &n_processed_buffers, &n_failures, &n_underruns);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]