@@ -148,7 +148,7 @@ public function fromArray(array $register): ReadRegistersBuilder
148
148
if ($ byteLength === null ) {
149
149
throw new InvalidArgumentException ('missing length for string address ' );
150
150
}
151
- $ this ->string ($ address , $ byteLength , $ register ['name ' ] ?? null , $ callback , $ errorCallback );
151
+ $ this ->string ($ address , $ byteLength , $ register ['name ' ] ?? null , $ callback , $ errorCallback, $ endian );
152
152
break ;
153
153
}
154
154
return $ this ;
@@ -300,12 +300,19 @@ public function float(
300
300
return $ this ->addAddress ($ r );
301
301
}
302
302
303
- public function string (int $ address , int $ byteLength , string $ name = null , callable $ callback = null , callable $ errorCallback = null ): ReadRegistersBuilder
303
+ public function string (
304
+ int $ address ,
305
+ int $ byteLength ,
306
+ string $ name = null ,
307
+ callable $ callback = null ,
308
+ callable $ errorCallback = null ,
309
+ int $ endian = null
310
+ ): ReadRegistersBuilder
304
311
{
305
312
if ($ byteLength < 1 || $ byteLength > 228 ) {
306
313
throw new InvalidArgumentException ("Out of range string length for given! length: ' {$ byteLength }', address: {$ address }" );
307
314
}
308
- return $ this ->addAddress (new StringReadRegisterAddress ($ address , $ byteLength , $ name , $ callback , $ errorCallback ));
315
+ return $ this ->addAddress (new StringReadRegisterAddress ($ address , $ byteLength , $ name , $ callback , $ errorCallback, $ endian ));
309
316
}
310
317
311
318
/**
0 commit comments