中文简体    English


Notes:What is required in the remarks is the interface that must be called or implemented to use SDK.

Click to download SDK

1.Introduction

The IVY SDK is developed based on IVY-IoT’s private network communication protocol. It is designed for third-party IPC / NVR equipment manufacturers to quickly access the IVY IOT system. It mainly runs on the embedded Linux platform. Provide users with APP interaction, cloud storage, P2P transmission and other functions.

The interface provided by IVY SDK to users is divided into two types. One type is used by users to actively call to operate the SDK and push audio and video data and report event notifications such as alarm messages. This type of interface is provided in the form of a header file. Called when the user uses; the other type is similar to the callback method, which is called by the SDK to get the status information from the device and set the corresponding parameters. This type of interface provides the interface declaration in the SDK. The specific implementation requires the user to complete.

2.Interface Description

2.1.Get sdk information

definition IVY_CODE IvyGetSdkInfo(IvySdkInfo_t *sdkInfo);
description Get SDK information(version…)
parameter sdkInfo –sdk Information structure pointer.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE, refer to Error code definition
notes optional

2.2.Init IVY SDK

definition IVY_CODE IvySdkInit(const IvySdkEnvVar_t* sdkEnvVar);
description Init IVY SDK.
parameter sdkEnvVar–SDK environment variable structure pointer, refer to IvySdkEnvVar_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes required

2.3.Report local IPC information

definition IVY_CODE IvyReportIpcList(IvyIpcConnectInfo_t *ipcConnectInfo, int32_t size);
description Report the locally searched IPC device information to the SDK so that the SDK can notify the app of the device list, which is used by the NVR
parameter ipcConnectInfo–IPC connection status info structure pointer, refer to IvyIpcConnectInfo_t
size–IPC num
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes for NVR

2.4.Send live audio or video data

definition IVY_CODE IvyWriteFrameData(IvyFrame_t* frame);
description Send audio or video frame data to SDK.
parameter AV data structure pointer, refer to IvyFrame_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes required

2.5.Send playback audio or video data

definition IVY_CODE IvyWriteRecordPlayData(IvyFrame_t* frame);
description Send playback audio or video frame data to SDK.
parameter frame–AV playback data structure pointer, refer to IvyFrame_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes optional

2.6.Push alarm message

definition IVY_CODE IvyAlarmMsgPush(const IvyAlarmMsg_t *ivyAlarmMsg);
description Push alarm message to ivy cloud.
parameter ivyAlarmMsg–Alarm message structure pointer, refer to IvyAlarmMsg_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes optional

2.7.Report device status

definition IVY_CODE IvyReportDevStateInfo(IvyDevStateEvent_e eventType, IvyDevState_t devStateInfo);
description Report device status information to client.
parameter eventType–status event Type, refer to IvyDevStrateEvent_e
devStateInfo–status event Type, refer to IvyDevStrateEvent_e
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes optional

2.8.Get P2P Info

definition IVY_CODE IvyGetUserP2PInfo(IvyP2pInfo_t *p2pInfo);
description Get P2P info from IVY sdk, such as UID.
parameter p2pInfo–P2P info structure pointer, refer to IvyP2pInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.9.Get P2P Connect Status

definition IVY_CODE IvyGetP2PConnectStatus(IvyP2PStatus_t *p2pStatus);
description Get P2P connect status(whether to connect to the server).
parameter p2pStatus–P2P Connection status information pointer, refer to IvyP2PStatus_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.10.Key reset

definition IVY_CODE IvyKeyReset(void);
description Reset sdk,Used when the reset key are restored to factory settings,Will restore the configuration in the SDK to the default.
parameter none
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.11.Cloud storage init

definition IVY_CODE IvyRtmpInit(IvyCloudEnv cloudEnv);
description cloud storge init, init rtmp.
parameter cloudEnv–Cloud storage information initialization information structure, refer to cloudEnv
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.12.Start cloud storage

definition IVY_CODE IvyAlarmCloudRecordStart(IvyRtmpAlarmMsg_t alarmMsg);
description Alarm triggered to start cloud storage
parameter alarmMsg–Alarm information structure variable, refer to IvyRtmpAlarmMsg_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.13.Stop cloud storage

definition IVY_CODE IvyAlarmCloudRecordStop(IvyRtmpAlarmMsg_t alarmMsg);
description Cloud recording time up, stop cloud storage
parameter alarmMsg–Alarm information structure variable, refer to IvyRtmpAlarmMsg_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.14.Analyze sonic information

definition IVY_CODE IvyWaveLinkDecodeWifiInfo(char *srcValue, char *desValue);
description Analyze WIFI information of sonic distribution network.
parameter srcValue–original data
desValue–parsed data
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.15.Change user account info

definition IVY_CODE IvyChangeUserInfo(IvyUserAccountInfo_t oldAccountInfo, IvyUserAccountInfo_t newAccountInfo);
description Change user accout info, Used for local user information and sdk synchronization, not used if not.
parameter oldAccountInfo–Current user account info, refer to IvyUserAccountInfo_t
newAccountInfo–new user account info, refer to IvyUserAccountInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

2.16.Get factory user account info

definition IVY_CODE IvyGetFactoryUsrAccount(char *usrName, char *password);
description Get factory user account info,Used to synchronize user info managed by a third party, Such as NVR third-party login.
parameter usrName–user account name
password–user account password
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.User implementation interface

3.1.System Management

3.1.1.Device info

