IO Command Definition

IO Command


English-IOCmd

<p>[TOC]</p> <h1>History</h1> <table> <thead> <tr> <th style="text-align: left;">Date</th> <th style="text-align: left;">Version</th> <th style="text-align: left;">Update</th> <th style="text-align: left;">Editor</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">2021/3/1</td> <td style="text-align: left;">V2.0.0</td> <td style="text-align: left;">Fist draft</td> <td style="text-align: left;">Lux</td> </tr> <tr> <td style="text-align: left;">2021/4/9</td> <td style="text-align: left;">V2.0.1</td> <td style="text-align: left;">Modify 2.38 IOTYPE_USER_IPCAM _DEVICE_SUPPORT_CLOUD _RESP = 0x800D</td> <td style="text-align: left;">Lux</td> </tr> <tr> <td style="text-align: left;">2021/6/29</td> <td style="text-align: left;">V2.0.2</td> <td style="text-align: left;">Add 2.42 Get device humanoid detection status; 2.43 Set the device humanoid detection status; 2.44 Get device night vision status; 2.45 Set device night vision status; 2.46 Get device daylight saving time status; 2.47 Set device daylight saving time status; Modify 2.7 Get device SD card event list</td> <td style="text-align: left;">Lux</td> </tr> <tr> <td style="text-align: left;">2021/11/16</td> <td style="text-align: left;">V2.0.3</td> <td style="text-align: left;">Add 2.27 Calling Client starts to send Video Frame;2.28 Calling Client stops to send Video Frame;2.35 End the call;2.36 The caller makes a call request;2.37 The called party responds to the call request;Adjust number</td> <td style="text-align: left;">Lux</td> </tr> <tr> <td style="text-align: left;">2022/3/8</td> <td style="text-align: left;">V2.0.4</td> <td style="text-align: left;">Add 2.53 Get ICCID information</td> <td style="text-align: left;">Arthur</td> </tr> <tr> <td style="text-align: left;">2022/4/28</td> <td style="text-align: left;">V2.0.5</td> <td style="text-align: left;">Add 2.54 Get certKey and profileVer</td> <td style="text-align: left;">Lux</td> </tr> <tr> <td style="text-align: left;">2023/7/11</td> <td style="text-align: left;">V2.0.6</td> <td style="text-align: left;">Add 2.55 Get the list of channels for uploading files; 2.56 Obtain the list of channels for downloading SD card events; 2.57 Get preset record list; 2.58 Play the preset record</td> <td style="text-align: left;">Lux</td> </tr> <tr> <td style="text-align: left;">2024/2/5</td> <td style="text-align: left;">V2.0.7</td> <td style="text-align: left;">Add 2.59 Obtain whether the device supports two-way video ;2.60 Initiate two-way video;</td> <td style="text-align: left;">Steven</td> </tr> <tr> <td style="text-align: left;">2024/4/10</td> <td style="text-align: left;">V2.0.8</td> <td style="text-align: left;">Modify 2.41 The &quot;version&quot; parameter type to char[64]</td> <td style="text-align: left;">Zed</td> </tr> <tr> <td style="text-align: left;">2024/4/16</td> <td style="text-align: left;">V2.0.9</td> <td style="text-align: left;">Add 2.61 To obtain device SD card status</td> <td style="text-align: left;">Zed</td> </tr> </tbody> </table> <hr /> <h1>One. IO Command Definition</h1> <p>&gt; Note: The device needs to be functionally connected according to the IO Command document provided by TUTK. In order to standardize the setting and use of the public version of Kalay APP IO Command, it is forbidden to change the parameters and structures of the public version IO Command at will. If the device cannot successfully connect to the public version APP due to random changes, TUTK does not need to bear any responsibility. At the same time, in order to meet the needs of customized projects, some parameter sections will be reserved for customized Command settings.</p> <h2>1.1 Parameter section used in public version and customized</h2> <p><img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/f07bfb120b42c4cd1bdbc19dc9ef2947" alt="" /></p> <h2>1.2 Structure definition specifications and restrictions</h2> <ul> <li>The number of bytes occupied by the data of the structure should be a multiple of 4.</li> <li>The number of bytes of data in the structure should not exceed 1024 bytes.</li> </ul> <hr /> <h1>Two. Structure and Description</h1> <h2>2.1 Calling device starts to transmit Video Frame</h2> <p><strong>IOTYPE_USER_IPCAM_START = 0x01FF;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to start sending video data. </li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.2 Calling device stops transmitting Video Frame</h2> <p><strong>IOTYPE_USER_IPCAM_STOP = 0x02FF;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to stop sending video data. </li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.2.1 Calling device starts reciving Video Frame</h2> <p><strong>IOTYPE_USER_IPCAM_START_CLIENT = 0x03FF;</strong></p> <ul> <li>Sent from APP to Device;</li> <li>APP tells Device to start reciving video data。</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.2.2 Calling device stops reciving Video Frame</h2> <p><strong>IOTYPE_USER_IPCAM_STOP = 0x03FF;</strong></p> <ul> <li>Sent from APP to Device;;</li> <li>APP tells Device to stop reciving video data。</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.3 Calling device starts to transmit Audio Frame</h2> <p><strong>IOTYPE_USER_IPCAM_AUDIOSTART = 0x0300;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to start sending audio data.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.4 Calling device stops transmitting Audio Frame</h2> <p><strong>IOTYPE_USER_IPCAM_AUDIOSTOP = 0x0301;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to stop sending audio data.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.5 Set device SD card recording mode</h2> <p><strong>IOTYPE_USER_IPCAM_SETRECORD_REQ = 0x0310;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to set the SD card recording mode of the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned int recordType; // Refer to ENUM_RECORD_TYPE unsigned char reserved[4]; }SMsgAVIoctrlSetRecordReq, SMsgAVIoctrlGetRecordResq; typedef enum { AVIOTC_RECORDTYPE_OFF = 0x00; AVIOTC_RECORDTYPE_FULLTIME = 0x01; AVIOTC_RECORDTYPE_ALARM = 0x02; AVIOTC_RECORDTYPE_MANUAL = 0x03; }ENUM_RECORD_TYPE;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SETRECORD_RESP = 0x0311;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs App of setting result.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { int result; // return 0 if success, otherwise: failed. unsigned char reserved[4]; }SMsgAVIoctrlSetRecordResp;</code></pre> <h2>2.6 Get the current SD card recording mode of the device</h2> <p><strong>IOTYPE_USER_IPCAM_GETRECORD_REQ = 0x0312;</strong></p> <ul> <li>Send from APP to Device;</li> <li>The APP informs the Device to obtain the SD card recording mode of the device. </li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; }SMsgAVIoctrlGetRecordReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GETRECORD_RESP = 0x0313;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the video type configuration into IOCtrl data and sends it back to App. </li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned int recordType; // Refer to ENUM_RECORD_TYPE unsigned char reserved[4]; }SMsgAVIoctrlSetRecordReq, SMsgAVIoctrlGetRecordResq; typedef enum { AVIOTC_RECORDTYPE_OFF = 0x00; AVIOTC_RECORDTYPE_FULLTIME = 0x01; AVIOTC_RECORDTYPE_ALARM = 0x02; AVIOTC_RECORDTYPE_MANUAL = 0x03; }ENUM_RECORD_TYPE;</code></pre> <h2>2.7 Get device SD card event list</h2> <p><strong>IOTYPE_USER_IPCAM_LISTEVENT_REQ = 0x0318;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to obtain a list of device events.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // Camera Index STimeDay stStartTime; // Search event from ... STimeDay stEndTime; // ... to (search event) unsigned char event; // event type, refer to ENUM_EVENTTYPE unsigned char status; // 0x00: Recording file exists, Event unreaded // 0x01: Recording file exists, Event readed // 0x02: No Recording file in the event unsigned char reserved[2]; }SMsgAVIoctrlListEventReq; typedef struct { unsigned short year; // The number of year. unsigned char month; // The number of months since January, in the range 1 to 12. unsigned char day; // The day of the month, in the range 1 to 31. unsigned char wday; // The number of days since Sunday, in the range 0 to 6. (Sunday = 0, Monday = 1, ...) unsigned char hour; // The number of hours past midnight, in the range 0 to 23. unsigned char minute; // The number of minutes after the hour, in the range 0 to 59. unsigned char second; // The number of seconds after the minute, in the range 0 to 59. }STimeDay;</code></pre> <p><strong>IOTYPE_USER_IPCAM_LISTEVENT_RESP = 0x0319;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the video list in IOCtrl data and sends it back to App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned int total; // total events in this search session unsigned char index; // packet index, 0,1,2... // avSendIOCtrl send max 1024 bytes one time; // total events can be divided into x packages; x is 0,1,2... unsigned char endflag; // end flag = 1 means this packet is the last one,otherwise there are more packets to receive. unsigned char count; // how many events in this packet. unsigned char reserved[1]; SAvEvent stEvent[0]; // first address of all events in this package }SMsgAVIoctrlListEventResp; typedef struct { STimeDay stTime; unsigned char event; // refer to ENUM_EVENTTYPE unsigned char status; // 0x00: Recording file exists, Event unreaded // 0x01: Recording file exists, Event readed // 0x02: No Recording file in the event unsigned short duration; // event duration in second }SAvEvent; typedef enum { AVIOCTRL_EVENT_ALL = 0x00; // All Events AVIOCTRL_EVENT_MOTIONDECT = 0x01; // Motion Detection AVIOCTRL_EVENT_VIDEOLOST = 0x02; // Video Lost AVIOCTRL_EVENT_IOALARM = 0x03; // IO Alarm AVIOCTRL_EVENT_MOTIONPASS = 0x04; // Motion Pass AVIOCTRL_EVENT_VIDEORESUME = 0x05; // Resume Video AVIOCTRL_EVENT_IOALARMPASS = 0x06; // IO Alarm Pass AVIOCTRL_EVENT_MOVIE = 0x07; // Movie AVIOCTRL_EVENT_TIME_LAPSE = 0x08; // Time Lapse AVIOCTRL_EVENT_EMERGENCY = 0x09; // Emergency AVIOCTRL_EVENT_EXPT_REBOOT = 0x10; // System Reboot AVIOCTRL_EVENT_SDFAULT = 0x11; // Cannot detect SD Card AVIOCTRL_EVENT_FULLTIME_RECORDING = 0x12; // Full Time AVIOCTRL_EVENT_PIR = 0x13; // PIR AVIOCTRL_EVENT_RINGBELL = 0x14; // Ringbell AVIOCTRL_EVENT_SOUND = 0x15; // Sound AVIOCTRL_EVENT_HUMANOID_DETECTION = 0x16; // Humanoid Detection }ENUM_EVENTTYPE;</code></pre> <h2>2.8 SD card event playback control</h2> <p><strong>IOTYPE_USER_IPCAM_RECORD_PLAYCONTROL_REQ = 0x031A;</strong></p> <ul> <li>Sent from APP to Device;</li> <li>APP informs Device to replay the recording event.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // Camera Index unsigned int command; // play record command, refer to ENUM_PLAYCONTROL. unsigned int Param; // command param, that the user defined STimeDay stTimeDay; // Event time from ListEvent unsigned char endflag; // 0 app, play stop when this event end; 1 web, continue next event when this event end unsigned char downloadFlag; // 0 playback mode, 1 download mode unsigned char reserved[2]; } SMsgAVIoctrlPlayRecordReq; typedef enum { AVIOCTRL_RECORD_PLAY_PAUSE = 0x00; AVIOCTRL_RECORD_PLAY_STOP = 0x01; AVIOCTRL_RECORD_PLAY_STEPFORWARD = 0x02; AVIOCTRL_RECORD_PLAY_STEPBACKWARD = 0x03; AVIOCTRL_RECORD_PLAY_FORWARD = 0x04; AVIOCTRL_RECORD_PLAY_BACKWARD = 0x05; AVIOCTRL_RECORD_PLAY_SEEKTIME = 0x06; AVIOCTRL_RECORD_PLAY_END = 0x07; AVIOCTRL_RECORD_PLAY_START = 0x10; AVIOCTRL_RECORD_PLAY_NEXT = 0xf0; AVIOCTRL_RECORD_PLAY_IFRAME = 0xf1 }ENUM_PLAYCONTROL;</code></pre> <p><strong>IOTYPE_USER_IPCAM_RECORD_PLAYCONTROL_RESP = 0x031B;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the video playback result into IOCtrl data and sends it back to App. (APP receives fixed byte length)</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int command; // Play record command. refer to ENUM_PLAYCONTROL unsigned int result; // Depends on command // when is AVIOCTRL_RECORD_PLAY_START: // result&amp;amp;=0 real channel no used by device for playback // result &amp;lt;0 error // result= -1 playback error // result= -2 exceed max allow client amount unsigned int size; // Event playback file size unsigned char respond; unsigned char reserved[3]; } SMsgAVIoctrlPlayRecordResp;</code></pre> <h2>2.9 Set device video quality</h2> <p><strong>IOTYPE_USER_IPCAM_SETSTREAMCTRL_REQ = 0x0320;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to set the resolution of the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char quality; // refer to ENUM_QUALITY_LEVEL unsigned char reserved[3]; } SMsgAVIoctrlSetStreamCtrlReq; typedef enum { AVIOCTRL_QUALITY_UNKNOWN = 0x00, AVIOCTRL_QUALITY_MAX = 0x01; AVIOCTRL_QUALITY_HIGH = 0x02; AVIOCTRL_QUALITY_MIDDLE = 0x03; AVIOCTRL_QUALITY_LOW = 0x04; AVIOCTRL_QUALITY_MIN = 0x05; }ENUM_QUALITY_LEVEL;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SETSTREAMCTRL_RESP = 0x0321;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs the APP of the resolution setting result.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int result; // 0: success; otherwise: failed. unsigned char reserved[4]; } SMsgAVIoctrlGetStreamCtrlResq;</code></pre> <h2>2.10 Get the current video quality of the device</h2> <p><strong>IOTYPE_USER_IPCAM_GETSTREAMCTRL_REQ = 0x0322;</strong></p> <ul> <li>Send from APP to Device;</li> <li>The APP informs the Device to obtain the current resolution of the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; }SMsgAVIoctrlGetStreamCtrlReq; </code></pre> <p><strong>IOTYPE_USER_IPCAM_GETSTREAMCTRL_RESP = 0x0323;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the device resolution configuration in IOCtrl data and sends it back to App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char quality; //refer to ENUM_QUALITY_LEVEL unsigned char reserved[3]; } SMsgAVIoctrlSetStreamCtrlReq, SMsgAVIoctrlGetStreamCtrlResp;</code></pre> <h2>2.11 Set the sensitivity of device motion detection</h2> <p><strong>IOTYPE_USER_IPCAM_SETMOTIONDETECT_REQ = 0x0324;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to set the sensitivity of device displacement detection.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned int sensitivity; // 0 (Disabled) ~ 100(MAX): // Index in App. Sensitivity value // 0 0(Off) // 1 25(Low) // 2 50(Medium) // 3 75(High) // 4 100(Max) }SMsgAVIoctrlSetMotionDetectReq, SMsgAVIoctrlGetMotionDetectResp;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SETMOTIONDETECT_RESP = 0x0325;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP of the sensitivity setting result of motion detection.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { int result; // 0: success; otherwise: failed. unsigned char reserved[4]; }SMsgAVIoctrlSetMotionDetectResp;</code></pre> <h2>2.12 Get the sensitivity of the device's current motion detection</h2> <p><strong>IOTYPE_USER_IPCAM_GETMOTIONDETECT_REQ = 0x0326;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to obtain the sensitivity of device displacement detection.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlGetMotionDetectReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GETMOTIONDETECT_RESP = 0x0327;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts device motion detection sensitivity configuration into IOCtrl data and sends it back to App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned int channel; // Camera Index unsigned int sensitivity; // 0(Disabled) ~ 100(MAX): // index sensitivity value // 0 0(Off) // 1 25(Low) // 2 50(Medium) // 3 75(High) // 4 100(Max) }SMsgAVIoctrlSetMotionDetectReq, SMsgAVIoctrlGetMotionDetectResp;</code></pre> <h2>2.13 Get the current number of device channels</h2> <p><strong>IOTYPE_USER_IPCAM_GETSUPPORTSTREAM_REQ = 0x0328;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to get the current device channel number.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[4]; }SMsgAVIoctrlGetSupportStreamReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GETSUPPORTSTREAM_RESP = 0x0329;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the device channel configuration into IOCtrl data and sends it back to App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned short index; // the stream index of camera unsigned short channel; // the channel index used in AVAPIs char reserved[4]; }SStreamDef; typedef struct { unsigned int number; // the quantity of supported stream SStreamDef streams[0]; }SMsgAVIoctrlGetSupportStreamResp;</code></pre> <h2>2.14 Obtain device audio format</h2> <p>&gt; App to transmit sound.</p> <p><strong>IOTYPE_USER_IPCAM_GETAUDIOOUTFORMAT_REQ = 0x032A;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to obtain device audio format.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // camera index char reserved[4]; }SMsgAVIoctrlGetAudioOutFormatReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GETAUDIOOUTFORMAT_RESP = 0x032B;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the device audio format in IOCtrl data and sends it back to App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned int channel; // camera index int format; // refer to ENUM_CODECID in AVFRAMEINFO.h char sample_rate; char bitdata; char channels; // how many channels is used char avservchannel; // 0 sub channel; 1 main channel; otherwise sub channel (default 0) }SMsgAVIoctrlGetAudioOutFormatResp; Sample_Rate: AUDIO_SAMPLE_8K = 0; AUDIO_SAMPLE_11K = 1; AUDIO_SAMPLE_12K = 2; AUDIO_SAMPLE_16K = 3; AUDIO_SAMPLE_22K = 4; AUDIO_SAMPLE_24K = 5; AUDIO_SAMPLE_32K = 6; AUDIO_SAMPLE_44K = 7; AUDIO_SAMPLE_48K = 8; CodecId: MEDIA_CODEC_UNKNOWN = 0x00; MEDIA_CODEC_VIDEO_MPEG4 = 0x4C; MEDIA_CODEC_VIDEO_H263 = 0x4D; MEDIA_CODEC_VIDEO_H264 = 0x4E; MEDIA_CODEC_VIDEO_MJPEG = 0x4F; MEDIA_CODEC_VIDEO_HEVC = 0x50; MEDIA_CODEC_AUDIO_AAC_RAW = 0x86; MEDIA_CODEC_AUDIO_AAC_ADTS = 0x87; MEDIA_CODEC_AUDIO_AAC_LATM = 0x88; MEDIA_CODEC_AUDIO_G711U = 0x89; //g711 u-law MEDIA_CODEC_AUDIO_G711A = 0x8A; //g711 a-law MEDIA_CODEC_AUDIO_ADPCM = 0x8B; MEDIA_CODEC_AUDIO_PCM = 0x8C; MEDIA_CODEC_AUDIO_SPEEX = 0x8D; MEDIA_CODEC_AUDIO_MP3 = 0x8E; MEDIA_CODEC_AUDIO_G726 = 0x8F; Bitdata (0x0 ~ 0xF): AUDIO_DATABITS_8 = 0; AUDIO_DATABITS_16 = 1;</code></pre> <h2>2.15 Get device information</h2> <p>&gt; It is recommended to use 0x8015/0x8016 instead.</p> <p><strong>IOTYPE_USER_IPCAM_DEVINFO_REQ = 0x0330;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to obtain device information.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[4]; }SMsgAVIoctrlDeviceInfoReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_DEVINFO_RESP = 0x0331;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts device information into IOCtrl data and sends it back to App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char model[16]; unsigned char vendor[16]; unsigned int version; unsigned int channel; // reserve unsigned int total; // MBytes, total space size for sdcard unsigned int free; // MBytes , free space size for sdcard unsigned int company; // company index reference OTA Company list unsigned char reserved[4]; }SMsgAVIoctrlDeviceInfoResp;</code></pre> <h2>2.16 Change device password</h2> <p><strong>IOTYPE_USER_IPCAM_SETPASSWORD_REQ = 0x0332;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to change the device password.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { char oldpasswd[32]; // old password char newpasswd[32]; // new password }SMsgAVIoctrlSetPasswdReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SETPASSWORD_RESP = 0x0333;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP of the result of changing device password.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { int result; // 0x00 set password successfully, or not failed unsigned char reserved[4]; }SMsgAVIoctrlSetPasswdResp;</code></pre> <h2>2.17 Event playback progress control</h2> <p><strong>IOTYPE_USER_IPCAM_GET_PLAYBACK_REQ = 0x033A;</strong></p> <ul> <li>Send from App to Device.</li> <li>App tells Device to get event duration information.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index STimeDay stTimeDay; // Event time from ListEvent unsigned char reserved[4]; }SMsgAVIoctrlGetPlaybackReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_PLAYBACK_RESP = 0x033B;</strong> &gt; Note: The time stamp of the video stream must be within the time period of the return, and the time stamp is in UTC format.</p> <ul> <li>Send from Device to App.</li> <li>Device duration information is returned to the App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned int videoTime; // event video time in seconds unsigned long size; // event size in byte unsigned char reserved[4]; }SMsgAVIoctrlGetPlaybackResp;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SET_RECORD_PROGRESS_REQ = 0x033C;</strong> &gt; Note: App will not stop video streaming (0x2ff will not be sent).</p> <ul> <li>Send from App to Device.</li> <li>App tells Device to play from the specified time.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // Camera Index STimeDay stTimeDay; // Event time from ListEvent unsigned int progressTime; // event progress time in seconds unsigned char reserved[4]; }SMsgAVIoctrlSetRecordProgessReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SET_RECORD_PROGRESS_RESP = 0x033D;</strong></p> <ul> <li>Send from Device to App.</li> <li>Device sends back the device progress result to the App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char result; // 0 means success unsigned char reserved[3]; }SMsgAVIoctrlSeRecordProgressResp;</code></pre> <h2>2.18 Get Wifi list around the device</h2> <p><strong>IOTYPE_USER_IPCAM_LISTWIFIAP_REQ = 0x0340;</strong></p> <ul> <li>Send from APP to Device;</li> <li>The APP informs the Device to obtain the wifi list around the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[4]; }SMsgAVIoctrlListWifiApReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_LISTWIFIAP_RESP = 0x0341;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the wifi list around the device in the IOCtrl data and sends it back to the App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned int number; // MAX: 1024/36=28 SWifiAp stWifiAp[0]; // stored the start address for all WiFi information // use sizeof(SWifiAp) bytes to get WiFi data. }SMsgAVIoctrlListWifiApResp; typedef struct { char ssid[32]; // the SSID of WiFi char mode; // refer to ENUM_AP_MODE char enctype; // Encryption to WiFi, refer to ENUM_AP_ENCTYPE. char signal; // signal strength, ranged from 0% to 100%. char status; // 0 : invalid ssid or disconnected // 1 : connected with default gateway // 2 : unmatched password // 3 : weak signal and connected // 4 : selected password matched and disconnected or connected but not default gateway }SWifiAp; typedef enum { AVIOTC_WIFIAPMODE_NULL = 0x00; AVIOTC_WIFIAPMODE_MANAGED = 0x01; AVIOTC_WIFIAPMODE_ADHOC = 0x02; }ENUM_AP_MODE; typedef enum { AVIOTC_WIFIAPENC_INVALID = 0x00; AVIOTC_WIFIAPENC_NONE = 0x01; AVIOTC_WIFIAPENC_WEP = 0x02; // WEP,for no password AVIOTC_WIFIAPENC_WPA_TKIP = 0x03; AVIOTC_WIFIAPENC_WPA_AES = 0x04; AVIOTC_WIFIAPENC_WPA2_TKIP = 0x05; AVIOTC_WIFIAPENC_WPA2_AES = 0x06; AVIOTC_WIFIAPENC_WPA_PSK_TKIP = 0x07; AVIOTC_WIFIAPENC_WPA_PSK_AES = 0x08; AVIOTC_WIFIAPENC_WPA2_PSK_TKIP = 0x09; AVIOTC_WIFIAPENC_WPA2_PSK_AES = 0x0A; }ENUM_AP_ENCTYPE;</code></pre> <h2>2.19 Set the Wifi network of the device</h2> <p><strong>IOTYPE_USER_IPCAM_SETWIFI_REQ = 0x0342;</strong></p> <ul> <li>Send from APP to Device;</li> <li>The APP informs the Device to set the wifi of the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char ssid[32]; // the WiFi SSID to connect unsigned char password[32]; // WiFi SSID password unsigned char mode; // refer to ENUM_AP_MODE unsigned char enctype; // refer to ENUM_AP_ENCTYPE unsigned char reserved[10]; }SMsgAVIoctrlSetWifiReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SETWIFI_RESP = 0x0343;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP of the result of setting device wifi.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { int result; // return 0 if WiFi connected, otherwise return 1. unsigned char reserved[4]; }SMsgAVIoctrlSetWifiResp;</code></pre> <h2>2.20 Get the WiFi currently set on the device</h2> <p><strong>IOTYPE_USER_IPCAM_GETWIFI_REQ = 0x0344;</strong></p> <ul> <li>Send from APP to Device;</li> <li>The APP informs the Device to obtain the wifi currently set by the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[4]; }SMsgAVIoctrlGetWifiReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GETWIFI_RESP = 0x0345;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the current wifi configuration of the device in the IOCtrl data and sends it back to the App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char ssid[32]; // WiFi ssid unsigned char password[32]; // WiFi password if not empty unsigned char mode; // refer to ENUM_AP_MODE unsigned char enctype; // refer to ENUM_AP_ENCTYPE unsigned char signal; // signal intensity 0--100% unsigned char status; // refer to &amp;quot;status&amp;quot; of SWifiAp }SMsgAVIoctrlGetWifiResp;</code></pre> <h2>2.21 Set the WiFi currently set by the device</h2> <p>&gt; Note: This command supports 64-bit password and is sent together with IOTYPE_USER_IPCAM_SETWIFI_REQ = 0x0342.</p> <p><strong>IOTYPE_USER_IPCAM_SETWIFI_REQ2 = 0x0346;</strong></p> <ul> <li>Send from APP to Device;</li> <li>The APP informs the Device to set the wifi currently set by the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char ssid[32]; // the WiFi SSID to connect unsigned char password[64]; // WiFi SSID password unsigned char mode; // refer to ENUM_AP_MODE unsigned char enctype; // refer to ENUM_AP_ENCTYPE unsigned char reserved[10]; }SMsgAVIoctrlSetWifiReq2;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GETWIFI_RESP2 = 0x0347;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device puts the current wifi configuration of the device in the IOCtrl data and sends it back to the App.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char ssid[32]; // WiFi ssid unsigned char password[64]; // WiFi password if not empty unsigned char mode; // refer to ENUM_AP_MODE unsigned char enctype; // refer to ENUM_AP_ENCTYPE unsigned char signal; // signal intensity 0--100% unsigned char status; // refer to &amp;quot;status&amp;quot; of SWifiAp }SMsgAVIoctrlGetWifiResp2;</code></pre> <h2>2.22 Calling device starts to receive Audio Frame</h2> <p><strong>IOTYPE_USER_IPCAM_SPEAKERSTART = 0x0350;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to start receiving audio data.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.23 Calling device stops receiving Audio Frame</h2> <p><strong>IOTYPE_USER_IPCAM_SPEAKERSTOP = 0x0351;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to stop receiving audio data.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.24 Set screen mirroring/flip status</h2> <p><strong>IOTYPE_USER_IPCAM_SET_VIDEOMODE_REQ = 0x0370;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to set mirror/flip.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned int channel; // Camera Index unsigned char mode; // refer to ENUM_VIDEO_MODE unsigned char reserved[3]; }SMsgAVIoctrlSetVideoModeReq; typedef enum { AVIOCTRL_VIDEOMODE_NORMAL = 0x00; AVIOCTRL_VIDEOMODE_FLIP = 0x01; // vertical flip AVIOCTRL_VIDEOMODE_MIRROR = 0x02; // horizontal flip AVIOCTRL_VIDEOMODE_FLIP_MIRROR = 0x03; // vertical &amp;amp;amp; horizontal flip }ENUM_VIDEO_MODE;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SET_VIDEOMODE_RESP = 0x0371;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP of setting result.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char result; // 0: success; otherwise: failed. unsigned char reserved[3]; }SMsgAVIoctrlSetVideoModeResp;</code></pre> <h2>2.25 Get screen mirroring/flip setting status</h2> <p><strong>IOTYPE_USER_IPCAM_GET_VIDEOMODE_REQ = 0x0372;</strong></p> <ul> <li>Send from APP to Device;</li> <li>The APP informs the Device to obtain the mirror/flip setting status.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; }SMsgAVIoctrlGetVideoModeReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_VIDEOMODE_RESP = 0x0373;</strong></p> <ul> <li>Sent from Device to APP;</li> <li>Device informs the APP of the current setting status of screen mirroring/flip.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned char mode; // refer to ENUM_VIDEO_MODE unsigned char reserved[3]; }SMsgAVIoctrlGetVideoModeResp; typedef enum { AVIOCTRL_VIDEOMODE_NORMAL = 0x00, AVIOCTRL_VIDEOMODE_FLIP = 0x01, // vertical flip AVIOCTRL_VIDEOMODE_MIRROR = 0x02, // horizontal flip AVIOCTRL_VIDEOMODE_FLIP_MIRROR = 0x03, // vertical &amp;amp;amp; horizontal flip }ENUM_VIDEO_MODE;</code></pre> <h2>2.26 Format SD card</h2> <p><strong>IOTYPE_USER_IPCAM_FORMATEXTSTORAGE_REQ = 0x0380;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to format SD card.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int storage; // Storage index (ex. sdcard slot = 0, internal flash = 1, ...) unsigned char reserved[4]; }SMsgAVIoctrlFormatExtStorageReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_FORMATEXTSTORAGE_RESP = 0x0381;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP that the SD card has been formatted.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned int storage; // Storage index char result; // 0: success; // -1: format command is not supported. // otherwise: failed. unsigned char reserved[3]; }SMsgAVIoctrlFormatExtStorageResp;</code></pre> <h2>2.27 Calling Client starts to send Video Frame</h2> <p>&gt; Mainly used in two-way video call scenarios.</p> <p><strong>IOTYPE_USER_IPCAM_START_CLIENT = 0x03FF;</strong></p> <ul> <li>Send from APP to Client;</li> <li>APP informs Client start to send video frame.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.28 Calling Client stops to send Video Frame</h2> <p>&gt; Mainly used in two-way video call scenarios.</p> <p><strong>IOTYPE_USER_IPCAM_STOP_CLIENT = 0x04FF;</strong></p> <ul> <li>Send from APP to Client;</li> <li>APP informs Client stop to send video frame.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // Camera Index unsigned char reserved[4]; } SMsgAVIoctrlAVStream;</code></pre> <h2>2.29 Get the number of NVR device Channel interfaces</h2> <p><strong>IOTYPE_USER_IPCAM_GET_NVR_CHANNEL_NUMBER_REQ = 0x5A4;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to obtain the number of interfaces of the device Channel.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[4]; }SMsgAVIoctrlGetNVRChannelNumberReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_NVR_CHANNEL_NUMBER_RESP = 0x5A5;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs the APP of the number of interfaces of the current device Channel.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int number; // the quantity of device channel unsigned char reserved[4]; }SMsgAVIoctrlGetNVRChannelNumberResp;</code></pre> <h2>2.30 Get channel name</h2> <p><strong>IOTYPE_USER_IPCAM_GET_CHANNEL_NAME_REQ = 0x5B0;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to obtain the channel name of the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[4]; }SMsgAVIoctrlGetChannelNameReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_CHANNEL_NAME_RESP = 0x5B1;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device tells APP the channel name of the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char count; // quantity of channels unsigned char reserved[3]; SChannelInfo sChannelInfo[0]; // first channelInfo, and total count channelInfo }SMsgAVIoctrlGetChannelNameResp; typedef struct { unsigned int channel; // camera index unsigned char name[24]; // channel name } SChannelInfo;</code></pre> <h2>2.31 Set channel name</h2> <p><strong>IOTYPE_USER_IPCAM_SET_CHANNEL_NAME_REQ = 0x5B2;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to set the channel name of the device.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char count; // quantity of SChannelInfos unsigned char reserved[3]; SChannelInfo sChannelInfo[0]; // first channelInfo, and total count channelInfo }SMsgAVIoctrlSetChannelNameReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SET_CHANNEL_NAME_RESP = 0x5B3;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP of the result of setting device channel name.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char result; // 0 success, other failed unsigned char reserved[3]; }SMsgAVIoctrlSetResetResp;</code></pre> <h2>2.32 Doorbell call</h2> <p>&gt; Mainly used in video doorbell call scenarios.</p> <p><strong>IOTYPE_XM_CALL_REQ = 0x700;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP that there is a user call.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char index; // Door index number, 0: Door1; 1: Door2 STimeDay stTime; // Event time unsigned char reserved[3]; } SMsgAVIoctrlCallReq</code></pre> <p><strong>IOTYPE_XM_CALL_RESP = 0x701;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device whether to answer the call.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char index; // Door index number, 0: Door1; 1: Door2 int nAnswered; // 0: hang up; 1: answer unsigned char reserved[3]; }SMsgAVIoctrlCallResp;</code></pre> <p><strong>IOTYPE_XM_CALL_IND = 0x702;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs the APP whether there are other users answering.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char index; // Door index number, 0: Door1; 1: Door2 unsigned char type; // Type, 0: user calls; 1: other users answer STimeDay stTime; // Event time unsigned char reserved[3]; }SMsgAVIoctrlCallInd;</code></pre> <h2>2.33 Send device name to device</h2> <p><strong>IOTYPE_USER_IPCAM_PUSH_DEVICENAME_REQ= 0x0736;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP tells Device to request the current device name.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel ; // camera index char devicename[150]; // Current device name }SMsgAVIoctrlPushDeviceNameReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_PUSH_DEVICENAME_RESP= 0x0737;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device tells the APP to update the result of the current device name.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { int res; // 0:success, others failed char reserved[4]; }SMsgAVIoctrlPushDeviceNameResp;</code></pre> <h2>2.34 Sync phone time to device</h2> <p><strong>IOTYPE_USER_IPCAM_SET_TIME_SYNC_REQ = 0x0816;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to synchronize the phone time.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned short year; unsigned char month; unsigned char day; unsigned char hour; unsigned char minute; unsigned char second; unsigned char nIsSupportSync; // 1 supported; 0 unsupported int nGMTOffset; // the offset between GMT in seconds } SMsgAVIoctrlTimeSyncReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SET_TIME_SYNC_RESP = 0x0817;</strong></p> <ul> <li>Send from Device to APP;</li> <li>Device informs APP of the result of time synchronization.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int result; // return 0 if success, otherwise failed unsigned char reserved[4]; } SMsgAVIoctrlTimeSyncResp;</code></pre> <h2>2.35 End the call</h2> <p>&gt; Mainly used in two-way video call scenarios.</p> <p><strong>IOTYPE_USER_IPCAM_CALL_END = 0x0900;</strong></p> <ul> <li>Send to the other end from the APP;</li> <li>APP informs the other party to end the call.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char myID[6]; // my ID unsigned char reserved[2]; }SMsgAVIoctrlCallEnd;</code></pre> <h2>2.36 The caller makes a call request</h2> <p>&gt; Mainly used in two-way video call scenarios.</p> <p><strong>IOTYPE_USER_IPCAM_CALL_REQ = 0x0901;</strong></p> <ul> <li>Sent from the caller to the called party;</li> <li>The caller initiates a call request to the called party.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char myID[6]; // my ID unsigned char myUID[20]; // my UID unsigned char callType; // 0,oneway; 1, twoway unsigned char beInvited; // 0 means to invite and 1 means be invited unsigned char infoCount; // other account count unsigned char reserved[3]; unsigned AccountInfo info // other account info in this meeting }SMsgAVIoctrlCallReq; typedef struct{ unsigned char UID[20]; // UID unsigned char myID[6]; // ID unsigned char reserved[2]; }AccountInfo</code></pre> <h2>2.37 The called party responds to the call request</h2> <p>&gt; Mainly used in two-way video call scenarios.</p> <p><strong>IOTYPE_USER_IPCAM_CALL_RESP = 0x0902;</strong></p> <ul> <li>From the called party to the caller;</li> <li>The called party responds to the call request initiated by the caller.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char answer; // 0, reject; 1 answer unsigned char myID[6]; // my ID unsigned char reserved[1]; }SMsgAVIoctrlCallResp;</code></pre> <h2>2.38 PTZ control</h2> <p><strong>IOTYPE_USER_IPCAM_PTZ_COMMAND = 0x1001;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to control PTZ.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char control; // ptz control command, refer to ENUM_PTZCMD. unsigned char speed; // ptz control speed unsigned char point; // no use in app unsigned char limit; // no use in app unsigned char aux; // no use in app unsigned char channel; // camera index unsigned char reserve[2]; } SMsgAVIoctrlPtzCmd; /* AVIOCTRL PTZ Command 值 */ typedef enum { AVIOCTRL_PTZ_STOP = 0; AVIOCTRL_PTZ_UP = 1; AVIOCTRL_PTZ_DOWN = 2; AVIOCTRL_PTZ_LEFT = 3; AVIOCTRL_PTZ_LEFT_UP = 4; AVIOCTRL_PTZ_LEFT_DOWN = 5; AVIOCTRL_PTZ_RIGHT = 6; AVIOCTRL_PTZ_RIGHT_UP = 7; AVIOCTRL_PTZ_RIGHT_DOWN = 8; AVIOCTRL_PTZ_AUTO = 9; AVIOCTRL_PTZ_SET_POINT = 10; AVIOCTRL_PTZ_CLEAR_POINT = 11; AVIOCTRL_PTZ_GOTO_POINT = 12; AVIOCTRL_PTZ_SET_MODE_START = 13; AVIOCTRL_PTZ_SET_MODE_STOP = 14; AVIOCTRL_PTZ_MODE_RUN = 15; AVIOCTRL_PTZ_MENU_OPEN = 16; AVIOCTRL_PTZ_MENU_EXIT = 17; AVIOCTRL_PTZ_MENU_ENTER = 18; AVIOCTRL_PTZ_FLIP = 19; AVIOCTRL_PTZ_START = 20; AVIOCTRL_LENS_APERTURE_OPEN = 21; AVIOCTRL_LENS_APERTURE_CLOSE = 22; AVIOCTRL_LENS_ZOOM_IN = 23; AVIOCTRL_LENS_ZOOM_OUT = 24; AVIOCTRL_LENS_FOCAL_NEAR = 25; AVIOCTRL_LENS_FOCAL_FAR = 26; AVIOCTRL_AUTO_PAN_SPEED = 27; AVIOCTRL_AUTO_PAN_LIMIT = 28; AVIOCTRL_AUTO_PAN_START = 29; AVIOCTRL_PATTERN_START = 30; AVIOCTRL_PATTERN_STOP = 31; AVIOCTRL_PATTERN_RUN = 32; AVIOCTRL_SET_AUX = 33; AVIOCTRL_CLEAR_AUX = 34; AVIOCTRL_MOTOR_RESET_POSITION = 35; }ENUM_PTZCMD;</code></pre> <h2>2.39 APP gets the first I frame picture</h2> <p><strong>IOTYPE_USER_IPCAM_RECEIVE_FIRST_IFRAME = 0x1002;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device that it has received the first I frame picture.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // camera index char reserved[4]; }SMsgAVIoctrlReceiveFirstIFrame;</code></pre> <h2>2.40 Device upgrade via OTA</h2> <p><strong>IOTYPE_USER_IPCAM_OTA_REQ = 0x8001;</strong></p> <ul> <li>Send from APP to Device;</li> <li>APP informs Device to start OTA upgrade.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char file_checksum[32]; // MD5 checksum unsigned char url[256]; // Download firmware url link unsigned int file_size; // firmware package size unsigned char reserved[4]; }SMsgAVIoctrlOTAReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_OTA_RESP = 0x8002;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs the App of the result of the OTA upgrade.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned int progress; // Download firmware progress unsigned int endflag; // 1: download completed; 0: downloading unsigned char reserved[8]; }SMsgAVIoctrlOTAResp;</code></pre> <h2>2.41 Get device information</h2> <p>&gt; Note: It is recommended to use when the new device needs to be connected to the OTA function. It has the same effect as the old cmd IOTYPE_USER_IPCAM_DEVINFO_REQ = 0x0330.</p> <p><strong>IOTYPE_USER_IPCAM_DEVICE_INFO_REQ = 0x8015;</strong></p> <ul> <li>Send from App to Device</li> <li>App tells Device to get device information.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[8]; } SMsgAVIoctrlDeviceInfoReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_DEVICE_INFO_RESP = 0x8016;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App device information.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">  typedef struct { unsigned char model[32]; // Product model unsigned char product[32]; // Product name unsigned char vender[32]; // Manufacturer (must be consistent with the vendor on the KOTA server) unsigned char version[64]; // Current version number unsigned int free; // SD card remaining space unsigned int total; // Total space of SD card unsigned char region; // Get the location of the device, 0: Mainland China; 1: Non-Mainland China unsigned char reserved[3]; } SMsgAVIoctrlDeviceInfoResp;</code></pre> <p>&gt; Note: The above parameters are used to splice the download url request for obtaining the upgrade file from the KOTA server, so they need to be consistent with the information such as vender, product, and model created on the KOTA server, and pay attention to distinguishing the device area.</p> <h2>2.42 Get whether the device supports OTA upgrade</h2> <p><strong>IOTYPE_USER_IPCAM _DEVICE_SUPPORT_OTA_REQ = 0x800A;</strong></p> <ul> <li>Send from App to Device</li> <li>App tells Device to obtain whether the device supports OTA.</li> <li>IOCtrl data: <pre><code class="language-c">typedef struct { unsigned char reserved[8]; }SMsgAVIoctrlDeviceSupportOTAReq;</code></pre></li> </ul> <p><strong>IOTYPE_USER_IPCAM _DEVICE_SUPPORT_OTA _RESP = 0x800B;</strong></p> <ul> <li>Send from Device to App</li> <li>Device tells the App whether the device supports OTA.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char isSupport; // 0 not supported; 1 supported unsigned char reserved[4]; } SMsgAVIoctrlDeviceSupportOTAResp;</code></pre> <h2>2.43 Get whether the device supports cloud storage</h2> <p><strong>IOTYPE_USER_IPCAM _DEVICE_SUPPORT_CLOUD_REQ = 0x800C;</strong></p> <ul> <li>Send from App to Device</li> <li>App tells Device to check whether cloud storage is supported.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned char reserved[8]; }SMsgAVIoctrlDeviceSupportCloudReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM _DEVICE_SUPPORT_CLOUD _RESP = 0x800D;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs the App whether the device supports cloud storage results.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int result; // 0 not supported; 1 supported unsigned char reserved[4]; } SMsgAVIoctrlDeviceSupportCloudResp;</code></pre> <h2>2.44 Set device cloud storage recording status</h2> <p><strong>IOTYPE_USER_IPCAM_DEVICE_SET_CLOUD_REQ = 0x8010;</strong></p> <ul> <li>Send from App to Device</li> <li>The App tells the Device to turn on or off the cloud storage recording function.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // camera index unsigned int isOn; // 1 on, 0 off }SMsgAVIoctrlSetCloudReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_DEVICE_SET_CLOUD_RESP = 0x8011;</strong></p> <ul> <li>Send from Device to App</li> <li>Device tells the App to turn on or off cloud storage recording results.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // camera index unsigned int result; // 0 successful, 1 fail }SMsgAVIoctrlSetCloudResp;</code></pre> <h2>2.45 Get device cloud storage recording status</h2> <p><strong>IOTYPE_USER_IPCAM_DEVICE_GET_CLOUD_REQ = 0x8012;</strong></p> <ul> <li>Send from App to Device</li> <li>App gets Device cloud storage recording status.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // camera index unsigned char reserved[4]; }SMsgAVIoctrlGetCloudReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_DEVICE_GET_CLOUD_RESP = 0x8013;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App cloud storage recording status.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // camera index unsigned int isOn; // 1 on, 0 off }SMsgAVIoctrlGetCloudResp;</code></pre> <h2>2.46 Get the date of SD card event</h2> <p><strong>IOTYPE_USER_IPCAM_GET_EVENT_DATE_REQ = 0x9000;</strong></p> <ul> <li>Send from App to Device</li> <li>App informs Device to get the date of SD card event.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int channel; // Camera Index unsigned int eventType; // The type of event to be queried, 0: all, 1: motion detection; 2: full-time recording, the default is 0 STimeDay stStartTime; // Start time STimeDay stEndTime; // End time unsigned char reserved[8]; }SMsgAVIoctrlGetEventDateReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_EVENT_DATE_RESP = 0x9001;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App that there is a date result of SD card event.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c"> typedef struct { unsigned int count; // The date number of the event unsigned char reserved[4]; EventDate eventDate[1]; // The date of the event }SMsgAVIoctrlGetEventDateResp;   typedef struct { char date[8]; // The date of the event, for example: 20200210, followed by count-1 dates[8] }EventDate;</code></pre> <h2>2.47 Get device humanoid detection status</h2> <p><strong>IOTYPE_USER_IPCAM_GET_HUMANDETECTION_REQ = 0x9002;</strong></p> <ul> <li>Send from App to Device</li> <li>App informs Device to get the status of humanoid detection switch.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char reserved[4]; }SMsgAVIoctrlGetHumanDetectionReq;</code></pre> <p>  <strong>IOTYPE_USER_IPCAM_GET_HUMANDETECTION_RESP = 0x9003;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs the App of the result of the humanoid detection switch query.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int result; // return 1 if open, otherwise close unsigned char reserved[4]; } SMsgAVIoctrlGetHumanDetectionResp;</code></pre> <p> </p> <h2>2.48 Set the device humanoid detection status</h2> <p><strong>IOTYPE_USER_IPCAM_SET_HUMANDETECTION_REQ = 0x9004;</strong></p> <ul> <li>Send from App to Device</li> <li>App informs Device to set humanoid detection switch.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int isOn; // 1 open, 0 close unsigned char reserved[4]; } SMsgAVIoctrlSetHumanDetectionReq;</code></pre> <p>  <strong>IOTYPE_USER_IPCAM_SET_HUMANDETECTION_RESP = 0x9005;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs the App of the result of the humanoid detection switch setting.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int result; // return 0 if successful, otherwise fail unsigned char reserved[4]; } SMsgAVIoctrlSetHumanDetectionResp;</code></pre> <p> </p> <h2>2.49 Get device night vision status</h2> <p><strong>IOTYPE_USER_IPCAM_GET_NIGHTVISION_REQ = 0x9006;</strong></p> <ul> <li>Send from App to Device</li> <li>App informs Device to get the status of night vision switch.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char reserved[4]; } SMsgAVIoctrlGetNightVisionReq;</code></pre> <p>  <strong>IOTYPE_USER_IPCAM_GET_NIGHTVISION_RESP = 0x9007;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App of the result of night vision switch query.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int result; // return 1 if open, otherwise close unsigned char reserved[4]; } SMsgAVIoctrlGetNightVisionResp;</code></pre> <p> </p> <h2>2.50 Set device night vision status</h2> <p><strong>IOTYPE_USER_IPCAM_SET_NIGHTVISION_REQ = 0x9008;</strong></p> <ul> <li>Send from App to Device</li> <li>App informs Device to set night vision switch.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int isOn; // 1 open, 0 close unsigned char reserved[4]; } SMsgAVIoctrlSetNightVisionReq;</code></pre> <p>  <strong>IOTYPE_USER_IPCAM_SET_NIGHTVISION_RESP = 0x9009;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App of the result of night vision switch setting.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int result; // return 0 if successful, otherwise fail unsigned char reserved[4]; } SMsgAVIoctrlSetNightVisionResp;</code></pre> <p> </p> <h2>2.51 Get device DST status</h2> <p><strong>IOTYPE_USER_IPCAM_GET_SUMMERTIME_REQ = 0x9010;</strong></p> <ul> <li>Send from App to Device</li> <li>App informs Device to check the daylight saving time switch.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char reserved[4]; } SMsgAVIoctrlGetSummerTimeReq;</code></pre> <p>  <strong>IOTYPE_USER_IPCAM_GET_SUMMERTIME_RESP = 0x9011;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App of the result of daylight saving time switch query.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int result; // return 1 if open, otherwise close unsigned char reserved[4]; } SMsgAVIoctrlGetSummerTimeResp;</code></pre> <p> </p> <h2>2.52 Set device DST status</h2> <p><strong>IOTYPE_USER_IPCAM_SET_SUMMERTIME_REQ = 0x9012;</strong></p> <ul> <li>Send from App to Device</li> <li>App informs Device to set the daylight saving time switch.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int isOn; // 1 open, 0 close unsigned char reserved[4]; } SMsgAVIoctrlSetSummerTimeReq;</code></pre> <p>  <strong>IOTYPE_USER_IPCAM_SET_SUMMERTIME_RESP = 0x9013;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App of the result of daylight saving time switch setting.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int result; // return 0 if successful, otherwise fail unsigned char reserved[4]; } SMsgAVIoctrlSetSummerTimeResp;</code></pre> <h2>2.53 Get ICCID information</h2> <p><strong>IOTYPE_USER_IPCAM_GET_CARD_ICCID_REQ = 0x30000004;</strong></p> <ul> <li>Send from App to Device</li> <li>App get the device's ICCID information</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int channel; // Camera channel unsigned char reserved[4]; }SMsgAVIoctrlGetCardICCIDReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_CARD_ICCID_RESP = 0x30000005;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App of the information of ICCID.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned int result; // return 0 if success, otherwise failed unsigned char ICCID[40]; unsigned char reserved[4]; }SMsgAVIoctrlGetCardICCIDResp;</code></pre> <h2>2.54 Get certKey and profileVer</h2> <p><strong>IOTYPE_USER_IPCAM_GET_PROFILE_REQ = 0x9014;</strong></p> <ul> <li>Send from App to Device</li> <li>App get the device's certKey and profileVer information</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char reserved[8]; }SMsgAVIoctrlGetProfileReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_PROFILE_RESP = 0x9015;</strong></p> <ul> <li>Send from Device to App</li> <li>Device informs App of the information of certKey and profileVer.</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char certKey[40]; unsigned char profileVer[20]; //profile version unsigned char reserved[8]; } SMsgAVIoctrlGetProfileResp;</code></pre> <h2>2.55 Get the list of channels for uploading files</h2> <p><strong>IOTYPE_USER_IPCAM_UPLOAD_FILE_REQ = 0x9027</strong></p> <ul> <li>Send from Device to App</li> <li>The App informs the Device that it needs to obtain the list of channels for uploading files</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { unsigned char fileName[64]; // file name }Fileinfo; typedef struct { int functionalType; // function type: 1.preset record 2.other type int count; // the total number of files to be uploaded Fileinfo Filename[10]; // Upload file name list } SMsgAVIoctrlFileUploadReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_UPLOAD_FILE_RESP = 0x9028</strong></p> <ul> <li>Sent from Device to App</li> <li>Device informs the App of the uploadable type and uploadable connection channel of the device</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">SMsgAVIoctrlEventFileDownReq // AVIOCTRL TKTransferType typedef enum { TKTransferType_AVAPI = 0, // AVAPI Mode TKTransferType_RDT = 1, // RDT Mode }ENUM_TKTransferType; typedef struct { unsigned int channel; // channel id }ChannelInfo; typedef struct { unsigned int type; // TKTransferType uploaded type int count; // Total number of channel sets (up to 10); -1 for failure ChannelInfo channel[10]; } SMsgAVIoctrlFileUploadResp;</code></pre> <h2>2.56 Obtain the list of channels for downloading SD card events</h2> <p><strong>IOTYPE_USER_IPCAM_EVENT_DOWNLOAD_FILE_REQ = 0x9029</strong></p> <ul> <li>Sent from App to Device</li> <li>The App informs the Device that it needs to obtain the list of channels for downloading SD card events</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { int count; // The number of events that need to be downloaded STimeDay sTimeDayList [10]; // Time collection of SD card events that need to be downloaded (up to 10 each time) }SMsgAVIoctrlEventFileDownReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_EVENT_DOWNLOAD_FILE_RESP = 0x902A</strong></p> <ul> <li>Sent from Device to App</li> <li>Device informs the App of the download type of the device and the connection channel that can be downloaded</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">SMsgAVIoctrlEventFileDownReq // AVIOCTRL TKTransferType typedef enum { TKTransferType_AVAPI = 0, // AVAPI Download Mode TKTransferType_RDT = 1, // RDT Download Mode }ENUM_TKTransferType; typedef struct { unsigned int channel; // channel id }ChannelInfo; typedef struct { unsigned int type; // TKTransferType download type int count; // Total number of channel sets (up to 10); -1 for failure ChannelInfo channel[10]; } SMsgAVIoctrlEventFileDownResp;</code></pre> <h2>2.57 Get preset record list</h2> <p><strong>IOTYPE_USER_IPCAM_GET_VOICE_FILELIST_REQ = 0x902B</strong></p> <ul> <li>Sent from App to Device</li> <li>The App informs the Device that it needs to obtain a list of preset record file names</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { int channel; // channel number }SMsgAVIoctrlGetVoiceFileReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_GET_VOICE_FILELIST_RESP = 0x902C</strong></p> <ul> <li>Sent from Device to App</li> <li>Device tells App the preset record list of the device</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { int isPresetSpeech; // Whether to preset record, 1: current preset record, 0: not currently preset record char fileName[64]; // file name }PresetSpeechInfo; typedef struct { int count; // Total number of filenames (up to 10); -1 for failure PresetSpeechInfo presetSpeechInfo [10]; } SMsgAVIoctrlGetVoiceFileResp;</code></pre> <h2>2.58 Play the preset record</h2> <p><strong>IOTYPE_USER_IPCAM_PLAY_VOICE_REQ = 0x902D</strong></p> <ul> <li>Sent from App to Device</li> <li>App tells Device to start playing</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { int channel; // channel number }SMsgAVIoctrlPlayVoiceReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_PLAY_VOICE_RESP = 0x902E</strong></p> <ul> <li>Sent from Device to App</li> <li>Device tells App the preset voice list of the device</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct { int result; // 1:successfully played, the other returns failed to play } SMsgAVIoctrlPlayVoiceResp;</code></pre> <h2>2.59 Obtain whether the device supports two-way video</h2> <p><strong>IOTYPE_USER_IPCAM_DEVICE_SUPPORT_DOUBLEVIDEO_REQ = 0x9030</strong></p> <ul> <li>Sent from App to Device</li> <li>App sends a request to obtain whether the device supports bidirectional video</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct {     unsigned char reserved[8]; }SMsgAVIoctrlDeviceSupportDoubleVideoReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_DEVICE_SUPPORT_DOUBLEVIDEO_RESP = 0x9031</strong></p> <ul> <li>Sent from Device to App</li> <li>Device informs the app whether the device supports bidirectional video</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct {     unsigned char isSupport; //0 not support,1 support     unsigned char reserved[3]; } SMsgAVIoctrlDeviceSupportDoubleVideoResp;</code></pre> <h2>2.60 Initiate two-way video</h2> <p><strong>IOTYPE_USER_IPCAM_DOUBLEVIDEOCALL_REQ = 0x9032</strong></p> <ul> <li>Sent from the calling party to the called party</li> <li>Call direction: The called party initiates a call request</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct {     unsigned char reserved[8]; }SMsgAVIoctrlDoubleVideoCallReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_DOUBLEVIDEOCALL_RESP = 0x9033</strong></p> <ul> <li>Sent from the called party to the calling party</li> <li>The called party responds to the call request initiated by the calling party</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct {     unsigned char answer; //0 refuse,1 answer     unsigned char reserved[3]; } SMsgAVIoctrlDoubleVideoCallResp;</code></pre> <h2>2.61 To obtain device SD card status</h2> <p><strong>IOTYPE_USER_IPCAM_SDINFO_REQ = 0x9034</strong></p> <ul> <li>Sent from App to Device</li> <li>App sends a request to obtain device SD card status</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct {     unsigned char reserved[8]; }SMsgAVIoctrlSdInfoReq;</code></pre> <p><strong>IOTYPE_USER_IPCAM_SDINFO_RESP = 0x9035</strong></p> <ul> <li>Sent from Device to App</li> <li>Device informs the App of the SD card status</li> <li>IOCtrl data:</li> </ul> <pre><code class="language-c">typedef struct {     unsigned char state; //0 SD card abnormality, 1 not inserted, 2 inserted     unsigned char reserved[3]; } SMsgAVIoctrlSdInfoResp;</code></pre> <h1>Three. Sample</h1> <h2>3.1 APP implementation obtains light status instance through Command</h2> <ul> <li>Define Command and structure</li> <li>Get the switch status Command definition: IOTYPE_GET_LED_REQ = 0x30000001</li> <li>Get the definition of the switch state structure: @struct SMsgAVIoctrlGetLedReq;</li> </ul> <pre><code class="language-c"> typedef struct { int channel; //Current channel number unsigned char reserved[4]; }SMsgAVIoctrlGetLedReq;</code></pre> <ul> <li>Device end reply APP switch status Command definition: IOTYPE_GET_LED_RESP = 0x30000002</li> <li>Device side reply APP switch status structure definition: @struct SMsgAVIoctrlGetLedResp;</li> </ul> <pre><code class="language-c"> typedef struct { int res; // 0:success, others failed unsigned char isOnOff; // 0:on 1:off unsigned char reserved[3]; }SMsgAVIoctrlGetLedResp;</code></pre> <h2>3.2 Method of sending and receiving Command on IOS</h2> <ul> <li> <p>Method of sending Command</p> <pre><code class="language-c">SMsgAVIoctrlGetLedReq *s = malloc(sizeof(SMsgAVIoctrlGetLedReq)); memset(s, 0, sizeof(SMsgAVIoctrlGetLedReq)); [self.camera KY_SendIOCtrlToChannel:channel Type:IOTYPE_GET_LED_REQ Data:(char *)s DataSize:sizeof(SMsgAVIoctrlGetLedReq)]; free(s);</code></pre> </li> <li>Callback method for receiving Command</li> </ul> <pre><code class="language-c">- (void)KY_DidReceiveIOCtrlWithUid:(NSString *)uid Type:(NSInteger)type Data:(const char*)data DataSize:(NSInteger)size { if (type == IOTYPE_GET_LED_RESP) { SMsgAVIoctrlGetLedResp *s = (SMsgAVIoctrlGetLedResp *)data; isLightOn = s-&amp;amp;isOnOff; } }</code></pre> <h2>3.3 How does Android convert bytes into a java object</h2> <pre><code class="language-c">private class People { int age = 0;//4 bytes means data[0] ~ data[3] long birthday = 1612330883993L;//8 bytes means data[4] ~ data[11] String name = &amp;quot;&amp;quot;;//custom bytes ex: 32 bytes } /** * byte to people * * @param data src bytes length &amp;amp; 44 * @return people */ private People byteToPeople(byte[] data) { if (data.length &amp;lt; 44) { return null; } People p = new People(); p.age = byteArrayToInt(data, 0); p.birthday = byteArrayToLong(data, 4); byte[] name = new byte[32]; System.arraycopy(data, 12, name, 0, 32); p.name = new String(name); return p; } private short byteArrayToShort(byte[] bytes, int beginPos) { return (short) ((0xff &amp;amp;amp; bytes[beginPos]) | ((0xff &amp;amp;amp; bytes[beginPos + 1]) &amp;lt;&amp;lt; 8)); } private int byteArrayToInt(byte[] bytes, int beginPos) { return (0xff &amp;amp;amp; bytes[beginPos]) | (0xff &amp;amp;amp; bytes[beginPos + 1]) &amp;lt;&amp;lt; 8 | (0xff &amp;amp;amp; bytes[beginPos + 2]) &amp;lt;&amp;lt; 16 | (0xff &amp;amp;amp; bytes[beginPos + 3]) &amp;lt;&amp;lt; 24; } private long byteArrayToLong(byte[] bytes, int beginPos) { long l = 0; for (int i = 0; i &amp;lt; 4; i++) { l = l | ((0xffL &amp;amp;amp; bytes[beginPos + i]) &amp;lt;&amp;lt; (8 * i)); } return l; }</code></pre>

页面列表

ITEM_HTML