ArNetworking: ArServerHandlerCameraCollection Class Reference

- Main Page
- Classes
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArServerHandlerCameraCollection Class Reference

`#include <ArServerHandlerCameraCollection.h>`

List of all members.

## Detailed Description

Provides information to a client about different cameras and how to send requests to their different ArServerHandlerCamera and video image server objects.

ArServerHandlerCameraCollection defines the network packet handlers to transmit information regarding the cameras and their video streams that are installed on the robot.

This class handles the following requests:

- getCameraList: Replies with a packet containing a 2-byte integer indicating the number of cameras. Then, for each camera:
  1. camera name (string)
  2. camera type (string)
  3. camera name for user display (string)
  4. camera type for user display (string)
  5. list of requests that can be sent for this camera, beginning with the 2-byte number of commands, then, for each command:
     1. the generic descriptive name (string)
     2. the specific command request name (string)
     3. an appropriate frequency for making this request (4-byte integer)
  6. list of parameters, beginning with the 2-byte number of parameters, then, for each parameter, the parameter definition/value (see ArClientArg for format).

- setCameraParams: Set some camera parameters. Begins with camera name string, then for each parameter, the parameter name and value (see ArClientArg for the format). An empty parameter name string terminates the list. In reply, this handler sends a packet confirming the changes (see cameraParamUpdated below).

When a camera is added or a parameter changes, the server broadcasts the following packets to each client:

- cameraListUpdate: no arguments, use getCameraList to get the new list.

- cameraParamUpdated: starts with camera name, then a list of parameter name and value (see ArClientArg for format). An empty parameter name string terminates the list.

Note that the cameraParamUpdated is currently only sent in response to a setCameraParams request. That is, it does not monitor the actual parameter values in the ArCameraCollection.

In order to manipulate a particular camera using the request names and other information provided by ArServerHandlerCameraCollection, see ArServerHandlerCamera and ArVideoServer.

## Public Member Functions
| ArServerHandlerCameraCollection (ArServerBase *server, ArCameraCollection *cameraCollection)
| Constructor.
void | getCameraList (ArServerClient *client, ArNetPacket *packet)
| Handles the request to get the camera list / collection.
void | handleCameraCollectionModified ()
| Callback executed when the associated camera collection is modified.
void | setParams (ArServerClient *client, ArNetPacket *packet)
| Handles the request to edit a camera's parameters.
virtual | ~ArServerHandlerCameraCollection ()
| Destructor.
## Protected Attributes
ArCameraCollection * | myCameraCollection
| The associated camera collection.
ArFunctor * | myCollectionModifiedCB
| Notification callback when the camera collection has been modified.
ArFunctor2< ArServerClient *, ArNetPacket * > * | myGetCameraListCB
| Server callback for the get camera list request.
ArServerBase * | myServer
| The server used to send/receive requests.
ArFunctor2< ArServerClient *, ArNetPacket * > * | mySetParamCB
| Server callback for the set parameter request.
## Static Protected Attributes
static const char * | COLLECTION_UPDATED_PACKET_NAME
| Name of the network packet broadcast when the collection is modified.
static const char * | COMMAND_GROUP
| Command group for these packets.
static const char * | GET_COLLECTION_PACKET_NAME
| Name of the network packet to get the camera list.
static const char * | PARAMS_UPDATED_PACKET_NAME
| Name of the network packet broadcast when a parameter value is modified.
static const char * | SET_PARAMS_PACKET_NAME
| Name of the network packet to set a particular camera parameter.

## Constructor & Destructor Documentation

ArServerHandlerCameraCollection::ArServerHandlerCameraCollection | ( | ArServerBase * | server,
|  | ArCameraCollection * | cameraCollection |
| ) |  |  |

Constructor.

Parameters:

  | server | the ArServerBase * used to send/receive requests
  | cameraCollection | the ArCameraCollection * to be transmitted

## Member Function Documentation

void ArServerHandlerCameraCollection::getCameraList | ( | ArServerClient * | client,
|  | ArNetPacket * | packet |
| ) |  |  |

Handles the request to get the camera list / collection.

Parameters:

  | client | the ArServerClient * that is making the request
  | packet | the ArNetPacket * that contains the request

void ArServerHandlerCameraCollection::setParams | ( | ArServerClient * | client,
|  | ArNetPacket * | packet |
| ) |  |  |

Handles the request to edit a camera's parameters.

Parameters:

  | client | the ArServerClient * that is making the request
  | packet | the ArNetPacket * that contains the request

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

- ArServerHandlerCameraCollection.h