-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/can/: add statistics for recv, sent and drop
Add support for network statistics for CAN. It includes counters for receive, sent and drop frames. Signed-off-by: Javier Casas <[email protected]>
- Loading branch information
Showing
8 changed files
with
81 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
* include/nuttx/net/can.h | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* SPDX-FileCopyrightText: 2007, 2009-2012, 2015 Gregory Nutt. All rights reserved. | ||
* SPDX-FileCopyrightText: 2007, 2009-2012, 2015 Gregory Nutt. All | ||
* rights reserved. | ||
* SPDX-FileCopyrightText: 2001-2003, Adam Dunkels. All rights reserved. | ||
* SPDX-FileContributor: Gregory Nutt <[email protected]> | ||
* SPDX-FileContributor: Adam Dunkels <[email protected]> | ||
|
@@ -43,6 +44,7 @@ | |
|
||
#include <nuttx/config.h> | ||
#include <nuttx/can.h> | ||
#include <nuttx/net/netconfig.h> | ||
#include <stdint.h> | ||
|
||
/**************************************************************************** | ||
|
@@ -59,6 +61,19 @@ | |
* Public Types | ||
****************************************************************************/ | ||
|
||
/* The structure holding the CAN statistics that are gathered if | ||
* CONFIG_NET_STATISTICS is defined. | ||
*/ | ||
|
||
#ifdef CONFIG_NET_STATISTICS | ||
struct can_stats_s | ||
{ | ||
net_stats_t drop; /* Number of dropped CAN frames */ | ||
net_stats_t recv; /* Number of received CAN frames */ | ||
net_stats_t sent; /* Number of sent CAN frames */ | ||
}; | ||
#endif | ||
|
||
/**************************************************************************** | ||
* Public Data | ||
****************************************************************************/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters