Skip to content

Commit 07a4e83

Browse files
vronchettiVictor Ronchetti
vronchetti
authored and
Victor Ronchetti
committed
Get Counters - AVB Interface, Clock Domain, Stream Input (+2 squashed commits)
Squashed commits: [a139745] gitignore update for Doxygen update [be824c9] comment error in cmdline.h
1 parent 8938908 commit 07a4e83

19 files changed

+56
-88
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.DS_Store
22

3+
# Ignore Doxygen sub directories
4+
html/
5+
latex/
6+
37
# Compiled Object files
48
*.slo
59
*.lo

controller/app/cmdline/src/cmd_line.cpp

+11-15
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363
#include "cli_command.h"
6464
#include "cli_command_format.h"
6565

66-
67-
6866
#if defined _WIN32 || defined _WIN64
6967
#ifdef _MSC_VER
7068
#define strtoull(str, end, base) _strtoui64 (str, end, base)
@@ -1345,7 +1343,6 @@ int cmd_line::cmd_view_details(int total_matched, std::vector<cli_argument*> arg
13451343
atomic_cout << "Configuration: " << end_station->get_current_config_index() << std::endl;
13461344
atomic_cout << "------------------------------------------------------------------------------" << std::endl;
13471345

1348-
13491346
switch(0)
13501347
{
13511348
case avdecc_lib::AEM_DESC_ENTITY:
@@ -1543,8 +1540,7 @@ int cmd_line::cmd_view_details(int total_matched, std::vector<cli_argument*> arg
15431540
do_view_descriptor(desc_name, desc_index);
15441541
}
15451542

1546-
1547-
break;
1543+
break;
15481544
}
15491545

15501546
return 0;
@@ -3097,20 +3093,20 @@ int cmd_line::cmd_get_counters(int total_matched, std::vector<cli_argument*> arg
30973093

30983094
if(status == avdecc_lib::AEM_STATUS_SUCCESS)
30993095
{
3100-
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_LINK_UP))
3101-
atomic_cout << "Link up Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_LINK_UP)
3096+
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_INTERFACE_LINK_UP))
3097+
atomic_cout << "Link up Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_INTERFACE_LINK_UP)
31023098
<< std::endl;
3103-
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_LINK_DOWN))
3104-
atomic_cout << "Link down Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_LINK_DOWN)
3099+
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_INTERFACE_LINK_DOWN))
3100+
atomic_cout << "Link down Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_INTERFACE_LINK_DOWN)
31053101
<< std::endl;
3106-
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_FRAMES_TX))
3107-
atomic_cout << "Link up Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_FRAMES_TX)
3102+
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_INTERFACE_FRAMES_TX))
3103+
atomic_cout << "Link up Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_INTERFACE_FRAMES_TX)
31083104
<< std::endl;
3109-
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_FRAMES_RX))
3110-
atomic_cout << "Link down Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_FRAMES_RX)
3105+
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_INTERFACE_FRAMES_RX))
3106+
atomic_cout << "Link down Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_INTERFACE_FRAMES_RX)
31113107
<< std::endl;
3112-
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_RX_CRC_ERROR))
3113-
atomic_cout << "Link up Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_RX_CRC_ERROR)
3108+
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_INTERFACE_RX_CRC_ERROR))
3109+
atomic_cout << "Link up Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_INTERFACE_RX_CRC_ERROR)
31143110
<< std::endl;
31153111
if(avb_desc_ref->get_counters_valid(avdecc_lib::AVB_GPTP_GM_CHANGED))
31163112
atomic_cout << "Link down Counter: " << avb_desc_ref->get_counters_by_name(avdecc_lib::AVB_GPTP_GM_CHANGED)

controller/app/cmdline/src/cmd_line.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class cmd_line
320320
int cmd_get_sampling_rate(int total_matched, std::vector<cli_argument*> args);
321321

