canlib.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Udacity-SDC-Radar-Driver-Micro-Challenge 作者: diyjac 项目源码 文件源码
def getChannelData_Firmware(self, channel):
        """Get device firmware version
        Retrieves the firmvare version numbers for the device connected to
        channel.
        Args:
            channel (int): The channel you are interested in
        Returns:
            major (int): The major version number
            minor (int): The minor version number
            build (int): The build number
        """
        self.fn = inspect.currentframe().f_code.co_name
        buf_type = ct.c_ushort * 4
        buf = buf_type()
        self.dll.canGetChannelData(channel,
                                   canCHANNELDATA_CARD_FIRMWARE_REV,
                                   ct.byref(buf), ct.sizeof(buf))
        (build, release, minor, major) = struct.unpack('HHHH', buf)
        return (major, minor, build)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号