#include "ibutton/shaib.h"
}
+// owAcquireEx is stupid and takes a char * when it really won't modify it
+char serial_port[] =
#ifdef WIN32
-#define SERIAL_PORT "COM1"
+ "COM1"
#else
-#define SERIAL_PORT "/dev/ttyS0"
+ "/dev/ttyS0"
#endif
+;
bool iButton::GetAESKey(const uchar *subkey, uchar *output)
{
memcpy(firstDataPage, subkey, 32);
- if ((copr.portnum = owAcquireEx(SERIAL_PORT)) == -1)
+ if ((copr.portnum = owAcquireEx(serial_port)) == -1)
{
LOG->Warn( "GetAESKey(): failed to acquire port." );
return false;
SHACopr copr;
uchar spBuf[32];
- if( (copr.portnum = owAcquireEx(SERIAL_PORT)) == -1 )
+ if( (copr.portnum = owAcquireEx(serial_port)) == -1 )
{
LOG->Warn("GetSerialNumber(): failed to acquire port.");
return CString();