definition IVY_CODE IvyGetDevInfo(uint8_t channel, IvyDevInfo_t *devInfo);
description Get device information.
parameter devInfo–device info pointer, refer to IvyDevInfo_t
Channel–channel number, 225 Represents the master device, for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes required

3.1.2.Device abilities

definition IVY_CODE IvyGetDevAbilities(uint8_t channel, int* val);
description Get Device abilities.
parameter val–device abilities pointer,See code comments for details.
Channel–channel number, 225 Represents the master device, for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes required

3.1.3.Log info

definition IVY_CODE IvyGetLogInfo(IvyLogInfo_t logGetInfo, IvyLogResultInfo_t *logResultInfo)
description Get log info,Not used yet.
parameter logResultInfo–log info Input parameters.
logGetInfo–log info result
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes for NVR

3.1.5.User account management

definition IVY_CODE IvyGetUserList(IvyUserAccountInfo_t *userAccountInfo, int32_t buffLen);
description Get user list information,Not used yet.
parameter userAccountInfo–user account info storge pointer
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes Not used yet.
definition IVY_CODE IvyAddAccount(IvyUserAccountInfo_t userAccountInfo);
description Add account, Not used yet.
parameter userAccountInfo–user account info
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes Not used yet.
definition IVY_CODE IvyDelAccount(IvyUserAccountInfo_t userAccountInfo);
description Delete user Account, Not used yet.
parameter userAccountInfo–user account info
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes Not used yet.
definition IVY_CODE IvyChangeAccount(IvyUserAccountInfo_t oldAccountInfo, IvyUserAccountInfo_t newAccountInfo);
description Change user account info, Not used yet.
parameter oldAccountInfo–current user account info
newAccountInfo–new user account info
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes Not used yet.
definition IVY_CODE IvyAuthenticate(IvyUserAccountInfo_t userAccountInfo)
description Account information authentication,Not used yet.
parameter userAccountInfo–user logged in information
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes Not used yet.
definition IVY_CODE IvyUsrLogIn(void);
description User login,report necessary status information, such as NVR report IPC list.
parameter none
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none
definition IVY_CODE IvyUsrLogout(int onLineUsrNum)
description User logout,stop necessary user actions.
parameter onLineUsrNum–Oline client number, 0 means all users have logged out.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.1.6.System upgrade

Notes: SDK Download the upgrade package, Third-party users implement upgrade functions.

definition IVY_CODE IvyOnlineUpgradeStart();
description Start online upgrade,Need to release some memory to temporarily store firmware.
parameter none
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none
definition IVY_CODE IvyUpgrade(uint32_t bitCh, const uint8_t *fileName)
description Firmware download completed,start upgrade.
parameter bitCh–Channels that need to be upgraded, 0:master device ,bit0:ch0, bit1:ch1 …
fileName–Firmware name,Include full path.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none
definition IVY_CODE IvySetOnlineUpgradeUrl(IvyFirmwareDownloadInfo_t downloadInfo);
description Set download link for online firmware upgrade,Applicable to third-party download and upgrade,Such as 4G module upgrade.
parameter downloadInfo–Download information.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes

3.1.7.System maintenance

definition IVY_CODE IvyRebootSystem()
description Reboot the device.
parameter none
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none
definition IvyResetSystem()
description Reset device configs to defaut.
parameter none
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none
definition IVY_CODE IvySetMaintainConfig(IvyMaintainConfig_t maintainConfig)
description Configure automatic restart device parameters,Not used yet.
parameter maintainConfig–automatic restart parameters
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes for NVR

3.1.8.Burn MAC address

definition IVY_CODE IvySetMacAddr(IvyMacAddrInfo_t macAddr)
description Burn MAC address information, used in production.
parameter macAddr–MAC address information
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.Basic settings

3.2.1.System time

definition IVY_CODE IvySetSystemTime(IvySystemTimeInfo_t systemTimeInfo)
description Set system time. The incoming time is in the format of year, month, day, hour, minute, and second converted from UTC time.
parameter systemTimeInfo–time info,refer to IvySystemTimeInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes required

3.2.2.Network settings

definition IVY_CODE IvySetNetParam(uint8_t channel, IvyNetParam_t netParam)
description Set network parameters.
parameter netParam–Network parameter,refer to IvyNetParam_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.3.Get Network param

definition IVY_CODE IvyGetNetParam(uint8_t channel, IvyNetParam_t netParam)
description Get network parameters.
parameter netParam–Network parameter,refer to IvyNetParam_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes required

3.2.4.WIFI configuration

definition IVY_CODE IvySetWifiParam(uint8_t channel, IvyWifiParam_t wifiParam)
description Set WIFI param.
parameter wifiParam–wifi param structure variable,refer to IvyWifiParam_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.5.Get wifi list

definition IVY_CODE IvyGetWifiAPList(uint8_t channel, IvyWifiListGetMsg_t wifiListGetMsg, IvyWifiListResultMsg_t* pWifiListInfo)
description Get wifi list, return search results.
parameter wifiListGetMsg–wifi get param, refer to IvyWifiListGetMsg_t
pWifiListInfo–wifi list info, refer to IvyWifiListResultMsg_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.6.Set AP info

definition IVY_CODE IvySetWifiSoftApInfo(uint8_t channel, IvySoftApInfo_t apInfo)
description Used to set hotspot information in wifi AP mode.
parameter apInfo–ap info, refer to IvySoftApInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.7.Video encoding parameter settings

definition IVY_CODE IvySetVideoParam(uint8_t channel, IvyVideoParam_t pVideoInfo)
description Set video encode params.
parameter pVideoInfo–video encode param info,refer to IvyVideoParam_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.8.Video stream mode setting

