TSMasterAPI 2.2.11__tar.gz → 2.2.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TSMasterAPI
3
- Version: 2.2.11
3
+ Version: 2.2.13
4
4
  Summary: Use TSMaster hardware
5
+ Home-page: UNKNOWN
5
6
  Author: seven
6
7
  Author-email: 865762826@qq.com
7
8
  License: BSD License
@@ -29,3 +30,5 @@ Can only be used by WIN32 Python
29
30
  [联系作者](865762826@qq.com)
30
31
 
31
32
  to write your content.
33
+
34
+
@@ -1,6 +1,7 @@
1
1
  from .TSDirver import *
2
2
  from .TSStruct import *
3
- from .TSCallback import *
3
+ from .TSCallback import *
4
+ from .TSEnum import *
4
5
  set_libtsmaster_location = dll.set_libtsmaster_location
5
6
  #arg[0] AFilePath : None
6
7
  set_libtsmaster_location.argtypes =[pchar]
@@ -3056,7 +3057,7 @@ tssocket_remove_device = dll.tssocket_remove_device
3056
3057
  #arg[0] ANetworkIndex : None
3057
3058
  #arg[1] macaddr : None
3058
3059
  #arg[2] ipaddr : None
3059
- tssocket_remove_device.argtypes =[s32,pu8,Tip4_addr_t]
3060
+ tssocket_remove_device.argtypes =[s32,pu8,Pip4_addr_t]
3060
3061
  tssocket_remove_device.restype = s32
3061
3062
  tssocket_dhcp_start = dll.tssocket_dhcp_start
3062
3063
  #arg[0] ANetworkIndex : None
@@ -7,21 +7,29 @@ LastEditTime: 2023-11-22 10:26:17
7
7
  from ctypes import WinDLL
8
8
  import os
9
9
  import winreg
10
-
10
+ import platform
11
11
 
12
12
  TSMaster_location = r"Software\TOSUN\TSMaster"
13
13
 
14
14
  key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, TSMaster_location)
15
15
 
16
+ _arch, _os = platform.architecture()
17
+
16
18
  i = 0
17
19
  dll_path = ''
18
20
  while True:
19
21
  try:
22
+ if _arch == '32bit':
20
23
  # 获取注册表对应位置的键和值
21
- if winreg.EnumValue(key, i)[0] == 'libTSMaster_x86':
22
- dll_path = winreg.EnumValue(key, i)[1]
23
- winreg.CloseKey(key)
24
- break
24
+ if winreg.EnumValue(key, i)[0] == 'libTSMaster_x86':
25
+ dll_path = winreg.EnumValue(key, i)[1]
26
+ winreg.CloseKey(key)
27
+ break
28
+ else:
29
+ if winreg.EnumValue(key, i)[0] == 'libTSMaster_x64':
30
+ dll_path = winreg.EnumValue(key, i)[1]
31
+ winreg.CloseKey(key)
32
+ break
25
33
  i += 1
26
34
  except OSError as error:
27
35
  # 一定要关闭这个键
@@ -1,6 +1,11 @@
1
1
  from enum import IntEnum, IntFlag
2
2
 
3
3
 
4
+ TS_AF_INET = 2
5
+ TS_SOCK_STREAM = 1
6
+ TS_SOCK_DGRAM = 2
7
+ TS_SOCK_RAW = 3
8
+
4
9
  class CHANNEL_INDEX(IntEnum):
