views:

8

answers:

0

I am writing code using the Primera SDK from www.primera.com. I have been trying to write a little bit of ObjC code to just take each disk from the bin and load it into the drive, copy the contents of the disk off to a folder and process the next disk.

Firstly I do this to obtain the drive handles. Which returns correctly and I am able to use other functions to query robot status etc.

PTRobotInfoEx robotInfoEx;
result = PTRobot_GetRobotInfoEx(hRobot, &robotInfoEx);

However, once I have enumerated the drives, calling the following function causes the app to crash with BAD_ACCESS.

result = PTRobot_LoadDrive(hRobot, hDrive, 1, 0);
NSLog(@"PTRobot_LoadDrive:: %lu", result);

I have checked that the hRobot and hDrive handles are initialised and they are. Using the hRobot handle I am able to do all sorts of other functions - but it seems that when trying to access the hDrive handle to perform any actions causes problems.

Has anyone ever written code for these units under the Mac SDK?