definition IVY_CODE IvySetVideoStreamMode(uint8_t channel, IvyVideoStreamMode_t streamMode)
description Set video strem mode(HD,SD…).
parameter streamMode–strem mode,refer to IvyVideoStreamMode_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.9.Image parameter setting

definition IVY_CODE IvySetImageParam(uint8_t channel, IvyImageParam_t pImageInfo)
description Set image parameter.
parameter pImageInfo–image param info,refer to IvyImageParam_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.10.Video mirroring flip mode setting

definition IVY_CODE IvySetVideoMirrorFlip(uint8_t channel, IvyMirrorFlip_t pMirrorFlipInfo)
description Set mirror,flip mode.
parameter pMirrorFlipInfo–mirror,flip info, refer to IvyMirrorFlip_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.11.Day and night vision switching mode settings

definition IVY_CODE IvySetDayNightMode(uint8_t channel, IvyDayNight_t dayNight)
description Set infrared light mode, night vision switch
parameter dayNight–day night mode info,refer to IvyDayNight_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.12.Night vision plan configuration

definition IVY_CODE IvySetNightVisonScheduleConfig(uint8_t channel, IvyNightVisionSchedule_t nightVisionConfig)
description Set night vision plan configuration parameters.
parameter nightVisionConfig–night vision plan config info,refer to IvyNightVisionSchedule_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.13.Environment mode setting

definition IVY_CODE IvySetEnvironmentMode(uint8_t channel, IvyEnvironmentMode_t environmentMode)
description Set Power frequency,indoor,outdoor mode
parameter environmentMode–environment mode,refer to IvyEnvironmentMode_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.14.OSD information configuration

definition IVY_CODE IvySetOsdConfig(uint8_t channel, IvyOsdConfig_t osdConfig)
description Set OSD configuration info.
parameter osdConfig–osd configuration info,refer to IvyOsdConfig_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.15.Volume setting

definition IVY_CODE IvySetAudioVolume(uint8_t channel, IvyVolume_t volume)
description Set Audio volume.
parameter volume–volume param,refer to IvyVolume_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.16.Set indicator light state

definition IVY_CODE IvySetLedEnableState(uint8_t channel, int isEnable)
description Set indicator light on/off status.
parameter isEnable–light status. off:0 on:1
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.2.17.Set prompt tone status

definition IVY_CODE IvySetVoiceEnableState(uint8_t channel, int isEnable)
description Set the prompt tone status.
parameter isEnable–prompt tone switch, off:0, on:1
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.3.Alarm setting

3.3.1.Motion alarm setting

definition IVY_CODE IvySetMotionAlarmCfg(uint8_t channel, IvyMotionAlarmCfg_t motionAlarmCfg)
description Set motion alarm configuartion info,Whether to support regional settings according to capability set val0 bit[14].
parameter motionAlarmCfg–motion alarm configuartion info, refer to IvyMotionAlarmCfg_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.3.2.Abnormal alarm switch setting

definition IVY_CODE IvySetAlarmExInfo(IvyAlarmEx_t alarmEx)
description Set abnormal alarm switch status, not use yet.
parameter alarmEx–abormal alarm switch info, refer to IvyAlarmEx_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.Record

3.4.1.Record type setting

definition IVY_CODE IvySetRecordTypeInfo(uint8_t channel, IvyRecordType_t recordType)
description Set record type info, not use yet.
parameter recordType–record type info, refer to IvyRecordType_t
channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.2.Record storage setting

definition IVY_CODE IvySetStorageConfig(IvyStorageInfo_t storageInfo)
description Set record storage configuration info, for NVR yet.
parameter storageInfo–storage configuration info, refer to IvyStorageInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.3.Record search

definition IVY_CODE IvyGetRecordList(IvyRecordSearchMsg_t recordSearchMsg, IvyRecordListResultInfo_t* pRecordListInfo)
description Get record file list, Get multiple files when there are too many files.
parameter recordSearchMsg–search info,input param,refer to IvyRecordSearchMsg_t
pRecordListInfo–record file list result,refer to IvyRecordListResultInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.4.Record playback control

definition IVY_CODE IvyRecordPlayBackCtrl(IvyPlayBackCtrlMsg_t ctrlMsg)
description Record playback control.
parameter ctrlMsg–record playback control msg,refer to IvyPlayBackCtrlMsg_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.5.Get Disk information

definition IVY_CODE IvyGetDiskInfo(IvyDiskInfo_t *diskInfo, int32_t buffLen)
description Get Disk information ,for NVR.
parameter diskInfo-disk information structure pointer, refer to IvyDiskInfo_t
buffLen–buffer length
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.6.Disk format

definition IVY_CODE IvyFormatDisk(int32_t diskIndex)
description format disk.
parameter diskIndex–the disk index to format
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.7.Get SD card info

definition IVY_CODE IvyGetSDCardInfo(IvySDCardInfo_t* sdCardInfo)
description Get SD card capacity information.
parameter sdCardInfo–card information, refer to IvySDCardInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.4.8.SD card format

definition IVY_CODE IvyFormatSDCard(void)
description format SD card.
parameter none
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.Media operations

3.5.1.Open video

definition IVY_CODE IvyOpenVideo(uint8_t channel, uint8_t streamType)
description open live video
parameter streamType–stream type, main/sub stream
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.2.Close video

definition IVY_CODE IvyCloseVideo(uint8_t channel, uint8_t streamType)
description close live video.
parameter streamType–stream type, main/sub stream
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.3.Open audio

