Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37085

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Expose additional socket constants for CAN_BCM flags
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.9, Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: karlding, lukasz.langa, miss-islington, taleinat
Priority:normalKeywords:patch

Created on2019-05-29 06:53 bykarlding, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 13646mergedkarlding,2019-05-29 07:25
PR 15049mergedmiss-islington,2019-07-31 08:47
Messages (4)
msg343865 -(view)Author: Karl Ding (karlding)*Date: 2019-05-29 06:53
When reading through the values exposed via the socket library, I noticed that currently, only the SocketCAN BCM opcode enums are exposed via the socket constants. These correspond to the following from the Linux headers:        enum {        TX_SETUP = 1,/* create (cyclic) transmission task */        TX_DELETE,/* remove (cyclic) transmission task */        TX_READ,/* read properties of (cyclic) transmission task */        TX_SEND,/* send one CAN frame */        RX_SETUP,/* create RX content filter subscription */        RX_DELETE,/* remove RX content filter subscription */        RX_READ,/* read properties of RX content filter subscription */        TX_STATUS,/* reply to TX_READ request */        TX_EXPIRED,/* notification on performed transmissions (count=0) */        RX_STATUS,/* reply to RX_READ request */        RX_TIMEOUT,/* cyclic message is absent */        RX_CHANGED/* updated CAN frame (detected content change) */        };It would be nice to expose the BCM flags #defines as well.        #define SETTIMER            0x0001        #define STARTTIMER          0x0002        #define TX_COUNTEVT         0x0004        #define TX_ANNOUNCE         0x0008        #define TX_CP_CAN_ID        0x0010        #define RX_FILTER_ID        0x0020        #define RX_CHECK_DLC        0x0040        #define RX_NO_AUTOTIMER     0x0080        #define RX_ANNOUNCE_RESUME  0x0100        #define TX_RESET_MULTI_IDX  0x0200        #define RX_RTR_FRAME        0x0400        #define CAN_FD_FRAME        0x0800These BCM flags are used as part of the BCM header that has the aforementioned opcodes. The flags are set on the bcm_msg_head struct:        struct bcm_msg_head {            __u32 opcode;            __u32 flags;            __u32 count;            struct bcm_timeval ival1, ival2;            canid_t can_id;            __u32 nframes;            struct can_frame frames[0];        };The existing documentation for the BCM constants (https://docs.python.org/3/library/socket.html#socket.CAN_BCM) seems to imply that these constants should already be included, but they are not.See the Linux headers for more details:https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/can/bcm.h
msg348792 -(view)Author: Łukasz Langa (lukasz.langa)*(Python committer)Date: 2019-07-31 08:47
New changeset31c4fd2a10d90beaa37d630e5f74a471e14e089d by Łukasz Langa (karl ding) in branch 'master':bpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)https://github.com/python/cpython/commit/31c4fd2a10d90beaa37d630e5f74a471e14e089d
msg348793 -(view)Author: miss-islington (miss-islington)Date: 2019-07-31 09:10
New changesetd8b914a30b0849476345a19ce0a0ab1ade171b19 by Miss Islington (bot) in branch '3.8':bpo-37085: Expose SocketCAN bcm_msg_head flags (GH-13646)https://github.com/python/cpython/commit/d8b914a30b0849476345a19ce0a0ab1ade171b19
msg348799 -(view)Author: Tal Einat (taleinat)*(Python committer)Date: 2019-07-31 12:04
Karl, many thanks for bringing this up, making a PR and iterating on it with me!
History
DateUserActionArgs
2022-04-11 14:59:15adminsetgithub: 81266
2019-07-31 12:04:47taleinatsetstatus: open -> closed

versions: + Python 3.9
nosy: +taleinat

messages: +msg348799
resolution: fixed
stage: patch review -> resolved
2019-07-31 09:10:43miss-islingtonsetnosy: +miss-islington
messages: +msg348793
2019-07-31 08:47:39lukasz.langasetnosy: +lukasz.langa
messages: +msg348792
2019-07-31 08:47:35miss-islingtonsetpull_requests: +pull_request14800
2019-05-29 07:25:54karldingsetkeywords: +patch
stage: patch review
pull_requests: +pull_request13541
2019-05-29 06:53:00karldingcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp