summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorkarl ding <karlding@users.noreply.github.com>2019-07-31 08:47:16 (GMT)
committerƁukasz Langa <lukasz@langa.pl>2019-07-31 08:47:16 (GMT)
commit31c4fd2a10d90beaa37d630e5f74a471e14e089d (patch)
tree40a7a11d67b92d2ea4a2eca25361ea36d2aa4935 /Lib
parent472eced6770c2fabab3031e4e16cd32e32b8a0cc (diff)
downloadcpython-31c4fd2a10d90beaa37d630e5f74a471e14e089d.zip
cpython-31c4fd2a10d90beaa37d630e5f74a471e14e089d.tar.gz
cpython-31c4fd2a10d90beaa37d630e5f74a471e14e089d.tar.bz2
bpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)
Expose the CAN_BCM SocketCAN constants used in the bcm_msg_head struct flags (provided by <linux/can/bcm.h>) under the socket library. This adds the following constants with a CAN_BCM prefix: * SETTIMER * STARTTIMER * TX_COUNTEVT * TX_ANNOUNCE * TX_CP_CAN_ID * RX_FILTER_ID * RX_CHECK_DLC * RX_NO_AUTOTIMER * RX_ANNOUNCE_RESUME * TX_RESET_MULTI_IDX * RX_RTR_FRAME * CAN_FD_FRAME The CAN_FD_FRAME flag was introduced in the 4.8 kernel, while the other ones were present since SocketCAN drivers were mainlined in 2.6.25. As such, it is probably unnecessary to guard against these constants being missing.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_socket.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 2705eff..11b2a38 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1908,6 +1908,19 @@ class BasicCANTest(unittest.TestCase):
socket.CAN_BCM_RX_TIMEOUT # cyclic message is absent
socket.CAN_BCM_RX_CHANGED # updated CAN frame (detected content change)
+ # flags
+ socket.CAN_BCM_SETTIMER
+ socket.CAN_BCM_STARTTIMER
+ socket.CAN_BCM_TX_COUNTEVT
+ socket.CAN_BCM_TX_ANNOUNCE
+ socket.CAN_BCM_TX_CP_CAN_ID
+ socket.CAN_BCM_RX_FILTER_ID
+ socket.CAN_BCM_RX_CHECK_DLC
+ socket.CAN_BCM_RX_NO_AUTOTIMER
+ socket.CAN_BCM_RX_ANNOUNCE_RESUME
+ socket.CAN_BCM_TX_RESET_MULTI_IDX
+ socket.CAN_BCM_RX_RTR_FRAME
+
def testCreateSocket(self):
with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s:
pass