definition IVY_CODE IvyOpenAudio(uint8_t channel, uint8_t streamType)
description open live audio.
parameter streamType–stream type, main/sub stream, default main or not use.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.4.Close audio

definition IVY_CODE IvyCloseAudio(uint8_t channel, uint8_t streamType)
description close audio
parameter streamType–stream type, main/sub stream,default main or not use.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.5.Open talk

definition IVY_CODE IvyOpenTalk(uint8_t channel)
description Open audio talk.
parameter channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.6.Close talk

definition IVY_CODE IvyCloseTalk(uint8_t channel)
description Close audio talk.
parameter channel–The channel id of the IPC to be set,for NVR
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.7.Send talk data

definition IVY_CODE IvySendTalkData(uint8_t channel, IvyTalkFrame_t * talkFrame)
description Send talk data to IPC device, for NVR.
parameter none
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.8.Snap picture

definition IVY_CODE IvySnapPicture(uint8_t channel, char *fileName)
description Snap picture, for rich media push.
parameter fileName–picture name,include full path.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.5.9.Requset Key Frame

definition IVY_CODE IvyRequestKeyFrame(uint8_t channel, int streamType)
description Force I frame, for quick live video or cloud storage.
parameter streamType–video stream type
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.6. 4G

3.6.1.4G Info

definition IVY_CODE IvyGet4GInfo(Ivy4GInfo_t *p4GInfo)
description Get 4G Information
parameter p4GInfo–4G info structure pointer, refer to Ivy4GInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.6.2.4G Version

definition IVY_CODE IvyGet4GVerInfo(Ivy4GVerInfo_t* verInfo)
description Get 4G Version Info.
parameter verInfo–version info tructure pointer, refer to Ivy4GVerInfo_t
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.7.IPC device manage

3.7.1.Add IPC(NVR)

definition IVY_CODE IvyAddIPC(IvyIpcConnectInfo_t ipcConnectInfo)
description Add IPC to channel, for NVR, not use yet.
parameter ipcConnectInfo
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

3.7.2.Remove IPC(NVR)

definition IVY_CODE IvyDelIPC(int32_t channel)
description Release IPC device form NVR channel, not use yet.
parameter channel–IPC channel to release.
return value success–IVY_CODE_SUCESS
failure–other IVY_CODE,refer to Error code definition
notes none

4.Data structure definition

4.1.SDK environment variable

typedef struct IvySdkEnvVar{
    int8_t devType; 
    /**< device type,0:ipc,1:bpi,2:nvr,3:station,4:doorbell;refer to          IvyDevType_e*/
    int8_t storagePath[SDK_STORAGE_PATH_LEN + 1];
    /**< IVY SDK configuration file storage path,Requires read and write, no loss when power off */
    int8_t productKey[SDK_PRODUCT_KEY_LEN + 1]; 
    /**< product key, Not in use */
    int8_t uuid[SDK_UUID_LEN + 1]; 
    /**< P2P UID,Not in use, get from config */
    int8_t authKey[SDK_AUTH_KEY_LEN + 1]; 
    /**< IVY SDK auth_key,Not in use */
    int8_t devSwVersion[SDK_SW_VER_LEN + 1];
     /**< firmware version,Not in use */
    int8_t devSerialNum[SDK_SERIAL_NUM_LEN + 1]; 
    /**< serial number,Not in use */
    int8_t maxChannels; 
    /**< Maximum number of supported channels,for NVR*/
    int32_t liveRingBufSize;
    /**< live video ringbuffer,must be a multiple of 4096 */
    int32_t pbRingBufSize;
    /**< play back ringbuffer,must be a multiple of 4096 */    
}IvySdkEnvVar_t;

4.2.IPC connection status

typedef struct IvyIpcConnectInfo{
    int32_t  channel;                           /* channel ID */
    int32_t  enable;                            /* is occupied */
    int32_t  isOnLine;                          /* whether online */
    int32_t  devType;                           /* device type*/
    int32_t  protocols;                         /* supported protocols,reserve */
    int32_t  protocol;                          /* protocol,reserve */
    int8_t ip[ARRAY_STR_LEN];                   /* ip addr */
    int8_t devName[ARRAY_STR_LEN];              /* device name */
    int8_t macAddr[ARRAY_STR_LEN];              /* mac addr */
    int8_t xAddr[ADDR_STR_LEN];                 /* reserve */
    int8_t mask[ARRAY_STR_LEN];                 /* reserve */
    int8_t gate[ARRAY_STR_LEN];                 /* reserve */
    int8_t dns[ARRAY_STR_LEN];                  /* reserve */
    int8_t appVer[ARRAY_STR_LEN];               /* app firmware version */
    int8_t sysVer[ARRAY_STR_LEN];               /* system version */
}IvyIpcConnectInfo_t;

4.3.Video information

typedef struct IvyVideoHead {
    int16_t  width;
    int16_t  height;
    int32_t  fps;       /* frame rate */
    int32_t  bps;       /* bit rate */
} IvyVideoHead_t;

4.4.Audio information

typedef struct IvyAudioHead{
    uint32_t  sampleRate;
    uint32_t  bitsPerSample;
}  IvyAudioHead_t;

4.5.AV frame information

typedef struct IvyFrame{
    IvyFrameType_e frameType;
    IvyStreamType_e streamType;
    IvyCodecType_e encodeType;
    int32_t frameNo;
    int8_t channel;           /* channel, just for NVR */
    int32_t dataLen;          /* data len */
    long long pts;
    union {
        IvyVideoHead_t video;
        IvyAudioHead_t audio;
    };
    int8_t  reserved[3];
    int8_t  data[0];          /* data addr */
}IvyFrame_t;

