BS2OsdpStandardDeviceAvailable availDevice = { 0, }; BS2OsdpStandardDeviceAdd addDevice = { 0, }; BS2_DEVICE_ID masterID = Utility::selectDeviceID(deviceList, false, false); cout << "Now add a OSDP device." << endl; addDevice.deviceID = Utility::selectSlaveID(); uint32_t channelIndex = 0; for (int idx = 0; idx < availDevice.numOfChannel; idx++) { for (int didx = 0; didx < availDevice.channels[idx].numOsdpAvailableDevice; didx++) { if (availDevice.channels[idx].deviceIDs[didx] == addDevice.deviceID) channelIndex = availDevice.channels[idx].channelIndex; } } addDevice.osdpID = (uint8_t)Utility::getInput("Please enter the OSDP ID. [0 ~ 126]"); addDevice.useSecureSession = Utility::isYes("Does the OSDP device use secure communication?"); addDevice.deviceType = BS2_DEVICE_TYPE_3RD_OSDP_DEVICE; addDevice.activate = 1; uint32_t outChannelIndex(0); int sdkResult = BS2_AddOsdpStandardDevice(context_, masterID, channelIndex, &addDevice, &outChannelIndex); if (BS_SDK_SUCCESS != sdkResult) printf("BS2_AddOsdpStandardDevice call failed: %d", sdkResult); return sdkResult;