#import <stdio.h>
#import <c.h>
#include <sgtty.h>
#import "VISCA.h"

int openPort( char *deviceName, int bps);
int closePort( int fd);



void
main()
{
	char port[30];
	char outMessage[1024];
	char inMessage[1024];
	VISCA *visca;
	
	printf("Open:");
	gets(port);
	
	printf("\nOpening <%s>\n", port);
	
	visca = [[VISCA alloc] init];
	
	[visca setPort: port];
	[visca open];
	[visca setAddressBroadcastFrom: 0];
	[visca setWhenNow];
	[visca v_address];
	
	[visca md_power: POWER_ON];
	[visca md_modeControl_1: MC1_FAST_FORWARD];
	sleep(10);
	[visca md_modeControl_1: MC1_STOP];
	[visca md_modeControl_1: MC1_REWIND];
	sleep(10);
	[visca md_modeControl_1: MC1_STOP];
	[visca md_modeControl_1: MC1_PLAY];
	sleep(10);
	[visca md_modeControl_1: MC1_STOP];
	
	[visca md_power: POWER_OFF];
	
	[visca close];
	[visca free];
	
	

	return;	
}