/* 
*	file: nikonHandler.h
*	author: Eric J Martin
*	
*	copyright: MBARI 2013
*
*	Definition of the nikonHandler class, which handles all USB PTPP 
*	interactions. 
*
*	See https://sdk.nikonimaging.com/apply/ for more information
*	or a copy of the sdk. 
*
*/

#pragma once
#ifndef NIKONHANDLER_H_
#define NIKONHANDLER_H_

#include <stdio.h>

#include "Maid3.h"
#include "Maid3d1.h"
#include "CtrlSample.h"

class nikonHandler
{
public:
				nikonHandler(void);			// constructor
				~nikonHandler(void);		// destructor
	bool		connectModule(void);		// connect to the binary nikon module
	bool		connectCamera(void);		// connect to the USB PTPP connection on first available camers
	bool		itemDownloadDefault(void);	// download the first available image
	bool		closeModule(void);			// unlink the binary module
	bool		isConnected(void);			// test for camera connection to the class
	bool		itemSelected(void);			// test for success of the last itemselect() call
	bool		itemSelect(void);			// select the first available image on the camera
	bool		imageCommandAcquire( LPRefObj pRefItm, ULONG ulDatID ); // issue a call into the module to acquire an image.
	bool		setImageName(char * instr, int len); // copy image name into the global variable upon successful download.

private:
	LPRefObj	pRefSrc;					
	LPRefObj	pRefMod;
	bool		bCameraConnected;
	bool		bModuleConnected;
	bool		bItemSelected;

	ULONG		ulCurrentItemID;
	char 		sNextFileName[32];

};

#endif