You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* mainStream - video config describes frame rate, codec, bitrate and image size of main stream
74
-
* subStream - same for substream
75
-
* image - image rotation
76
-
* detector - motion detector state
77
-
* osd - OSD visibility
78
-
* nightMode - enable or disable night mode
79
-
* customConfig - here can be stored any other necessary settings in json format
66
+
#### ClientSettings description
67
+
* cameraModel - camera model name ("MyModel")
68
+
* cameraVendor - device manufacturer ("Vision")
69
+
* serialNumber - unique stable camera serial number
70
+
* appVersion - version of the applcation using library ("1.0.0")
71
+
* firmwareVersion - camera firmware version ("Camera_1.0.3")
72
+
* hardwareId - information about hardware, such as processor and sensor ("t31_gc2053")
73
+
* certFilePath - path to the SSL certificate file, used in HTTPS connections ("/etc/ssl/certs/ca-certificates.crt")
74
+
* confFilePath - path to the file in the writable location where library will store it's state ("/etc/faceter-camera.conf")
75
+
* rtspMainUrl - main stream RTSP url without credentials ("rtsp://127.0.0.1/stream=0")
76
+
Library currently supports only video codec H264 and audio codec AAC
77
+
* rtspSubUrl - second RTSP stream, could be empty
78
+
* rtspCredentials - user name and password for acessing RTSP stream ("root:12345")
80
79
81
80
### Registration
82
81
83
82
WiFi cameras require QR scanner. Also connection to WiFi network with ssid and password should be implemented. Registration process in this case consists of 3 steps:
84
-
1. Library sends operation code **ControlCodeScanQr** with _not NULL_ parameter to start QR scanner
83
+
1. Library sends operation code **ControlCodeStartScanQr** to start QR scanner
85
84
86
85
```
87
-
case ControlCodeScanQr: {
88
-
if (param != NULL) {
89
-
//start QR code scanning
90
-
QrScannerStart();
91
-
} else {
92
-
//stop QR code scanning
93
-
QrScannerStop();
94
-
}
95
-
break;
86
+
case ControlCodeStartScanQr: {
87
+
//start QR code scanning
88
+
QrScannerStart();
89
+
break;
96
90
}
97
91
```
98
92
@@ -107,7 +101,15 @@ WiFi cameras require QR scanner. Also connection to WiFi network with ssid and p
107
101
}
108
102
```
109
103
110
-
4. If QR code is correct, code **ControlCodeScanQr** with _NULL_ parameter will be sent to stop QR scanner
104
+
4. If QR code is correct, code **ControlCodeStopScanQr** will be sent to stop QR scanner
105
+
106
+
```
107
+
case ControlCodeStopScanQr: {
108
+
//stop QR code scanning
109
+
QrScannerStop();
110
+
break;
111
+
}
112
+
```
111
113
5. Library will sent **ControlCodeSetupWifi** with param _WifiConfig*_ to setup WiFi network
112
114
113
115
```
@@ -138,19 +140,21 @@ Library will send control code ControlCodeMicrophone
138
140
//control handler fragment
139
141
...
140
142
case ControlCodeMicrophone: {
141
-
//control microphone
142
-
if (param != NULL) {
143
-
//enable microphone on camera
144
-
} else {
145
-
//disable microphone on camera
146
-
}
147
-
break;
148
-
}
143
+
//control microphone
144
+
AudioConfig* audioConfig = (AudioConfig*)param;
145
+
if (audioConfig->micEnabled) {
146
+
//enable microphone on camera
147
+
} else {
148
+
//disable microphone on camera
149
+
}
150
+
break;
151
+
}
149
152
```
150
153
After operation completes application must call `FaceterClientSetControlStatus(controlCode, statusCode)`
151
154
where statusCode is **StatusCodeOk** if operation succeed or other on fail.
152
-
If operation not supported statusCode can be set to **StatusCodeNotSupported**.
153
-
For example if camera not supports playing audio, it will return status without processing operation
155
+
If operation not supported statusCode **MUST** be set to **StatusCodeNotSupported**.
156
+
if operation not implemented yet use **StatusCodeNotImplemented**.
157
+
For example if camera not supports audio playback, it will return status without processing operation
154
158
```
155
159
case ControlCodePlayAudio: {
156
160
//play audio PCM buffer
@@ -159,20 +163,110 @@ case ControlCodePlayAudio: {
159
163
break;
160
164
}
161
165
```
166
+
If camera can play audio - status code will be **StatusCodeOk**
167
+
```
168
+
case ControlCodePlayAudio: {
169
+
//play audio PCM buffer
170
+
BufferParam* audioBuffer = (BufferParam*)param;
171
+
PlayAudio(audioBuffer);
172
+
statusCode = StatusCodeOk;
173
+
break;
174
+
}
175
+
```
162
176
163
177
### Motion detection events
164
178
165
-
When Motion Detector on camera detects motions events, they should be passed to library with `FaceterClientOnMotion`
179
+
When Motion Detector on camera detects motions events, they should be passed to library with `FaceterClientOnVideoEvent`.
+**Registration reset** - if camera has _RESET_ button it can be used to reset registration state to initial.
195
289
When button _RESET_ pressed longer than 3 seconds, apllication should call `FaceterClientReset` and reboot camera.
196
290
197
-
```
198
-
/*
199
-
* Handler of reset button pressed more than 3 seconds
200
-
*/
201
-
void OnResetButtonPressed()
202
-
{
203
-
//reset registration
204
-
FaceterClientReset();
205
-
RebootSystem();
206
-
}
207
-
```
291
+
```
292
+
/*
293
+
* Handler of reset button pressed more than 3 seconds
294
+
*/
295
+
void OnResetButtonPressed()
296
+
{
297
+
//reset registration
298
+
FaceterClientReset();
299
+
RebootSystem();
300
+
}
301
+
```
208
302
209
-
Also for resetting registration state library can call ControlFunction with **ControlCodeRestartCamera** and _not NULL_ param
303
+
Also for resetting registration state library can call ControlFunction with **ControlCodeResetState**
210
304
211
-
```
212
-
case ControlCodeRestartCamera: {
213
-
if (param != NULL) {
214
-
OnResetButtonPressed();
215
-
} else {
216
-
RebootSystem();
217
-
}
218
-
break;
219
-
}
220
-
```
305
+
```
306
+
case ControlCodeResetState: {
307
+
//reset registration state to initial
308
+
OnResetButtonPressed();
309
+
break;
310
+
}
311
+
```
221
312
+**Serial number** - unique serial number needed for camera identification.
222
-
Application must provide serial number string that will be the same after camera restarted. If no serial number provided camera will use MAC address as serial number
313
+
Application must provide serial number string that will be the same after camera restarted. If no serial number provided SDK will use MAC address for identification instead
223
314
+**LED indication** - if camera has LED indicators they can be used to inform USER about current camera streaming state.
224
315
Current state will be updated with ControlFunction code **ControlCodeStreamStatus**. If camera has two LED with different colors they should be used as follows
225
316
```
@@ -237,6 +328,16 @@ Application must provide these service functions if they supported:
237
328
```
238
329
Where **green** LED is main indication color (could be any supported color) and **red** is additional color (if present)
239
330
331
+
+**OTA firmware update** - after command from Faceter application SDK will download and save firmware update
332
+
to '/tmp' directory and then call ControlFunction with code **ControlCodeUpdateFirmware** and path to the file as param
333
+
```
334
+
case ControlCodeUpdateFirmware: {
335
+
//upgrade firmware from file in tmp dir
336
+
char* firmwareUpdate = (char*)param;
337
+
break;
338
+
}
339
+
```
340
+
240
341
## Library dependencies
241
342
242
343
Faceter CloudCam SDK depends on external libraries
0 commit comments