00001 00009 /* 00010 @copyright 00011 Copyright (c) Xsens Technologies B.V., 2006-2012. All rights reserved. 00012 00013 This source code is provided under the MT SDK Software License Agreement 00014 and is intended for use only by Xsens Technologies BV and 00015 those that have explicit written permission to use it from 00016 Xsens Technologies BV. 00017 00018 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 00021 PARTICULAR PURPOSE. 00022 */ 00023 00024 #include "serialkey.h" 00025 #include <xsens/xsstring.h> 00026 #include <xsens/xscontrol.h> 00027 #include <stdio.h> 00028 #include <iostream> 00029 00030 #define SERIAL_KEY_SIZE 30 00031 00032 extern "C" 00033 int setSerialKey() 00034 { 00035 // if (strcmp(SERIAL_KEY, "enter serial key here") == 0) 00036 // { 00037 // { 00038 // char serialKey[256]; 00039 // FILE* fp; 00040 // memset(serialKey, 0, 256); 00041 // fp = fopen("serial.key", "r"); 00042 // if (fp) 00043 // { 00044 // size_t result = fread(serialKey, 1, SERIAL_KEY_SIZE, fp); 00045 // fclose(fp); 00046 00047 // if (result == SERIAL_KEY_SIZE) 00048 // { 00049 // if (XsControl::setSerialKey(serialKey)) 00050 // return 1; 00051 // } 00052 // } 00053 // } 00054 00055 // // ask for serial key 00056 // std::cout << "Please enter valid serial key" << std::endl; 00057 // std::cout << "If you built this example yourself you can enter the key in \"serialkey.h\"" << std::endl; 00058 // char serialKey[256]; 00059 // std::cin.getline(serialKey, 256); 00060 // XsString serial(serialKey); 00061 00062 // if (XsControl::setSerialKey(serial)) 00063 // { 00064 // // store it 00065 // FILE* fp = fopen("serial.key", "w"); 00066 // fwrite(serial.c_str(), sizeof(char), serial.size(), fp); 00067 // fclose(fp); 00068 // return 1; 00069 // } 00070 // return 0; 00071 // } 00072 // return XsControl::setSerialKey(SERIAL_KEY); 00073 return 1; 00074 } 00075