5
10
  (CHN1, CHN2, CHN3, CHN4, CHN5, CHN6, CHN7, CHN8, CHN9, CHN10, CHN11, CHN12, CHN13, CHN14, CHN15, CHN16, CHN17,
6
11
  CHN18, CHN19, CHN20, CHN21, CHN22, CHN23, CHN24, CHN25, CHN26, CHN27, CHN28, CHN29, CHN30, CHN31, CHN32) = (
@@ -553,8 +553,7 @@ class TLIBEthernetHeader(Structure):
553
553
 
554
554
  PLIBEthernetHeader = POINTER(TLIBEthernetHeader)
555
555
 
556
-
557
-
556
+
558
557
  class TLIBFlexRayClusterParameters(Structure):
559
558
  _pack_ = 1
560
559
  _fields_ = [
@@ -602,8 +601,7 @@ class TLIBFlexRayClusterParameters(Structure):
602
601
  ('FMaxWithoutClockCorrectionFatal',s32),#
603
602
  ('FMaxWithoutClockCorrectionPassive',s32),#
604
603
  ]
605
- PLIBFlexRayClusterParameters = POINTER(TLIBFlexRayClusterParameters)
606
-
604
+ PLIBFlexRayClusterParameters = POINTER(TLIBFlexRayClusterParameters)
607
605
  class TLIBFlexRayControllerParameters(Structure):
608
606
  _pack_ = 1
609
607
  _fields_ = [
@@ -639,16 +637,14 @@ class TLIBFlexRayControllerParameters(Structure):
639
637
  (' FLatestTx',s32),#
640
638
  (' FMaxDynamicPayloadLength',s32),#
641
639
  ]
642
- PLIBFlexRayControllerParameters = POINTER(TLIBFlexRayControllerParameters)
643
-
640
+ PLIBFlexRayControllerParameters = POINTER(TLIBFlexRayControllerParameters)
644
641
  class TLIBEthernetMAX(Structure):
645
642
  _pack_ = 1
646
643
  _fields_ = [
647
644
  ('FHeader',TLIBEthernetHeader),#
648
645
  ('FBytes',u8 * 1612),#starting by destination MAC, source MAC, ethernet type, payload...
649
646
  ]
650
- PLIBEthernetMAX = POINTER(TLIBEthernetMAX)
651
-
647
+ PLIBEthernetMAX = POINTER(TLIBEthernetMAX)
652
648
  class TLIBTrigger_def(Structure):
653
649
  _pack_ = 1
654
650
  _fields_ = [
@@ -657,8 +653,7 @@ class TLIBTrigger_def(Structure):
657
653
  ('cycle_code',u8),#BASE-CYCLE + CYCLE-REPETITION
658
654
  ('config_byte',u8),#//bit 0:是否使能通道A//bit 1:是否使能通道B//bit 2:是否网络管理报文//bit 3:传输模式,0表示连续传输,1表示单次触发//bit 4:是否为冷启动报文,只有缓冲区0可以置1//bit 5:是否为同步报文,只有缓冲区0/1可以置1//bit 6://bit 7:帧类型:0-静态,1-动态
659
655
  ]
660
- PLIBTrigger_def = POINTER(TLIBTrigger_def)
661
-
656
+ PLIBTrigger_def = POINTER(TLIBTrigger_def)
662
657
  class TLIBGPSData(Structure):
663
658
  _pack_ = 1
664
659
  _fields_ = [
@@ -675,8 +670,7 @@ class TLIBGPSData(Structure):
675
670
  ('Satellite',u8),#
676
671
  ('FIdxChn',u8),#
677
672
  ]
678
- PLIBGPSData = POINTER(TLIBGPSData)
679
-
673
+ PLIBGPSData = POINTER(TLIBGPSData)
680
674
  class TLIBEth_CMD_config(Structure):
681
675
  _pack_ = 1
682
676
  _fields_ = [
@@ -691,8 +685,7 @@ class TLIBEth_CMD_config(Structure):
691
685
  ('filter_perfect1',u64),#
692
686
  ('rev',u64 * 6),#48
693
687
  ]
694
- PLIBEth_CMD_config = POINTER(TLIBEth_CMD_config)
695
-
688
+ PLIBEth_CMD_config = POINTER(TLIBEth_CMD_config)
696
689
  class Trealtime_comment_t(Structure):
697
690
  _pack_ = 1
698
691
  _fields_ = [
@@ -702,8 +695,7 @@ class Trealtime_comment_t(Structure):
702
695
  ('FComment',pchar),#
703
696
  ('FPadding',u32),#to be compatible with x64
704
697
  ]
705
- Prealtime_comment_t = POINTER(Trealtime_comment_t)
706
-
698
+ Prealtime_comment_t = POINTER(Trealtime_comment_t)
707
699
  class TLIBSystemVar(Structure):
708
700
  _pack_ = 1
709
701
  _fields_ = [
@@ -715,8 +707,7 @@ class TLIBSystemVar(Structure):
715
707
  ('FData',pu8),#
716
708
  ('FPadding',s64),#to be compatible with x64
717
709
  ]
718
- PLIBSystemVar = POINTER(TLIBSystemVar)
719
-
710
+ PLIBSystemVar = POINTER(TLIBSystemVar)
720
711
  class TMPCANSignal(Structure):
721
712
  _pack_ = 1
722
713
  _fields_ = [
@@ -727,8 +718,7 @@ class TMPCANSignal(Structure):
727
718
  ('FFactor',double),#
728
719
  ('FOffset',double),#
729
720
  ]
730
- PMPCANSignal = POINTER(TMPCANSignal)
731
-
721
+ PMPCANSignal = POINTER(TMPCANSignal)
732
722
  class TMPLINSignal(Structure):
733
723
  _pack_ = 1
734
724
  _fields_ = [
@@ -739,8 +729,7 @@ class TMPLINSignal(Structure):
739
729
  ('FFactor',double),#
740
730
  ('FOffset',double),#
741
731
  ]
742
- PMPLINSignal = POINTER(TMPLINSignal)
743
-
732
+ PMPLINSignal = POINTER(TMPLINSignal)
744
733
  class TMPFlexRaySignal(Structure):
745
734
  _pack_ = 1
746
735
  _fields_ = [
@@ -756,8 +745,7 @@ class TMPFlexRaySignal(Structure):
756
745
  ('FActualStartBit',s32),#added 2023-07-18
757
746
  ('FActualUpdateBit',s32),#added 2023-07-18
758
747
  ]
759
- PMPFlexRaySignal = POINTER(TMPFlexRaySignal)
760
-
748
+ PMPFlexRaySignal = POINTER(TMPFlexRaySignal)
761
749
  class TMPDBProperties(Structure):
762
750
  _pack_ = 1
763
751
  _fields_ = [
@@ -770,8 +758,7 @@ class TMPDBProperties(Structure):
770
758
  ('FComment',char * 512),#
771
759
  ('FFlags',u64),#Bit 0: whether generate mp header
772
760
  ]
773
- PMPDBProperties = POINTER(TMPDBProperties)
774
-
761
+ PMPDBProperties = POINTER(TMPDBProperties)
775
762
  class TMPDBECUProperties(Structure):
776
763
  _pack_ = 1
777
764
  _fields_ = [
@@ -782,8 +769,7 @@ class TMPDBECUProperties(Structure):
782
769
  ('FName',char * 512),#
783
770
  ('FComment',char * 512),#
784
771
  ]
785
- PMPDBECUProperties = POINTER(TMPDBECUProperties)
786
-
772
+ PMPDBECUProperties = POINTER(TMPDBECUProperties)
787
773
  class TMPDBFrameProperties(Structure):
788
774
  _pack_ = 1
789
775
  _fields_ = [
@@ -814,8 +800,7 @@ class TMPDBFrameProperties(Structure):
814
800
  ('FName',char * 512),#
815
801
  ('FComment',char * 512),#
816
802
  ]
817
- PMPDBFrameProperties = POINTER(TMPDBFrameProperties)
818
-
803
+ PMPDBFrameProperties = POINTER(TMPDBFrameProperties)
819
804
  class TMPDBSignalProperties(Structure):
820
805
  _pack_ = 1
821
806
  _fields_ = [
@@ -836,8 +821,7 @@ class TMPDBSignalProperties(Structure):
836
821
  ('FName',char * 512),#
837
822
  ('FComment',char * 512),#
838
823
  ]
839
- PMPDBSignalProperties = POINTER(TMPDBSignalProperties)
840
-
824
+ PMPDBSignalProperties = POINTER(TMPDBSignalProperties)
841
825
  class TLIBHWInfo(Structure):
842
826
  _pack_ = 1
843
827
  _fields_ = [
@@ -847,8 +831,7 @@ class TLIBHWInfo(Structure):
847
831
  ('FDeviceName',char * 32),#
848
832
  ('FSerialString',char * 64),#
849
833
  ]
850
- PLIBHWInfo = POINTER(TLIBHWInfo)
851
-
834
+ PLIBHWInfo = POINTER(TLIBHWInfo)
852
835
  class TLIBTSMapping(Structure):
853
836
  _pack_ = 1
854
837
  _fields_ = [
@@ -862,8 +845,7 @@ class TLIBTSMapping(Structure):
862
845
  ('FHWDeviceName',char * 32),#
863
846
  ('FMappingDisabled', c_bool),#
864
847
  ]
865
- PLIBTSMapping = POINTER(TLIBTSMapping)
866
-
848
+ PLIBTSMapping = POINTER(TLIBTSMapping)
867
849
  class TLIBSystemVarDef(Structure):
868
850
  _pack_ = 1
869
851
  _fields_ = [
@@ -876,23 +858,20 @@ class TLIBSystemVarDef(Structure):
876
858
  ('FValueMax',double),#
877
859
  ('FUnit',char * 32),#
878
860
  ]
879
- PLIBSystemVarDef = POINTER(TLIBSystemVarDef)
880
-
861
+ PLIBSystemVarDef = POINTER(TLIBSystemVarDef)
881
862
  class Tip4_addr_t(Structure):
882
863
  _pack_ = 1
883
864
  _fields_ = [
884
865
  ('addr',u32),#
885
866
  ]
886
- Pip4_addr_t = POINTER(Tip4_addr_t)
887
-
867
+ Pip4_addr_t = POINTER(Tip4_addr_t)
888
868
  class Tip6_addr_t(Structure):
889
869
  _pack_ = 1
890
870
  _fields_ = [
891
871
  ('addr',u32 * 4),#
892
872
  ('zone',u8),#
893
873
  ]
894
- Pip6_addr_t = POINTER(Tip6_addr_t)
895
-
874
+ Pip6_addr_t = POINTER(Tip6_addr_t)
896
875
  class Tts_sockaddr(Structure):
897
876
  _pack_ = 1
898
877
  _fields_ = [
@@ -900,16 +879,14 @@ class Tts_sockaddr(Structure):
900
879
  ('sa_family',u8),#
901
880
  ('sa_data',char * 14),#
902
881
  ]
903
- Pts_sockaddr = POINTER(Tts_sockaddr)
904
-
882
+ Pts_sockaddr = POINTER(Tts_sockaddr)
905
883
  class Tts_iovec(Structure):
906
884
  _pack_ = 1
907
885
  _fields_ = [
908
886
  ('iov_base',TObject),#
909
887
  ('iov_len',size_t),#
910
888
  ]
911
- Pts_iovec = POINTER(Tts_iovec)
912
-
889
+ Pts_iovec = POINTER(Tts_iovec)
913
890
  class Tts_msghdr(Structure):
914
891
  _pack_ = 1
915
892
  _fields_ = [
@@ -921,23 +898,20 @@ class Tts_msghdr(Structure):
921
898
  ('msg_controllen',u32),#
922
899
  ('msg_flags',s32),#
923
900
  ]
924
- Pts_msghdr = POINTER(Tts_msghdr)
925
-
901
+ Pts_msghdr = POINTER(Tts_msghdr)
926
902
  class Tts_fd_set(Structure):
927
903
  _pack_ = 1
928
904
  _fields_ = [
929
905
  ('fd_bits',u8 * 2),#
930
906
  ]
931
- Pts_fd_set = POINTER(Tts_fd_set)
932
-
907
+ Pts_fd_set = POINTER(Tts_fd_set)
933
908
  class Tts_timeval(Structure):
934
909
  _pack_ = 1
935
910
  _fields_ = [
936
911
  ('tv_sec',u32),#
937
912
  ('tv_usec',u32),#
938
913
  ]
939
- Pts_timeval = POINTER(Tts_timeval)
940
-
914
+ Pts_timeval = POINTER(Tts_timeval)
941
915
  class Tts_pollfd(Structure):
942
916
  _pack_ = 1
943
917
  _fields_ = [
@@ -945,8 +919,7 @@ class Tts_pollfd(Structure):
945
919
  ('events',s16),#
946
920
  ('revents',s16),#
947
921
  ]
948
- Pts_pollfd = POINTER(Tts_pollfd)
949
-
922
+ Pts_pollfd = POINTER(Tts_pollfd)
950
923
  class Tts_sockaddr_in(Structure):
951
924
  _pack_ = 1
952
925
  _fields_ = [
@@ -956,13 +929,11 @@ class Tts_sockaddr_in(Structure):
956
929
  ('sin_addr',Tip4_addr_t),#
957
930
  ('sin_zero',u8 * 8),#
958
931
  ]
959
- Pts_sockaddr_in = POINTER(Tts_sockaddr_in)
960
-
932
+ Pts_sockaddr_in = POINTER(Tts_sockaddr_in)
961
933
  class Tip_addr_t(Structure):
962
934
  _pack_ = 1
963
935
  _fields_ = [
964
936
  ('ip4Or6',Tip6_addr_t),#
965
937
  ('FType',u32),#
966
938
  ]
967
- Pip_addr_t = POINTER(Tip_addr_t)
968
-
939
+ Pip_addr_t = POINTER(Tip_addr_t)
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TSMasterAPI
3
- Version: 2.2.11
3
+ Version: 2.2.13
4
4
  Summary: Use TSMaster hardware
5
+ Home-page: UNKNOWN
5
6
  Author: seven
6
7
  Author-email: 865762826@qq.com
7
8
  License: BSD License
@@ -29,3 +30,5 @@ Can only be used by WIN32 Python
29
30
  [联系作者](865762826@qq.com)
30
31
 
31
32
  to write your content.
33
+
34
+
@@ -13,7 +13,7 @@ with open("README.rst", "r",encoding="utf-8") as f:
13
13
 
14
14
  #
15
15
  setup(name='TSMasterAPI', # 包名
16
- version='2.2.11', # 版本号
16
+ version='2.2.13', # 版本号
17
17
  description='Use TSMaster hardware',
18
18
  long_description=long_description,
19
19
  author='seven',
File without changes
File without changes
File without changes