@@ -52,22 +52,22 @@ def __repr__(self):
5252
5353 def read_bytes (
5454 self ,
55- num_bytes_to_read ,
55+ num_bytes ,
5656 timeout = constants .TIMEOUT_NONE ):
5757 # type: (int, float) -> bytes
5858 """Read data as a list of raw bytes (frame data).
5959
6060 The raw bytes encode one or more frames using the Raw Frame Format.
6161
6262 Args:
63- num_bytes_to_read (int): The number of bytes to read.
63+ num_bytes (int): The number of bytes to read.
6464 timeout(float): The time in seconds to wait for number to read
6565 frame bytes to become available.
6666
6767 To avoid returning a partial frame, even when
68- 'num_bytes_to_read ' are available from the hardware, this
68+ 'num_bytes ' are available from the hardware, this
6969 read may return fewer bytes in buffer. For example, assume you
70- pass 'num_bytes_to_read ' 70 bytes and 'timeout' of 10
70+ pass 'num_bytes ' 70 bytes and 'timeout' of 10
7171 seconds. During the read, two frames are received, the first 24
7272 bytes in size, and the second 56 bytes in size, for a total of
7373 80 bytes. The read returns after the two frames are received,
@@ -78,48 +78,48 @@ def read_bytes(
7878 buffer.
7979
8080 If 'timeout' is positive, this function waits for
81- 'num_bytes_to_read ' frame bytes to be received, then
81+ 'num_bytes ' frame bytes to be received, then
8282 returns complete frames up to that number. If the bytes do not
8383 arrive prior to the 'timeout', an error is returned.
8484
8585 If 'timeout' is 'constants.TIMEOUT_INFINITE', this
86- function waits indefinitely for 'num_bytes_to_read ' frame bytes.
86+ function waits indefinitely for 'num_bytes ' frame bytes.
8787
8888 If 'timeout' is 'constants.TIMEOUT_NONE', this
8989 function does not wait and immediately returns all available
90- frame bytes up to the limit 'num_bytes_to_read ' specifies.
90+ frame bytes up to the limit 'num_bytes ' specifies.
9191
9292 Returns:
9393 A list of raw bytes representing the data.
9494 """
95- buffer , number_of_bytes_returned = _funcs .nx_read_frame (self ._handle , num_bytes_to_read , timeout )
95+ buffer , number_of_bytes_returned = _funcs .nx_read_frame (self ._handle , num_bytes , timeout )
9696 return buffer [0 :number_of_bytes_returned ]
9797
9898 def read (
9999 self ,
100- num_frames_to_read ,
100+ num_frames ,
101101 timeout = constants .TIMEOUT_NONE ,
102102 frame_type = types .XnetFrame ):
103103 # type: (int, float, typing.Type[types.FrameFactory]) -> typing.Iterable[types.Frame]
104104 """Read raw CAN frames.
105105
106106 Args:
107- num_frames_to_read (int): Number of raw CAN frames
107+ num_frames (int): Number of raw CAN frames
108108 to read.
109109 timeout(float): The time in seconds to wait for number to read
110110 frame bytes to become available.
111111
112112 If 'timeout' is positive, this function waits for
113- 'num_frames_to_read ' frames to be received, then
113+ 'num_frames ' frames to be received, then
114114 returns complete frames up to that number. If the frames do not
115115 arrive prior to the 'timeout', an error is returned.
116116
117117 If 'timeout' is 'constants.TIMEOUT_INFINITE', this function
118- waits indefinitely for 'num_frames_to_read ' frames.
118+ waits indefinitely for 'num_frames ' frames.
119119
120120 If 'timeout' is 'constants.TIMEOUT_NONE', this function does not
121121 wait and immediately returns all available frames up to the
122- limit 'num_frames_to_read ' specifies.
122+ limit 'num_frames ' specifies.
123123 frame_type(:any:`nixnet.types.FrameFactory`): A factory for the
124124 desired frame formats.
125125
@@ -128,9 +128,9 @@ def read(
128128 """
129129 from_raw = typing .cast (typing .Callable [[types .RawFrame ], types .Frame ], frame_type .from_raw )
130130 # NOTE: If the frame payload exceeds the base unit, this will return
131- # less than num_frames_to_read
132- num_bytes_to_read = num_frames_to_read * _frames .nxFrameFixed_t .size
133- buffer = self .read_bytes (num_bytes_to_read , timeout )
131+ # less than num_frames
132+ num_bytes = num_frames * _frames .nxFrameFixed_t .size
133+ buffer = self .read_bytes (num_bytes , timeout )
134134 for frame in _frames .iterate_frames (buffer ):
135135 yield from_raw (frame )
136136
@@ -143,19 +143,19 @@ def __repr__(self):
143143
144144 def read_bytes (
145145 self ,
146- num_bytes_to_read ):
146+ num_bytes ):
147147 # type: (int) -> bytes
148148 """Read data as a list of raw bytes (frame data).
149149
150150 Args:
151- num_bytes_to_read (int): Number of bytes to read.
151+ num_bytes (int): Number of bytes to read.
152152
153153 Returns:
154154 bytes: Raw bytes representing the data.
155155 """
156156 buffer , number_of_bytes_returned = _funcs .nx_read_frame (
157157 self ._handle ,
158- num_bytes_to_read ,
158+ num_bytes ,
159159 constants .TIMEOUT_NONE )
160160 return buffer [0 :number_of_bytes_returned ]
161161
@@ -174,10 +174,10 @@ def read(
174174 """
175175 from_raw = typing .cast (typing .Callable [[types .RawFrame ], types .Frame ], frame_type .from_raw )
176176 # NOTE: If the frame payload exceeds the base unit, this will return
177- # less than num_frames_to_read
178- num_frames_to_read = len (self )
179- num_bytes_to_read = num_frames_to_read * _frames .nxFrameFixed_t .size
180- buffer = self .read_bytes (num_bytes_to_read )
177+ # less than num_frames
178+ num_frames = len (self )
179+ num_bytes = num_frames * _frames .nxFrameFixed_t .size
180+ buffer = self .read_bytes (num_bytes )
181181 for frame in _frames .iterate_frames (buffer ):
182182 yield from_raw (frame )
183183
0 commit comments