4.6.Device information

typedef struct IvyDevInfo {
    IvyDevType_e devType;               /*device type, refer to IvyDevType_e*/
    IvyPlatformType_e PlatformType;
    IvySensorType_e sensorType;
    IvyWifiType_e wifiType;
    IvyLanguageType_e language;
    int8_t productName[32];
    int8_t devName[64];
    int8_t firmwareVersion[64];
    int8_t hardwareVersion[64];
    int8_t serialNo[32];
    int8_t uid[64];
    int8_t mac[32];
    int8_t manufacturerKey[64];
    int32_t maxCh;
    int32_t status;    //bit0:isReset
}IvyDevInfo_t;

4.7.P2P information

typedef struct IvyP2pInfo {
    int8_t isEnable;    //0:disable 1:enable
    int8_t uid[32];
}ATTRIBUTE_PACKED IvyP2pInfo_t;

4.8.P2P connection status information

typedef struct IvyP2PStatus {
    IvyP2PConnectStatus_e connectStatus;
} IvyP2PStatus_t;

4.9.Disk partition information

typedef struct IvyDiskPartition {
    IvyDiskFileSys_e      fsType;
    int8_t        label[64];
    int8_t        mntDir[MNT_DIR_LEN];
}IvyDiskPartition_t;

4.10.Disk information

typedef struct tagDiskInfo {
    IvyDiskBusType_e    busType;
    int32_t             busId;
    IvyDiskType_e       diskType;
    int32_t             diskIndex;
    bool                isFormated;
    bool                canFormatToSTFS;
    bool                bBusy;
    int8_t                 name[32];
    uint32_t            freeSpace;//KB
    uint32_t            totalSpace;//KB
    IvyDiskPartition_t  partitions[MAX_PARTITION_NUM];
}IvyDiskInfo_t;

4.11.Store configuration information

typedef struct IvyStorageInfo {
    int32_t  channelNum;
    int32_t  diskNum;
    bool bCycleRec;
    int32_t bPrepare;
    IvySmartRecMode_e srMode;
}IvyStorageInfo_t;

4.12.System time information

typedef struct IvySystemTimeInfo {
    int32_t year;
    int32_t month;
    int32_t day;
    int32_t hour;
    int32_t min;
    int32_t sec;
    int32_t timeZone;        /*time zone timestamp,GMT+8:00 is -28880 */
    int32_t  timeSource;     /*0=NTP 1=Manual*/
    int8_t ntpServer[64]; 
    int32_t  dateFormat;     /*0=YYYY-MM-DD 1=DD/MM/YYYY 2=MM/DD/YYYY */
    int32_t  timeFormat;     /*0=24 1=12 */
    int32_t isDst;
    int32_t Dst;
    int32_t hasStartDST;
    int32_t dstStartMonth;//[1,12]
    int32_t dstStartWhichOne;//[1-5]
    int32_t dstStartWhichWeek;//[1-7]
    int32_t dstStartHour;//[0,23]
    int32_t dstEndMonth;
    int32_t dstEndWhichOne;
    int32_t dstEndWhichWeek;
    int32_t dstEndHour;
}IvySystemTimeInfo_t;

4.13.Network param

typedef struct IvyNetParam {
    bool isDHCP;
    uint8_t netType;//0:Ethernet  1:wifi
    int8_t ip[64];
    int8_t mask[64];
    int8_t gate[64];
    int8_t dns1[64];
    int8_t dns2[64];
}IvyNetParam_t;

4.14.WIFI param information

typedef struct IvyWifiParam {
    int8_t ssid[32];        // WiFi ssid
    int8_t password[64];    // if exist, WiFi password
    uint8_t mode;            // refer to IvyApMode_e
    uint8_t encType;        // refer to IvyEncryptedType_e
    uint8_t authMode;         // refer to IvyAuthMode_e 0=Open 1=SHARED 2=WEPAUTO  (For wep mode)
    uint8_t reserved[10];
} IvyWifiParam_t;

4.15.WIFI list start information

typedef struct IvyWifiListGetMsg {
    int startNo;
    int cnt;
} IvyWifiListGetMsg_t;

4.16.WIFI list information

typedef struct tagWifiListResultMsg {
    int totalCnt;
    int curCnt;
    IvyWifiAPInfo_t ap[MAX_AP_COUNT];
} IvyWifiListResultMsg_t;

4.17.AP information

typedef struct IvySoftApInfo {
    char ssid[32];
    int authMode;        // 0=OPEN 1=WPAPSK 2=WPA2PSK, default:2
    char psk[64];        // WPA/WPA2's PSK
}  IvySoftApInfo_t;

4.18.Video encode param

typedef struct IvyVideoStreamParam {
    IvyCodecType_e codecType;
    IvyStreamType_e streamType;
    IvyResolution_e resolution;
    uint32_t bitRate;
    uint32_t frameRate;
    uint32_t GOP;
    uint8_t rateControlMode;
    uint32_t lbrRatio;
    uint8_t reserve;
}IvyVideoParam_t;

4.19.Video stream mode

typedef struct IvyVideoStreamMode {
    IvyStreamMode_e streamMode;
    uint8_t reserve;
} IvyVideoStreamMode_t;

4.20.Image param

typedef struct IvyImageParam {
    uint32_t brightness; 
    uint32_t contrast;   
    uint32_t hue;        
    uint32_t saturation; 
    uint32_t sharpness;  
    uint32_t denoiseLevel; 
}IvyImageParam_t;

