Configure Fire and Smoke Alarm

In the actual fire detection, the fire source may be concealed or the distance is too far to be detected, so the fire alarm may failed to be triggered sometimes. To avoid the above situation, you can configure the fire and smoke alarm, which includes fire source detection and smoke detection, once the fire source or smoke is detected, the alarm will be triggered.

  • Make sure you have called NET_DVR_Init to initialize the development environment.

  • Make sure you have called NET_DVR_Login_V40 to log in to the device.

Figure 1 Programming Flow of Configuring Fire and Smoke Detection Alarm

  1. Call NET_DVR_GetSTDAbility and set dwAbilityType to "NET_DVR_GET_THERMAL_CAPABILITIES" (value: 3634) for getting the thermal capability.

    The thermal capability is returned in the message XML_ThermalCap by lpOutBuffer of NET_DVR_STD_ABILITY.

    If the node <isSupportFireDetection> is returned in the thermal capability and its value is "true", it indicates that the device supports fire ans smoke detection, and you can perform the following steps.

    Otherwise, the fire and smoke detection is not supported by the device, you should end this task.

  2. Optional: Perform one of the following operations to get configuration capability of fire and smoke detection.
  3. Optional: Perform one of the following operations to get the default or configured fire and smoke detection parameters for reference.
  4. Perform one of the following operations to set the fire and smoke detection parameters.
  5. Optional: Call NET_DVR_GetSTDAbility and set dwAbilityType to "NET_DVR_GET_EVENT_TRIGGERS_CAPABILITIES" (value: 3501) for getting the configuration capability of fire and smoke alarm linkage.

    The configuration capability of fire and smoke alarm linkage is returned in the message XML_EventTriggersCap by lpOutBuffer of NET_DVR_STD_ABILITY.

  6. Optional: Call NET_DVR_GetSTDConfig with "NET_DVR_GET_FIREDETECTION_TRIGGER" (command No.: 3638) and set lpCondBuffer of NET_DVR_STD_CONFIG to 4-byte channel No. for getting the configured or default parameters of fire and smoke alarm linkage for reference.

    The parameters of fire and smoke alarm linkage is returned in the structure NET_DVR_EVENT_TRIGGER by lpOutBuffer of NET_DVR_STD_CONFIG.

  7. Call NET_DVR_SetSTDConfig with "NET_DVR_SET_FIREDETECTION_TRIGGER" (command No.: 3639), and set lpCondBuffer and lpInBuffer of NET_DVR_STD_CONFIG to 4-byte channel No and NET_DVR_EVENT_TRIGGER, respectively, for setting fire and smoke alarm linkage.
    Note:
    • To receive the alarm in platform, the linkage action must be set to "center" (upload to center).

    • The fire and smoke detection parameters and alarm linkage can also be configured by logging in to device via web browser.

  8. Set lCommand in alarm callback function (MSGCallBack) to "COMM_FIREDETECTION_ALARM" (command No.: 0x4991) and receive fire and smoke alarm in arming mode (see Receive Alarm/Event in Arming Mode) or listening mode (see Receive Alarm/Event in Listening Mode) when alarm is triggered.

    The fire and smoke alarm details is returned in the structure NET_DVR_FIREDETECTION_ALARM.

Call NET_DVR_Logout and NET_DVR_Cleanup to log out and release the resources.