322322
/**
323-
* Send a GET_COUNTERS command to get the current sampling rate of a port or unit.
323+
* Send a GET_COUNTERS command to get the current counters of a descriptor.
324324
*/
325325
int cmd_get_counters(int total_matched, std::vector<cli_argument*> args);
326326

controller/lib/include/avb_interface_descriptor.h

+4
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,15 @@ namespace avdecc_lib
117117
AVDECC_CONTROLLER_LIB32_API virtual int STDCALL send_get_counters_cmd(void *notification_id) = 0;
118118

119119
/**
120+
* \param name avdecc_lib::counter_labels
121+
*
120122
* \return the avb counters valid after the GET_COUNTERS command.
121123
*/
122124
AVDECC_CONTROLLER_LIB32_API virtual uint32_t STDCALL get_counters_valid(int name) = 0;
123125

124126
/**
127+
* \param name avdecc_lib::counter_labels
128+
*
125129
* \return the avb counters by name after the GET_COUNTERS command.
126130
*/
127131
AVDECC_CONTROLLER_LIB32_API virtual uint32_t STDCALL get_counters_by_name(int name) = 0;

controller/lib/include/clock_domain_descriptor.h

+4
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,15 @@ namespace avdecc_lib
103103
AVDECC_CONTROLLER_LIB32_API virtual int STDCALL send_get_counters_cmd(void *notification_id) = 0;
104104

105105
/**
106+
* \param name avdecc_lib::counter_labels
107+
*
106108
* \return the clock_domain counters after the GET_COUNTERS command.
107109
*/
108110
AVDECC_CONTROLLER_LIB32_API virtual uint32_t STDCALL get_counters_valid(int name) = 0;
109111

110112
/**
113+
* \param name avdecc_lib::counter_labels
114+
*
111115
* \return the clock_domain counters block after the GET_COUNTERS command.
112116
*/
113117
AVDECC_CONTROLLER_LIB32_API virtual uint32_t STDCALL get_counters_by_name(int name) = 0;

controller/lib/include/descriptor_base.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace avdecc_lib
7777
* \return The flags after sending a ACQUIRE_ENTITY command and receiving a response back for the command.
7878
*/
7979
AVDECC_CONTROLLER_LIB32_API virtual uint32_t STDCALL acquire_entity_flags() = 0;
80-
80+
8181
/**
8282
* \return The owner id after sending a ACQUIRE_ENTITY command and receiving a response back for the command.
8383
*/

controller/lib/include/enumeration.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,13 @@ namespace avdecc_lib
289289
TOTAL_NUM_OF_LOGGING_LEVELS = 6
290290
};
291291