4.21.MirrorFlip type

typedef struct IvyMirrorFlip {
    uint8_t mode;        //IvyMirrorFlip_e
    uint8_t reserved[3];
}IvyMirrorFlip_t;

4.22.Record type

typedef struct IvyRecordType{
    int16_t recordType; // bit0:schedule, bit1:manual, bit2: motion detect, bit3:sound, bit4: io, bit5:tempeture, bit6:humidity, bit7:human
    uint8_t reserved[3];
}IvyRecordType_t;

4.23.Device abnormal alarm

typedef struct IvyAlarmEx {
    int32_t hddLost;
    int32_t hddFull;
    int32_t hddErr;
    int32_t videoLoss;
    int32_t networkErr;
}IvyAlarmEx_t;

4.24.Motion detection configuration

typedef struct IvyMotionAlarmCfg {
    int8_t isEnable;
    int8_t linkage; /*bit0:Ring;bit1:Send mail;bit2:Snap picture;bit3:Record;bit4:IO out;bit5:Snap to cloud;bit6:Record to cloud;bit7:Push message to the phone( bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 )*/
    uint32_t snapInterval;
    uint32_t triggerInterval; // seconds
    uint32_t isMovAlarmEnable;
    uint32_t isPirAlarmEnable;
    long long schedule[7];    /*Means 7 days a week,Each element is a longlong type number,bit0-bit47 means one day,Each bit means half an hour,bit0 means 0:00-0:30,and so on*/
    uint32_t maxArea;        /*Non-lattice area use,Maximum supportable area,Return from the board*/
    IvyArea_t area[MAX_MD_ROI_N];/*Non-lattice area use*/
    int8_t sensitivity;        /*Use the grid 0:low,1:medium,2:High ;default:1*/
    int areaMap[18];        /*Use the grid(18 columns and 22 rows)*/
}ATTRIBUTE_PACKED IvyMotionAlarmCfg_t;
typedef struct IvyArea {
    int32_t x;
    int32_t y;
    int32_t width;
    int32_t height;
    int8_t sensitivity;        /*0:low,1:medium,2:High ;default:1*/
    int8_t isEnable;
} IvyArea_t;

4.25.Day night mode

typedef struct IvyDayNight {
    uint32_t mode;    // 0-auto,  1-manul ,2-schedule 
    uint32_t onoff;    // 0-off, 1-on, when get not use, only be used to manul
} IvyDayNight_t;

4.26.Night vision plan configuration information

typedef struct IvyNightVisionScheduleConfig {
    int startTimeHour;
    int startTimeMin;
    int endTimeHour;
    int endTimeMin;
}  IvyNightVisionScheduleConfig_t;

typedef struct IvyScheduleNightVision{
    IvyNightVisionScheduleConfig_t NightVisionscheduleConfig[3];
}  IvyNightVisionSchedule_t;

4.27.Push Alarm message

typedef struct IvyAlarmMsg{
    uint8_t channel;
    IvyAlarmMsgType_e alarmType;
    char mac[16];
    char name[128];//devName
    unsigned int  cfgAlarmType;
} IvyAlarmMsg_t;

4.28.Device status information

typedef struct IvyDevState {
    uint8_t channel;
    IvyMirrorFlip_t mirrorFlip;
    IvyDayNight_t dayNight;
    IvyVideoStreamMode_t streamMode;
}  IvyDevState_t;

4.29.Cloud storage init information

typedef struct CloudEnv {
    int8_t channel;                         /* IPC channel */
    int8_t streamType;                        /* 0:main 1:sub */
    int8_t configPath[128];
    STATUS_NOTIFY_CB status_notify_cb;      /* cloud server connect information */
} IvyCloudEnv;

4.30.Cloud storage alarm information

typedef struct IvyRtmpAlarmMsg{
    int8_t alarmType;
    int8_t audioEnable;
    union {
        int64_t startVFramePts;
        int64_t endVFramePts;
    }Pts;
} IvyRtmpAlarmMsg_t;

4.31.Environment mode

typedef struct IvyEnvironmentMode{
    uint8_t mode;            // refer to IvyEnvironmentMode_e
    uint8_t reserved[3];
} IvyEnvironmentMode_t;

4.32.OSD configuration information

typedef struct tagIvyOsdConfig {
    int osdType;//bit0:time, bit1:devName, bit2:TempAndHumid, bit3:OSDMask
    int dispPos;//0=topLeft 1=bottomLeft 2=topRight 3=bottomRight
} IvyOsdConfig_t;

4.33.Volume information

typedef struct IvyVolume {
    uint8_t value;        
} IvyVolume_t;

4.34.User account information

typedef struct IvyUserAccountInfo {
    int8_t userName[64];
    int8_t password[64];
} IvyUserAccountInfo_t;

4.35.4G information

typedef struct Ivy4GInfo {
    int  simState;            //0:not insert    1:inserted
    int  simType;            //0:INVALID 1:TELECOM 2:CMCC 3:UNICOM    
    char phoneNumber[16];
    char IMEINumber[24];
    char ICCIDNumber[24];
    char IMSINumber[24];
    int  Operators;            
    int  rssi;                //0~31
    int  signalLevel;        //0~5
    int  ratType;             //0:INVALID, 1:1G, 2:2G, 3:3G, 4:4G
} Ivy4GInfo_t;

4.36.4G version information

typedef struct Ivy4GVerInfo{
    char softwareVer[12];
} Ivy4GVerInfo_t;

