Internal tcp/ip utilities¶
contains useful method for reading from and writing to socket
- class Licel.TCP_util.util(ip: str, port: int)¶
the util class holds utilities method for socket communication. the class is to be inherited by licelTCP and licelTrTCP
- readResponse() str ¶
read response from the command socket of the ethernet controller.
- Returns:
response string.
- Raises:
timeout exception if fails to respond.
- recvall(nBins) bytearray ¶
receive the number of nBins specified
- Parameters:
nBins (int) – number of bins to read. Note that a bin consists of uint16, so the total number of received bytes equals 2* bins
- Returns:
bytearray of size (2*nBins) containing the raw data.
- writeCommand(command: str) None ¶
write the specified command to the ethernet controller. adds <CRLF> to each command before sending.
- Parameters:
command – possible command are referenced in
https://licel.com/manuals/ethernet_pmt_tr.pdf#section.9.1