292-
enum counter_labels
292+
enum counter_labels ///Counter Labels for GET_COUNTERS command
293293
{
294-
AVB_LINK_UP,
295-
AVB_LINK_DOWN,
296-
AVB_FRAMES_TX,
297-
AVB_FRAMES_RX,
298-
AVB_RX_CRC_ERROR,
294+
AVB_INTERFACE_LINK_UP,
295+
AVB_INTERFACE_LINK_DOWN,
296+
AVB_INTERFACE_FRAMES_TX,
297+
AVB_INTERFACE_FRAMES_RX,
298+
AVB_INTERFACE_RX_CRC_ERROR,
299299
AVB_GPTP_GM_CHANGED,
300300
CLOCK_DOMAIN_LOCKED,
301301
CLOCK_DOMAIN_UNLOCKED,

controller/lib/include/stream_input_descriptor.h

+4
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,15 @@ namespace avdecc_lib
374374
AVDECC_CONTROLLER_LIB32_API virtual int STDCALL send_get_counters_cmd(void *notification_id) = 0;
375375

376376
/**
377+
* \param name avdecc_lib::counter_labels
378+
*
377379
* \return the stream_input counters valid after the GET_COUNTERS command.
378380
*/
379381
AVDECC_CONTROLLER_LIB32_API virtual uint32_t STDCALL get_counters_valid(int name) = 0;
380382

381383
/**
384+
* \param name avdecc_lib::counter_labels
385+
*
382386
* \return the stream_input counters after the GET_COUNTERS command.
383387
*/
384388
AVDECC_CONTROLLER_LIB32_API virtual uint32_t STDCALL get_counters_by_name(int name) = 0;

controller/lib/src/aecp_controller_state_machine.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ namespace avdecc_lib
406406
break;
407407

408408
case JDKSAVDECC_AEM_COMMAND_GET_COUNTERS:
409-
desc_type = jdksavdecc_aem_command_get_counters_response_get_descriptor_type(frame,ETHER_HDR_SIZE);
410-
desc_index = jdksavdecc_aem_command_get_counters_response_get_descriptor_index(frame,ETHER_HDR_SIZE);
409+
desc_type = jdksavdecc_aem_command_get_counters_response_get_descriptor_type(frame, ETHER_HDR_SIZE);
410+
desc_index = jdksavdecc_aem_command_get_counters_response_get_descriptor_index(frame, ETHER_HDR_SIZE);
411411
break;
412412

413413
case JDKSAVDECC_AEM_COMMAND_REGISTER_UNSOLICITED_NOTIFICATION:

controller/lib/src/avb_interface_descriptor_imp.cpp

+10-22
Original file line numberDiff line numberDiff line change
@@ -230,24 +230,18 @@ namespace avdecc_lib
230230
{
231231
switch(name)
232232
{
233-
case AVB_LINK_UP:
233+
case AVB_INTERFACE_LINK_UP:
234234
return counters_response.counters_block[0];
235-
break;
236-
case AVB_LINK_DOWN:
235+
case AVB_INTERFACE_LINK_DOWN:
237236
return counters_response.counters_block[1];
238-
break;
239-
case AVB_FRAMES_TX:
237+
case AVB_INTERFACE_FRAMES_TX:
240238
return counters_response.counters_block[2];
241-
break;
242-
case AVB_FRAMES_RX:
239+
case AVB_INTERFACE_FRAMES_RX:
243240
return counters_response.counters_block[3];
244-
break;
245-
case AVB_RX_CRC_ERROR:
241+
case AVB_INTERFACE_RX_CRC_ERROR:
246242
return counters_response.counters_block[4];
247-
break;
248243
case AVB_GPTP_GM_CHANGED:
249244
return counters_response.counters_block[5];
250-
break;
251245
}
252246
return 0;
253247
}
@@ -256,24 +250,18 @@ namespace avdecc_lib
256250
{
257251
switch(name)
258252
{
259-
case AVB_LINK_UP:
253+
case AVB_INTERFACE_LINK_UP:
260254
return aem_cmd_get_counters_resp.counters_valid & 0x01;
261-
break;
262-
case AVB_LINK_DOWN:
255+
case AVB_INTERFACE_LINK_DOWN:
263256
return aem_cmd_get_counters_resp.counters_valid >> 1 & 0x01;
264-
break;
265-
case AVB_FRAMES_TX:
257+
case AVB_INTERFACE_FRAMES_TX:
266258
return aem_cmd_get_counters_resp.counters_valid >> 2 & 0x01;
267-
break;
268-
case AVB_FRAMES_RX:
259+
case AVB_INTERFACE_FRAMES_RX:
269260
return aem_cmd_get_counters_resp.counters_valid >> 3 & 0x01;
270-
break;
271-
case AVB_RX_CRC_ERROR:
261+
case AVB_INTERFACE_RX_CRC_ERROR:
272262
return aem_cmd_get_counters_resp.counters_valid >> 4 & 0x01;
273-
break;
274263
case AVB_GPTP_GM_CHANGED:
275264
return aem_cmd_get_counters_resp.counters_valid >> 5 & 0x01;
276-
break;
277265
}
278266
return 0;
279267
}

controller/lib/src/avb_interface_descriptor_imp.h

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "descriptor_base_imp.h"
3333
#include "avb_interface_descriptor.h"
3434

35-
3635
namespace avdecc_lib
3736
{
3837
class avb_interface_descriptor_imp : public avb_interface_descriptor, public virtual descriptor_base_imp

controller/lib/src/clock_domain_descriptor_imp.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,8 @@ namespace avdecc_lib
362362
{
363363
case CLOCK_DOMAIN_LOCKED:
364364
return counters_response.counters_block[0];
365-
break;
366365
case CLOCK_DOMAIN_UNLOCKED:
367366
return counters_response.counters_block[1];
368-
break;
369367
}
370368
return 0;
371369
}
@@ -376,10 +374,8 @@ namespace avdecc_lib
376374
{
377375
case CLOCK_DOMAIN_LOCKED:
378376
return aem_cmd_get_counters_resp.counters_valid & 0x01;
379-
break;
380377
case CLOCK_DOMAIN_UNLOCKED:
381378
return aem_cmd_get_counters_resp.counters_valid >> 1 & 0x01;
382-
break;
383379
}
384380
return 0;
385381
}

