batlab.packet package¶
Submodules¶
batlab.packet.Packet module¶
-
class
batlab.packet.Packet.Packet¶ Holds information related to USB packets.
The
packetclass contains a command response packet from a Batlab. Information from a batlab register read is returned to the user in apacketinstance. The various methods of the packet instance allow the user to decode the raw register data into useable information.-
valid¶ Bool describing if data in the packet can be trusted
-
timestamp¶ Time message was received
-
namespace¶ Namespace of the register’s data this packet contains
-
addr¶ Register address
-
data¶ Raw register packet data (int16)
-
write¶ True if this response packet was for a register write
-
ascurrent()¶
-
aserr()¶ Represents error reg bit field as a string of the error flags.
-
asfreq()¶ Represents frequency data in Hz.
-
asioff()¶ Represents register current to floating point Amps.
-
asmagdiv()¶ Represents magdiv register as Ipp.
-
asmode()¶ Represents a mode register value as an enum string.
-
assetpoint()¶ Represents current setpoint as floating point Amps.
-
astemperature(Rlist, Blist)¶ Represents temp data as temperature in F.
Parameters: - Rlist – 4 list of ‘R’ calibration values needed to interpret temp
- Blist – 4 list of ‘B’ calibration values needed to interpret temp
-
astemperature_c(Rlist, Blist)¶ Represents temp data as temperature in C.
Parameters: - Rlist – 4 list of ‘R’ calibration values needed to interpret temp
- Blist – 4 list of ‘B’ calibration values needed to interpret temp
-
asvcc()¶ Represents vss
dataas a floating point voltage.
-
asvoltage()¶ Represents voltage
dataas a floating point voltage.
-
display()¶ Prints out the basic info about the packet transaction ### charge function.
-
print_packet()¶
-
set_temps(Blist)¶ Deprecated.
-
value()¶ Returns the raw data if the packet is a response packet, or a list of data pieces if the packet is an extended response packet.
-