int sdkResult = BS_SDK_SUCCESS; bool useMaster = true; BS2_DEVICE_ID id = (BS2_DEVICE_ID)Utility::selectMasterOrSlaveID(deviceList, useMaster); if (useMaster) { BS2OsdpStandardDeviceSecurityKey key = { 0, }; string keyInfo = Utility::getInput("Please enter the OSDP security key."); memcpy(key.key, keyInfo.c_str(), min(keyInfo.size(), BS2_OSDP_STANDARD_KEY_SIZE)); sdkResult = BS2_SetOsdpStandardDeviceSecurityKey(context_, id, &key); } else { sdkResult = BS2_SetOsdpStandardDeviceSecurityKey(context_, id, NULL); } if (BS_SDK_SUCCESS != sdkResult) printf("BS2_SetOsdpStandardDeviceSecurityKey call failed: %d", sdkResult); return sdkResult;