controller/lib/src/controller_imp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace avdecc_lib
4444
* Find an end station that matches the entity and controller IDs
4545
*/
4646
int find_in_end_station(struct jdksavdecc_eui64 &entity_entity_id, const uint8_t *frame);
47-
47+
4848
public:
4949
/**
5050
* A constructor for controller_imp used for constructing an object with notification, and post_log_msg callback functions.

controller/lib/src/descriptor_base_imp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace avdecc_lib
9090
* Get the locked entity id after sending a LOCK_ENTITY command and receiving a response back for the command.
9191
*/
9292
virtual uint64_t STDCALL lock_entity_locked_entity_id();
93-
93+
9494
virtual int STDCALL send_acquire_entity_cmd(void *notification_id, uint32_t acquire_entity_flag);
9595
virtual int proc_acquire_entity_resp(void *&notification_id, const uint8_t *frame, size_t frame_len, int &status);
9696

controller/lib/src/end_station_imp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace avdecc_lib
6565

6666
adp *adp_ref; // ADP associated with the End Station
6767
std::vector<entity_descriptor_imp *> entity_desc_vec; // Store a list of ENTITY descriptor objects
68-
68+
6969
void queue_background_read_request(uint16_t desc_type, uint16_t desc_base_index, uint16_t count); ///< Generate "count" read requests
7070
void background_read_deduce_next(configuration_descriptor *cd, uint16_t desc_type, void *frame, ssize_t pos); ///< Deduce what else needs to be read from the rx'd frame
7171
void background_read_update_inflight(uint16_t desc_type, void *frame, ssize_t read_desc_offset); ///< Remove rx'd frame from background read inflight list

controller/lib/src/entity_descriptor_imp.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace avdecc_lib
5656
delete config_desc_vec.at(config_vec_index);
5757
}
5858
}
59-
59+
6060
uint16_t STDCALL entity_descriptor_imp::descriptor_type() const
6161
{
6262
assert(entity_desc.descriptor_type == JDKSAVDECC_DESCRIPTOR_ENTITY);
@@ -138,7 +138,7 @@ namespace avdecc_lib
138138
{
139139
return entity_desc.model_name_string;
140140
}
141-
141+
142142
uint8_t * STDCALL entity_descriptor_imp::firmware_version()
143143
{
144144
return entity_desc.firmware_version.value;
@@ -268,4 +268,4 @@ namespace avdecc_lib
268268

269269
return 0;
270270
}
271-
}
271+
}

controller/lib/src/entity_descriptor_imp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace avdecc_lib
7878
uint64_t STDCALL acquire_entity_owner_entity_id();
7979
uint32_t STDCALL lock_entity_flags();
8080
uint64_t STDCALL lock_entity_locked_entity_id();
81-
81+
8282
int STDCALL send_acquire_entity_cmd(void *notification_id, uint32_t acquire_entity_flag);
8383
int proc_acquire_entity_resp(void *&notification_id, const uint8_t *frame, size_t frame_len, int &status);
8484

0 commit comments

Comments
 (0)