4.37.Record search information

typedef struct IvyRecordSearchMsg {
    long long    sTime;    /*IvyRecordType_e bit0:MANUAL bit1:SCHEDULE bit2:MDALARM bit3:SDALARM bit4:IOALARM bit5:TDALARM bit6:HDALARM bit7:HMDALARM bit8:KEYALARM*/
    long long    eTime;
    int        chn;
    int        type;//IvyRecordType_e bit0:MANUAL bit1:SCHEDULE bit2:MDALARM bit3:SDALARM bit4:IOALARM bit5:TDALARM bit6:HDALARM bit7:HMDALARM bit8:KEYALARM
    uint32_t startNo;        /* start number */
    uint32_t cnt;         /* Number of queries */
}  IvyRecordSearchMsg_t;

4.38.Record list information

typedef struct IvyRecordListResultInfo {
    uint32_t totalCnt;    /* Total number of record files */
    uint32_t curCnt;    /* current number */
    IvyRecordIndexInfo_t list[MAX_RECORD_CNT];
}  IvyRecordListResultInfo_t;
typedef struct IvyRecordIndexInfo {
    char    channel;
    long long sTime;
    long long eTime;
    uint32_t type;//IvyRecordType_e
}  IvyRecordIndexInfo_t;

4.39.Record play control

typedef struct IvyPlayBackCtrlMsg{
    long long    sTime;
    long long    eTime;
    long long    seekTime;
    int     cmd;    //IvyPlayControl_e
    int        chn;
    int        type;     //record type
}  IvyPlayBackCtrlMsg_t;

4.40.SD card information

typedef structIvySDCardState {
    char isExist;
    long long freeSpace;
    long long totalSpace;
}  IvySDCardInfo_t;

5.Enumeration definition

5.1.Audio bitwidth

typedef enum
{
   IVY_AUDIO_BITWIDTH_4   = 4,
   IVY_AUDIO_BITWIDTH_8   = 8,
   IVY_AUDIO_BITWIDTH_16  = 16,
   IVY_AUDIO_BITWIDTH_24  = 24,
   IVY_AUDIO_BITWIDTH_NUM,
} IvyAudioBitWidth_e;

5.2.Sound mode

typedef enum 
{
   IVY_AUDIO_SOUND_MODE_MONO      = 0,
   IVY_AUDIO_SOUND_MODE_STEREO,
   IVY_AUDIO_SOUND_MODE_NUM
} IvyAudioSoundMode_e;

5.3.Sample rate

typedef enum 
{
   IVY_AUDIO_SAMPLE_RATE_8000   = 8000,
   IVY_AUDIO_SAMPLE_RATE_12000  = 12000,
   IVY_AUDIO_SAMPLE_RATE_11025  = 11025,
   IVY_AUDIO_SAMPLE_RATE_16000  = 16000,
   IVY_AUDIO_SAMPLE_RATE_22050  = 22050,
   IVY_AUDIO_SAMPLE_RATE_24000  = 24000,
   IVY_AUDIO_SAMPLE_RATE_32000  = 32000,
   IVY_AUDIO_SAMPLE_RATE_44100  = 44100,
   IVY_AUDIO_SAMPLE_RATE_48000  = 48000,
   IVY_AUDIO_SAMPLE_RATE_NUM,
} IvyAudioSampleRate_e;

5.4.Language

typedef enum 
{
    LANGUAGE_CN = 0,
    LANGUAGE_CNEN,
    LANGUAGE_FOREIGN,
    LANGUAGE_BUTT
} IvyLanguageType_e;

5.5.Codec type

typedef enum
 {
    IVY_CODEC_VIDEO_MPEG4 = 0,
    IVY_CODEC_VIDEO_H263,
    IVY_CODEC_VIDEO_H264,
    IVY_CODEC_VIDEO_MJPEG,
    IVY_CODEC_VIDEO_H265,
    IVY_CODEC_VIDEO_MAX = 99,
    IVY_CODEC_AUDIO_ADPCM,
    IVY_CODEC_AUDIO_PCM,
    IVY_CODEC_AUDIO_AAC_RAW,
    IVY_CODEC_AUDIO_AAC_ADTS,
    IVY_CODEC_AUDIO_AAC_LATM,
    IVY_CODEC_AUDIO_G711U,
    IVY_CODEC_AUDIO_G711A,
    IVY_CODEC_AUDIO_G726,
    IVY_CODEC_AUDIO_SPEEX,
    IVY_CODEC_AUDIO_MP3,
    IVY_CODEC_AUDIO_MAX = 199,
    IVY_CODEC_INVALID
}IvyCodecType_e;

5.6.Stream type

typedef enum
 {
    IVY_STREAM_VIDEO_MAIN = 0,
    IVY_STREAM_VIDEO_SUB,
    IVY_STREAM_VIDEO_3RD,
    IVY_STREAM_VIDEO_4TH,
    IVY_STREAM_VIDEO_MAX = 8,    
    IVY_STREAM_AUDIO,
    IVY_STREAM_AUDIO_2RD,
    IVY_STREAM_AUDIO_3RD,
    IVY_STREAM_AUDIO_4TH,
    IVY_STREAM_MAX = 16
}IvyStreamType_e;

5.7.Frame type

