8
8
#
9
9
# ------------------------------------------------------------------
10
10
# Author : Keneth Wagner
11
- # Last change: 14.01.2021 Wagner
12
- #
13
- # Language: Python 2.7, 3.7
14
11
# ------------------------------------------------------------------
15
12
#
16
13
# Copyright (C) 1999-2021 PEAK-System Technik GmbH, Darmstadt
17
14
# more Info at http://www.peak-system.com
18
- #
19
15
20
16
# Module Imports
21
- #
22
17
from ctypes import *
23
18
from ctypes .util import find_library
24
19
from string import *
@@ -601,8 +596,7 @@ def Initialize(
601
596
Interrupt = c_ushort (0 ),
602
597
):
603
598
604
- """
605
- Initializes a PCAN Channel
599
+ """Initializes a PCAN Channel
606
600
607
601
Parameters:
608
602
Channel : A TPCANHandle representing a PCAN Channel
@@ -627,8 +621,7 @@ def Initialize(
627
621
#
628
622
def InitializeFD (self , Channel , BitrateFD ):
629
623
630
- """
631
- Initializes a FD capable PCAN Channel
624
+ """Initializes a FD capable PCAN Channel
632
625
633
626
Parameters:
634
627
Channel : The handle of a FD capable PCAN Channel
@@ -659,8 +652,7 @@ def InitializeFD(self, Channel, BitrateFD):
659
652
#
660
653
def Uninitialize (self , Channel ):
661
654
662
- """
663
- Uninitializes one or all PCAN Channels initialized by CAN_Initialize
655
+ """Uninitializes one or all PCAN Channels initialized by CAN_Initialize
664
656
665
657
Remarks:
666
658
Giving the TPCANHandle value "PCAN_NONEBUS", uninitialize all initialized channels
@@ -682,8 +674,7 @@ def Uninitialize(self, Channel):
682
674
#
683
675
def Reset (self , Channel ):
684
676
685
- """
686
- Resets the receive and transmit queues of the PCAN Channel
677
+ """Resets the receive and transmit queues of the PCAN Channel
687
678
688
679
Remarks:
689
680
A reset of the CAN controller is not performed
@@ -705,8 +696,7 @@ def Reset(self, Channel):
705
696
#
706
697
def GetStatus (self , Channel ):
707
698
708
- """
709
- Gets the current status of a PCAN Channel
699
+ """Gets the current status of a PCAN Channel
710
700
711
701
Parameters:
712
702
Channel : A TPCANHandle representing a PCAN Channel
@@ -725,8 +715,7 @@ def GetStatus(self, Channel):
725
715
#
726
716
def Read (self , Channel ):
727
717
728
- """
729
- Reads a CAN message from the receive queue of a PCAN Channel
718
+ """Reads a CAN message from the receive queue of a PCAN Channel
730
719
731
720
Remarks:
732
721
The return value of this method is a 3-touple, where
@@ -740,7 +729,7 @@ def Read(self, Channel):
740
729
Channel : A TPCANHandle representing a PCAN Channel
741
730
742
731
Returns:
743
- A touple with three values
732
+ A tuple with three values
744
733
"""
745
734
try :
746
735
msg = TPCANMsg ()
@@ -755,8 +744,7 @@ def Read(self, Channel):
755
744
#
756
745
def ReadFD (self , Channel ):
757
746
758
- """
759
- Reads a CAN message from the receive queue of a FD capable PCAN Channel
747
+ """Reads a CAN message from the receive queue of a FD capable PCAN Channel
760
748
761
749
Remarks:
762
750
The return value of this method is a 3-touple, where
@@ -770,7 +758,7 @@ def ReadFD(self, Channel):
770
758
Channel : The handle of a FD capable PCAN Channel
771
759
772
760
Returns:
773
- A touple with three values
761
+ A tuple with three values
774
762
"""
775
763
try :
776
764
msg = TPCANMsgFD ()
@@ -785,8 +773,7 @@ def ReadFD(self, Channel):
785
773
#
786
774
def Write (self , Channel , MessageBuffer ):
787
775
788
- """
789
- Transmits a CAN message
776
+ """Transmits a CAN message
790
777
791
778
Parameters:
792
779
Channel : A TPCANHandle representing a PCAN Channel
@@ -806,8 +793,7 @@ def Write(self, Channel, MessageBuffer):
806
793
#
807
794
def WriteFD (self , Channel , MessageBuffer ):
808
795
809
- """
810
- Transmits a CAN message over a FD capable PCAN Channel
796
+ """Transmits a CAN message over a FD capable PCAN Channel
811
797
812
798
Parameters:
813
799
Channel : The handle of a FD capable PCAN Channel
@@ -827,8 +813,7 @@ def WriteFD(self, Channel, MessageBuffer):
827
813
#
828
814
def FilterMessages (self , Channel , FromID , ToID , Mode ):
829
815
830
- """
831
- Configures the reception filter
816
+ """Configures the reception filter
832
817
833
818
Remarks:
834
819
The message filter will be expanded with every call to this function.
@@ -855,8 +840,7 @@ def FilterMessages(self, Channel, FromID, ToID, Mode):
855
840
#
856
841
def GetValue (self , Channel , Parameter ):
857
842
858
- """
859
- Retrieves a PCAN Channel value
843
+ """Retrieves a PCAN Channel value
860
844
861
845
Remarks:
862
846
Parameters can be present or not according with the kind
@@ -872,7 +856,7 @@ def GetValue(self, Channel, Parameter):
872
856
Parameter : The TPCANParameter parameter to get
873
857
874
858
Returns:
875
- A touple with 2 values
859
+ A tuple with 2 values
876
860
"""
877
861
try :
878
862
if (
@@ -912,9 +896,8 @@ def GetValue(self, Channel, Parameter):
912
896
#
913
897
def SetValue (self , Channel , Parameter , Buffer ):
914
898
915
- """
916
- Returns a descriptive text of a given TPCANStatus error
917
- code, in any desired language
899
+ """Returns a descriptive text of a given TPCANStatus error
900
+ code, in any desired language
918
901
919
902
Remarks:
920
903
Parameters can be present or not according with the kind
@@ -951,8 +934,7 @@ def SetValue(self, Channel, Parameter, Buffer):
951
934
952
935
def GetErrorText (self , Error , Language = 0 ):
953
936
954
- """
955
- Configures or sets a PCAN Channel value
937
+ """Configures or sets a PCAN Channel value
956
938
957
939
Remarks:
958
940
@@ -969,7 +951,7 @@ def GetErrorText(self, Error, Language=0):
969
951
Language : Indicates a 'Primary language ID' (Default is Neutral(0))
970
952
971
953
Returns:
972
- A touple with 2 values
954
+ A tuple with 2 values
973
955
"""
974
956
try :
975
957
mybuffer = create_string_buffer (256 )
@@ -981,8 +963,7 @@ def GetErrorText(self, Error, Language=0):
981
963
982
964
def LookUpChannel (self , Parameters ):
983
965
984
- """
985
- Finds a PCAN-Basic channel that matches with the given parameters
966
+ """Finds a PCAN-Basic channel that matches with the given parameters
986
967
987
968
Remarks:
988
969
@@ -995,7 +976,7 @@ def LookUpChannel(self, Parameters):
995
976
to be matched within a PCAN-Basic channel
996
977
997
978
Returns:
998
- A touple with 2 values
979
+ A tuple with 2 values
999
980
"""
1000
981
try :
1001
982
mybuffer = TPCANHandle (0 )
0 commit comments