BS2OsdpStandardConfig config = { 0, }; vector updateData; BS2_DEVICE_ID id = Utility::selectDeviceID(deviceList, false, false); int sdkResult = cc.getOsdpStandardConfig(id, config); if (BS_SDK_SUCCESS != sdkResult) return sdkResult; uint32_t numOfActivated = cc.printOSDPDeviceID(config); uint32_t numOfDevice = Utility::getInput("How many devices do you want to update? (0~%u)", numOfActivated); if (0 < numOfDevice) { for (uint32_t idx = 0; idx < numOfDevice; idx++) { BS2OsdpStandardDeviceUpdate item = { 0, }; item.deviceID = (BS2_DEVICE_ID)Utility::getInput("[%u] Please enter the slave ID to be updated.", idx + 1); if (!ConfigControl::getOsdpID(config, item.deviceID, item.osdpID)) { cout << "The OSDP ID could not be found." << endl; return BS_SDK_ERROR_INTERNAL; } if (Utility::isYes("Do you want to change the OSDP ID? (CurrentID: %u)", item.osdpID)) { item.osdpID = (uint8_t)Utility::getInput("Please enter the OSDP ID. [0 ~ 126]"); } item.activate = Utility::isYes("Do you like to enable the OSDP device?"); item.useSecureSession = Utility::isYes("Does the OSDP device use secure communication?"); item.deviceType = BS2_DEVICE_TYPE_3RD_OSDP_DEVICE; updateData.push_back(item); } vector listResult; BS2OsdpStandardDeviceResult* outResultObj = NULL; uint32_t outNumOfResult(0); int sdkResult = BS2_UpdateOsdpStandardDevice(context_, id, const_cast(updateData.data()), updateData.size(), &outResultObj, &outNumOfResult); if (BS_SDK_SUCCESS != sdkResult) { printf("BS2_UpdateOsdpStandardDevice call failed: %d", sdkResult); } if (outResultObj) { listResult.clear(); for (uint32_t idx = 0; idx < outNumOfResult; idx++) { listResult.push_back(outResultObj[idx]); } BS2_ReleaseObject(outResultObj); } } return sdkResult;