typedef enum IvyFrameType{
    IVY_VIDEO_PB_FRAME = 0,
    IVY_VIDEO_I_FRAME,
    IVY_VIDEO_TS_FRAME,
    IVY_AUDIO_FRAME,
    IVY_M_FRAME,
    IVY_C_FRAME,    /* switch file ctrl Frame */
    IVY_S_FRAME,        /* Seek frame, used to indicate drop all exist frame */
    IVY_E_FRAME,        /* End frame, used to indicate all file played out */
    IVY_Z_FRAME,        /* ch zero control frame */
    IVY_X_FRAME,        /* Smart record, video frame ignored */
    IVY_MEDIA_FRAME_TYPE_MAX = 16
}IvyFrameType_e;

5.8.Environment mode

typedef enum
 {
    IVY_INDOOR_60HZ     = 0x00,
    IVY_INDOOR_50HZ        = 0x01,
    IVY_OUTDOOR        = 0x02,
    IVY_NIGHT            = 0x03,
}IvyEnvironmentMode_e;

5.9.Mirror flip

typedef enum
 {
    IVY_NORMAL      = 0,
    IVY_HORFLIP      = 1,
    IVY_VERFLIP      = 2,
    IVY_HORVERFLIP    = 3,
}IvyMirrorFlip_e;

5.10.Playback control

typedef enum
 {
    IVY_RECORD_PLAY_PAUSE            = 0x00,
    IVY_RECORD_PLAY_STOP            = 0x01,
    IVY_RECORD_PLAY_STEPFORWARD    = 0x02,
    IVY_RECORD_PLAY_STEPBACKWARD    = 0x03,
    IVY_RECORD_PLAY_FORWARD        = 0x04,
    IVY_RECORD_PLAY_BACKWARD        = 0x05,
    IVY_RECORD_PLAY_SEEKTIME        = 0x06,
    IVY_RECORD_PLAY_END                = 0x07,
    IVY_RECORD_PLAY_RESUME            = 0x08,
    IVY_RECORD_PLAY_START            = 0x10,
    IVY_RECORD_PLAY_SPEED_X1          = 0x11,
    IVY_RECORD_PLAY_SPEED_X2        = 0x12,
    IVY_RECORD_PLAY_SPEED_X4        = 0x13,
    IVY_RECORD_PLAY_SPEED_X8        = 0x14,
    IVY_RECORD_PLAY_SPEED_X16       = 0x15,
    IVY_RECORD_PLAY_SPEED_X32       = 0x16,
    IVY_RECORD_PLAY_SPEED_HALF      = 0x17,    //0.5
    IVY_RECORD_PLAY_SPEED_QUARTER   = 0x18,    //0.25
    IVY_RECORD_PLAY_SPEED_EIGHTH    = 0x19,    //0.125
}IvyPlayControl_e;

5.11.Platform type

typedef enum
 {
    PLAT_TYPE_HISI        = 0,
    PLAT_TYPE_AMBA        = 1,
    PLAT_TYPE_MSTAR        = 2,
    PLAT_TYPE_INGENIC    = 3,
    PLAT_TYPE_ALLWINNER    = 4,
    PLAT_TYPE_OTHER        = 100
}IvyPlatformType_e;

5.12.Stream mode

typedef enum
{
    IVY_UHDMODE    = 0x00,
    IVY_HDMODE     = 0x01,
    IVY_SDMODE        = 0x02,
    IVY_LUMODE        = 0x03,
}IvyStreamMode_e;

5.13.Dev status event type

typedef enum
 {
    IVY_MSG_MIRROR_FLIP_CHG,
    IVY_MSG_DAY_NIGHT_MODE_CHG, 
    IVY_MSG_STREAM_MODE_CHG,
    IVY_MSG_PTZ_PRESET_CHG, 
    IVY_MSG_PTZ_CRUISE_CHG, 
    IVY_MSG_PTZ_PRESET_REACHED, 
    IVY_MSG_PTZ_CURRENT_CRUISE_MAP_STATE_CHG, 
    IVY_MSG_PTZ_EDGE_ARRIVED, 
    IVY_MSG_RECORD_FILE_PATH_NONEXIST,
    IVY_MSG_DOORBELL_CALL_STATUS,        
}IvyDevStateEvent_e;

5.14.Record type

typedef enum
{
    IVY_RECORDTYPE_OFF = 0x00,
    IVY_RECORD_TYPE_MANUAL = 1,
    IVY_RECORD_TYPE_SCHEDULE = 2,
    IVY_RECORD_TYPE_MDALARM = 4,
    IVY_RECORD_TYPE_SDALARM = 8,    
    IVY_RECORD_TYPE_IOALARM = 16,
    IVY_RECORD_TYPE_TDALARM = 32,    
    IVY_RECORD_TYPE_HDALARM = 64,    
    IVY_RECORD_TYPE_HMDALARM = 128,    
    IVY_RECORD_TYPE_KEYALARM = 256,    
}IvyRecordType_e;

6.Error code definition

typedef int IVY_CODE;     /*Execution result return value */
#define INCREMENT(x,n) (x-n) 
#define IVY_CODE_VALUE_START                 0 
#define IVY_CODE_SUCCESS         INCREMENT(IVY_CODE_VALUE_START,0)
#define IVY_CODE_COM_ERR         INCREMENT(IVY_CODE_VALUE_START,1)
#define IVY_CODE_INVALID_PARM     INCREMENT(IVY_CODE_VALUE_START,2)
#define IVY_CODE_CHANNEL_OVERSTEP INCREMENT(IVY_CODE_VALUE_START,3)
#define IVY_CODE_FORMAT_UNSUPPORT    INCREMENT(IVY_CODE_VALUE_START,15) /*Recording, formatting is not supported */
文档更新时间: 2020-06-30 19:10   作者:admin