source: azure_iot_hub_f767zi/trunk/azure_iot_sdk/serializer/src/iotdevice.c@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 19.9 KB
Line 
1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#include <stdlib.h>
5#include "azure_c_shared_utility/gballoc.h"
6
7#include <stdbool.h>
8#include "iotdevice.h"
9#include "datapublisher.h"
10#include "commanddecoder.h"
11#include "azure_c_shared_utility/crt_abstractions.h"
12#include "azure_c_shared_utility/xlogging.h"
13
14#define LOG_DEVICE_ERROR \
15 LogError("(result = %s)", MU_ENUM_TO_STRING(DEVICE_RESULT, result))
16
17
18
19typedef struct DEVICE_HANDLE_DATA_TAG
20{
21 SCHEMA_MODEL_TYPE_HANDLE model;
22 DATA_PUBLISHER_HANDLE dataPublisherHandle;
23 pfDeviceActionCallback deviceActionCallback;
24 void* callbackUserContext;
25 pfDeviceMethodCallback deviceMethodCallback;
26 void* methodCallbackUserContext;
27
28 COMMAND_DECODER_HANDLE commandDecoderHandle;
29} DEVICE_HANDLE_DATA;
30
31MU_DEFINE_ENUM_STRINGS_WITHOUT_INVALID(DEVICE_RESULT, DEVICE_RESULT_VALUES);
32
33static EXECUTE_COMMAND_RESULT DeviceInvokeAction(void* actionCallbackContext, const char* relativeActionPath, const char* actionName, size_t argCount, const AGENT_DATA_TYPE* args)
34{
35 EXECUTE_COMMAND_RESULT result;
36
37 /*Codes_SRS_DEVICE_02_011: [If the parameter actionCallbackContent passed the callback is NULL then the callback shall return EXECUTE_COMMAND_ERROR.] */
38 if (actionCallbackContext == NULL)
39 {
40 result = EXECUTE_COMMAND_ERROR;
41 LogError("(Error code = %s)", MU_ENUM_TO_STRING(DEVICE_RESULT, DEVICE_INVALID_ARG));
42 }
43 else
44 {
45 DEVICE_HANDLE_DATA* device = (DEVICE_HANDLE_DATA*)actionCallbackContext;
46
47 /* Codes_SRS_DEVICE_01_052: [When the action callback passed to CommandDecoder is called, Device shall call the appropriate user callback associated with the device handle.] */
48 /* Codes_SRS_DEVICE_01_055: [The value passed in callbackUserContext when creating the device shall be passed to the callback as the value for the callbackUserContext argument.] */
49 result = device->deviceActionCallback((DEVICE_HANDLE)device, device->callbackUserContext, relativeActionPath, actionName, argCount, args);
50 }
51
52 return result;
53}
54
55static METHODRETURN_HANDLE DeviceInvokeMethod(void* methodCallbackContext, const char* relativeMethodPath, const char* methodName, size_t argCount, const AGENT_DATA_TYPE* args)
56{
57 METHODRETURN_HANDLE result;
58
59 if (methodCallbackContext == NULL)
60 {
61 result = NULL;
62 LogError("(Error code = %s)", MU_ENUM_TO_STRING(DEVICE_RESULT, DEVICE_INVALID_ARG));
63 }
64 else
65 {
66 DEVICE_HANDLE_DATA* device = (DEVICE_HANDLE_DATA*)methodCallbackContext;
67
68 result = device->deviceMethodCallback((DEVICE_HANDLE)device, device->methodCallbackUserContext, relativeMethodPath, methodName, argCount, args);
69 }
70
71 return result;
72}
73
74DEVICE_RESULT Device_Create(SCHEMA_MODEL_TYPE_HANDLE modelHandle, pfDeviceActionCallback deviceActionCallback, void* callbackUserContext, pfDeviceMethodCallback methodCallback, void* methodCallbackContext, bool includePropertyPath, DEVICE_HANDLE* deviceHandle)
75{
76 DEVICE_RESULT result;
77
78 /* Codes_SRS_DEVICE_05_014: [If any of the modelHandle, deviceHandle or deviceActionCallback arguments are NULL, Device_Create shall return DEVICE_INVALID_ARG.]*/
79 if (modelHandle == NULL || deviceHandle == NULL || deviceActionCallback == NULL || methodCallback == NULL || methodCallbackContext == NULL)
80 {
81 result = DEVICE_INVALID_ARG;
82 LOG_DEVICE_ERROR;
83 }
84 else
85 {
86 DEVICE_HANDLE_DATA* device = (DEVICE_HANDLE_DATA*)malloc(sizeof(DEVICE_HANDLE_DATA));
87 if (device == NULL)
88 {
89 /* Codes_SRS_DEVICE_05_015: [If an error occurs while trying to create the device, Device_Create shall return DEVICE_ERROR.] */
90 result = DEVICE_ERROR;
91 LOG_DEVICE_ERROR;
92 }
93 else
94 {
95 /* Codes_SRS_DEVICE_01_018: [Device_Create shall create a DataPublisher instance by calling DataPublisher_Create.] */
96 /* Codes_SRS_DEVICE_01_020: [Device_Create shall pass to DataPublisher_Create the FrontDoor instance obtained earlier.] */
97 /* Codes_SRS_DEVICE_01_004: [DeviceCreate shall pass to DataPublisher_create the includePropertyPath argument.] */
98 if ((device->dataPublisherHandle = DataPublisher_Create(modelHandle, includePropertyPath)) == NULL)
99 {
100 free(device);
101
102 /* Codes_SRS_DEVICE_01_019: [If creating the DataPublisher instance fails, Device_Create shall return DEVICE_DATA_PUBLISHER_FAILED.] */
103 result = DEVICE_DATA_PUBLISHER_FAILED;
104 LOG_DEVICE_ERROR;
105 }
106 else
107 {
108 device->model = modelHandle;
109 device->deviceActionCallback = deviceActionCallback;
110 device->callbackUserContext = callbackUserContext;
111 device->deviceMethodCallback = methodCallback;
112 device->methodCallbackUserContext = methodCallbackContext;
113
114 /* Codes_SRS_DEVICE_01_001: [Device_Create shall create a CommandDecoder instance by calling CommandDecoder_Create and passing to it the model handle.] */
115 /* Codes_SRS_DEVICE_01_002: [Device_Create shall also pass to CommandDecoder_Create a callback to be invoked when a command is received and a context that shall be the device handle.] */
116 if ((device->commandDecoderHandle = CommandDecoder_Create(modelHandle, DeviceInvokeAction, device, DeviceInvokeMethod, device)) == NULL)
117 {
118 DataPublisher_Destroy(device->dataPublisherHandle);
119 free(device);
120
121 /* Codes_SRS_DEVICE_01_003: [If CommandDecoder_Create fails, Device_Create shall return DEVICE_COMMAND_DECODER_FAILED.] */
122 result = DEVICE_COMMAND_DECODER_FAILED;
123 LOG_DEVICE_ERROR;
124 }
125 else
126 {
127 /* Codes_SRS_DEVICE_03_003: [The DEVICE_HANDLE shall be provided via the deviceHandle out argument.] */
128 *deviceHandle = (DEVICE_HANDLE)device;
129 /* Codes_SRS_DEVICE_03_004: [Device_Create shall return DEVICE_OK upon success.] */
130 result = DEVICE_OK;
131 }
132 }
133 }
134 }
135
136 return result;
137}
138
139/* Codes_SRS_DEVICE_03_006: [Device_Destroy shall free all resources associated with a device.] */
140void Device_Destroy(DEVICE_HANDLE deviceHandle)
141{
142 /* Codes_SRS_DEVICE_03_007: [Device_Destroy will not do anything if deviceHandle is NULL.] */
143 if (deviceHandle != NULL)
144 {
145 DEVICE_HANDLE_DATA* device = (DEVICE_HANDLE_DATA*)deviceHandle;
146
147 DataPublisher_Destroy(device->dataPublisherHandle);
148 CommandDecoder_Destroy(device->commandDecoderHandle);
149
150 free(device);
151 }
152}
153
154TRANSACTION_HANDLE Device_StartTransaction(DEVICE_HANDLE deviceHandle)
155{
156 TRANSACTION_HANDLE result;
157
158 /* Codes_SRS_DEVICE_01_035: [If any argument is NULL, Device_StartTransaction shall return NULL.] */
159 if (deviceHandle == NULL)
160 {
161 result = NULL;
162 LogError("(Error code = %s)", MU_ENUM_TO_STRING(DEVICE_RESULT, DEVICE_INVALID_ARG));
163 }
164 else
165 {
166 DEVICE_HANDLE_DATA* deviceInstance = (DEVICE_HANDLE_DATA*)deviceHandle;
167
168 /* Codes_SRS_DEVICE_01_034: [Device_StartTransaction shall invoke DataPublisher_StartTransaction for the DataPublisher handle associated with the deviceHandle argument.] */
169 /* Codes_SRS_DEVICE_01_043: [On success, Device_StartTransaction shall return a non NULL handle.] */
170 /* Codes_SRS_DEVICE_01_048: [When DataPublisher_StartTransaction fails, Device_StartTransaction shall return NULL.] */
171 result = DataPublisher_StartTransaction(deviceInstance->dataPublisherHandle);
172 }
173
174 return result;
175}
176
177DEVICE_RESULT Device_PublishTransacted(TRANSACTION_HANDLE transactionHandle, const char* propertyPath, const AGENT_DATA_TYPE* data)
178{
179 DEVICE_RESULT result;
180
181 /* Codes_SRS_DEVICE_01_037: [If any argument is NULL, Device_PublishTransacted shall return DEVICE_INVALID_ARG.] */
182 if (
183 (transactionHandle == NULL) ||
184 (propertyPath == NULL) ||
185 (data == NULL)
186 )
187 {
188 result = DEVICE_INVALID_ARG;
189 LOG_DEVICE_ERROR;
190 }
191 /* Codes_SRS_DEVICE_01_036: [Device_PublishTransacted shall invoke DataPublisher_PublishTransacted.] */
192 else if (DataPublisher_PublishTransacted(transactionHandle, propertyPath, data) != DATA_PUBLISHER_OK)
193 {
194 /* Codes_SRS_DEVICE_01_049: [When DataPublisher_PublishTransacted fails, Device_PublishTransacted shall return DEVICE_DATA_PUBLISHER_FAILED.] */
195 result = DEVICE_DATA_PUBLISHER_FAILED;
196 LOG_DEVICE_ERROR;
197 }
198 else
199 {
200 /* Codes_SRS_DEVICE_01_044: [On success, Device_PublishTransacted shall return DEVICE_OK.] */
201 result = DEVICE_OK;
202 }
203
204 return result;
205}
206
207DEVICE_RESULT Device_EndTransaction(TRANSACTION_HANDLE transactionHandle, unsigned char** destination, size_t* destinationSize)
208{
209 DEVICE_RESULT result;
210
211 /* Codes_SRS_DEVICE_01_039: [If any parameter is NULL, Device_EndTransaction shall return DEVICE_INVALID_ARG.]*/
212 if (
213 (transactionHandle == NULL) ||
214 (destination == NULL) ||
215 (destinationSize == NULL)
216 )
217 {
218 result = DEVICE_INVALID_ARG;
219 LOG_DEVICE_ERROR;
220 }
221 /* Codes_SRS_DEVICE_01_038: [Device_EndTransaction shall invoke DataPublisher_EndTransaction.] */
222 else if (DataPublisher_EndTransaction(transactionHandle, destination, destinationSize) != DATA_PUBLISHER_OK)
223 {
224 /* Codes_SRS_DEVICE_01_050: [When DataPublisher_EndTransaction fails, Device_EndTransaction shall return DEVICE_DATA_PUBLISHER_FAILED.] */
225 result = DEVICE_DATA_PUBLISHER_FAILED;
226 LOG_DEVICE_ERROR;
227 }
228 else
229 {
230 /* Codes_SRS_DEVICE_01_045: [On success, Device_EndTransaction shall return DEVICE_OK.] */
231 result = DEVICE_OK;
232 }
233
234 return result;
235}
236
237DEVICE_RESULT Device_CancelTransaction(TRANSACTION_HANDLE transactionHandle)
238{
239 DEVICE_RESULT result;
240
241 /* Codes_SRS_DEVICE_01_041: [If any argument is NULL, Device_CancelTransaction shall return DEVICE_INVALID_ARG.] */
242 if (transactionHandle == NULL)
243 {
244 result = DEVICE_INVALID_ARG;
245 LOG_DEVICE_ERROR;
246 }
247 /* Codes_SRS_DEVICE_01_040: [Device_CancelTransaction shall invoke DataPublisher_CancelTransaction.] */
248 else if (DataPublisher_CancelTransaction(transactionHandle) != DATA_PUBLISHER_OK)
249 {
250 /* Codes_SRS_DEVICE_01_051: [When DataPublisher_CancelTransaction fails, Device_CancelTransaction shall return DEVICE_DATA_PUBLISHER_FAILED.] */
251 result = DEVICE_DATA_PUBLISHER_FAILED;
252 LOG_DEVICE_ERROR;
253 }
254 else
255 {
256 /* Codes_SRS_DEVICE_01_046: [On success, Device_PublishTransacted shall return DEVICE_OK.] */
257 result = DEVICE_OK;
258 }
259
260 return result;
261}
262
263EXECUTE_COMMAND_RESULT Device_ExecuteCommand(DEVICE_HANDLE deviceHandle, const char* command)
264{
265 EXECUTE_COMMAND_RESULT result;
266 /*Codes_SRS_DEVICE_02_012: [If any parameters are NULL, then Device_ExecuteCommand shall return EXECUTE_COMMAND_ERROR.] */
267 if (
268 (deviceHandle == NULL) ||
269 (command == NULL)
270 )
271 {
272 result = EXECUTE_COMMAND_ERROR;
273 LogError("invalid parameter (NULL passed to Device_ExecuteCommand DEVICE_HANDLE deviceHandle=%p, const char* command=%p", deviceHandle, command);
274 }
275 else
276 {
277 /*Codes_SRS_DEVICE_02_013: [Otherwise, Device_ExecuteCommand shall call CommandDecoder_ExecuteCommand and return what CommandDecoder_ExecuteCommand is returning.] */
278 DEVICE_HANDLE_DATA* device = (DEVICE_HANDLE_DATA*)deviceHandle;
279 result = CommandDecoder_ExecuteCommand(device->commandDecoderHandle, command);
280 }
281 return result;
282}
283
284METHODRETURN_HANDLE Device_ExecuteMethod(DEVICE_HANDLE deviceHandle, const char* methodName, const char* methodPayload)
285{
286 METHODRETURN_HANDLE result;
287 if (
288 (deviceHandle == NULL) ||
289 (methodName == NULL) /*methodPayload can be NULL*/
290 )
291 {
292 result = NULL;
293 LogError("invalid parameter (NULL passed to Device_ExecuteMethod DEVICE_HANDLE deviceHandle=%p, const char* methodPayload=%p", deviceHandle, methodPayload);
294 }
295 else
296 {
297 DEVICE_HANDLE_DATA* device = (DEVICE_HANDLE_DATA*)deviceHandle;
298 result = CommandDecoder_ExecuteMethod(device->commandDecoderHandle, methodName, methodPayload);
299 }
300 return result;
301}
302
303REPORTED_PROPERTIES_TRANSACTION_HANDLE Device_CreateTransaction_ReportedProperties(DEVICE_HANDLE deviceHandle)
304{
305 REPORTED_PROPERTIES_TRANSACTION_HANDLE result;
306
307 /*Codes_SRS_DEVICE_02_014: [ If argument deviceHandle is NULL then Device_CreateTransaction_ReportedProperties shall fail and return NULL. ]*/
308 if (deviceHandle == NULL)
309 {
310 LogError("invalid argument DEVICE_HANDLE deviceHandle=%p", deviceHandle);
311 result = NULL;
312 }
313 else
314 {
315 DEVICE_HANDLE_DATA* deviceInstance = (DEVICE_HANDLE_DATA*)deviceHandle;
316 /*Codes_SRS_DEVICE_02_015: [ Otherwise, Device_CreateTransaction_ReportedProperties shall call DataPublisher_CreateTransaction_ReportedProperties. ]*/
317 /*Codes_SRS_DEVICE_02_016: [ If DataPublisher_CreateTransaction_ReportedProperties fails then Device_CreateTransaction_ReportedProperties shall fail and return NULL. ]*/
318 /*Codes_SRS_DEVICE_02_017: [ Otherwise Device_CreateTransaction_ReportedProperties shall succeed and return a non-NULL value. ]*/
319 result = DataPublisher_CreateTransaction_ReportedProperties(deviceInstance->dataPublisherHandle);
320 if (result == NULL)
321 {
322 LogError("unable to DataPublisher_CreateTransaction_ReportedProperties");
323 /*return as is*/
324 }
325 else
326 {
327 /*return as is*/
328 }
329 }
330
331 return result;
332}
333
334DEVICE_RESULT Device_PublishTransacted_ReportedProperty(REPORTED_PROPERTIES_TRANSACTION_HANDLE transactionHandle, const char* reportedPropertyPath, const AGENT_DATA_TYPE* data)
335{
336 DEVICE_RESULT result;
337 /*Codes_SRS_DEVICE_02_018: [ If argument transactionHandle is NULL then Device_PublishTransacted_ReportedProperty shall fail and return DEVICE_INVALID_ARG. ]*/
338 /*Codes_SRS_DEVICE_02_019: [ If argument reportedPropertyPath is NULL then Device_PublishTransacted_ReportedProperty shall fail and return DEVICE_INVALID_ARG. ]*/
339 /*Codes_SRS_DEVICE_02_020: [ If argument data is NULL then Device_PublishTransacted_ReportedProperty shall fail and return DEVICE_INVALID_ARG. ]*/
340 if (
341 (transactionHandle == NULL) ||
342 (reportedPropertyPath == NULL) ||
343 (data == NULL)
344 )
345 {
346 LogError("invalid argument REPORTED_PROPERTIES_TRANSACTION_HANDLE transactionHandle=%p, const char* reportedPropertyPath=%s, const AGENT_DATA_TYPE* data=%p", transactionHandle, reportedPropertyPath, data);
347 result = DEVICE_INVALID_ARG;
348 }
349 else
350 {
351 /*Codes_SRS_DEVICE_02_021: [ Device_PublishTransacted_ReportedProperty shall call DataPublisher_PublishTransacted_ReportedProperty. ]*/
352 DATA_PUBLISHER_RESULT r = DataPublisher_PublishTransacted_ReportedProperty(transactionHandle, reportedPropertyPath, data);
353 if (r != DATA_PUBLISHER_OK)
354 {
355 LogError("unable to DataPublisher_PublishTransacted_ReportedProperty");
356 /*Codes_SRS_DEVICE_02_022: [ If DataPublisher_PublishTransacted_ReportedProperty fails then Device_PublishTransacted_ReportedProperty shall fail and return DEVICE_DATA_PUBLISHER_FAILED. ]*/
357 result = DEVICE_DATA_PUBLISHER_FAILED;
358 }
359 else
360 {
361 /*Codes_SRS_DEVICE_02_023: [ Otherwise, Device_PublishTransacted_ReportedProperty shall succeed and return DEVICE_OK. ]*/
362 result = DEVICE_OK;
363 }
364 }
365 return result;
366}
367
368DEVICE_RESULT Device_CommitTransaction_ReportedProperties(REPORTED_PROPERTIES_TRANSACTION_HANDLE transactionHandle, unsigned char** destination, size_t* destinationSize)
369{
370 DEVICE_RESULT result;
371
372 /*Codes_SRS_DEVICE_02_024: [ If argument transactionHandle is NULL then Device_CommitTransaction_ReportedProperties shall fail and return DEVICE_INVALID_ARG. ]*/
373 /*Codes_SRS_DEVICE_02_025: [ If argument destination is NULL then Device_CommitTransaction_ReportedProperties shall fail and return DEVICE_INVALID_ARG. ]*/
374 /*Codes_SRS_DEVICE_02_026: [ If argument destinationSize is NULL then Device_CommitTransaction_ReportedProperties shall fail and return DEVICE_INVALID_ARG. ]*/
375 if (
376 (transactionHandle == NULL) ||
377 (destination == NULL) ||
378 (destinationSize == NULL)
379 )
380 {
381 LogError("invalid argument REPORTED_PROPERTIES_TRANSACTION_HANDLE transactionHandle=%p, unsigned char** destination=%p, size_t* destinationSize=%p", transactionHandle, destination, destinationSize);
382 result = DEVICE_INVALID_ARG;
383 }
384 else
385 {
386 /*Codes_SRS_DEVICE_02_027: [ Device_CommitTransaction_ReportedProperties shall call DataPublisher_CommitTransaction_ReportedProperties. ]*/
387 DATA_PUBLISHER_RESULT r = DataPublisher_CommitTransaction_ReportedProperties(transactionHandle, destination, destinationSize);
388
389 /*Codes_SRS_DEVICE_02_028: [ If DataPublisher_CommitTransaction_ReportedProperties fails then Device_CommitTransaction_ReportedProperties shall fail and return DEVICE_DATA_PUBLISHER_FAILED. ]*/
390 if (r != DATA_PUBLISHER_OK)
391 {
392 LogError("unable to DataPublisher_CommitTransaction_ReportedProperties");
393 result = DEVICE_DATA_PUBLISHER_FAILED;
394 }
395 else
396 {
397 /*Codes_SRS_DEVICE_02_029: [ Otherwise Device_CommitTransaction_ReportedProperties shall succeed and return DEVICE_OK. ]*/
398 result = DEVICE_OK;
399 }
400 }
401 return result;
402}
403
404void Device_DestroyTransaction_ReportedProperties(REPORTED_PROPERTIES_TRANSACTION_HANDLE transactionHandle)
405{
406 /*Codes_SRS_DEVICE_02_030: [ If argument transactionHandle is NULL then Device_DestroyTransaction_ReportedProperties shall return. ]*/
407 if (transactionHandle == NULL)
408 {
409 LogError("invalid argument REPORTED_PROPERTIES_TRANSACTION_HANDLE transactionHandle=%p", transactionHandle);
410 }
411 else
412 {
413 /*Codes_SRS_DEVICE_02_031: [ Otherwise Device_DestroyTransaction_ReportedProperties shall free all used resources. ]*/
414 DataPublisher_DestroyTransaction_ReportedProperties(transactionHandle);
415 }
416}
417
418DEVICE_RESULT Device_IngestDesiredProperties(void* startAddress, DEVICE_HANDLE deviceHandle, const char* jsonPayload, bool parseDesiredNode)
419{
420 DEVICE_RESULT result;
421 /*Codes_SRS_DEVICE_02_032: [ If deviceHandle is NULL then Device_IngestDesiredProperties shall fail and return DEVICE_INVALID_ARG. ]*/
422 /*Codes_SRS_DEVICE_02_033: [ If jsonPayload is NULL then Device_IngestDesiredProperties shall fail and return DEVICE_INVALID_ARG. ]*/
423 /*Codes_SRS_DEVICE_02_037: [ If startAddress is NULL then Device_IngestDesiredProperties shall fail and return DEVICE_INVALID_ARG. ]*/
424 if (
425 (deviceHandle == NULL) ||
426 (jsonPayload == NULL) ||
427 (startAddress == NULL)
428 )
429 {
430 LogError("invalid argument void* startAddress=%p, DEVICE_HANDLE deviceHandle=%p, const char* jsonPayload=%p\n", startAddress, deviceHandle, jsonPayload);
431 result = DEVICE_INVALID_ARG;
432 }
433 else
434 {
435 /*Codes_SRS_DEVICE_02_034: [ Device_IngestDesiredProperties shall call CommandDecoder_IngestDesiredProperties. ]*/
436 DEVICE_HANDLE_DATA* device = (DEVICE_HANDLE_DATA*)deviceHandle;
437 if (CommandDecoder_IngestDesiredProperties(startAddress, device->commandDecoderHandle, jsonPayload, parseDesiredNode) != EXECUTE_COMMAND_SUCCESS)
438 {
439 /*Codes_SRS_DEVICE_02_035: [ If any failure happens then Device_IngestDesiredProperties shall fail and return DEVICE_ERROR. ]*/
440 LogError("failure in CommandDecoder_IngestDesiredProperties");
441 result = DEVICE_ERROR;
442 }
443 else
444 {
445 /*Codes_SRS_DEVICE_02_036: [ Otherwise, Device_IngestDesiredProperties shall succeed and return DEVICE_OK. ]*/
446 result = DEVICE_OK;
447 }
448 }
449 return result;
450}
Note: See TracBrowser for help on using the repository browser.