예제 #1
0
 def bp_get_byte(self, di: bp.DataIndexer, rshift: int) -> bp.byte:
     if di.field_number == 1:
         return (self.yaw >> rshift) & 255
     if di.field_number == 2:
         return (self.pitch >> rshift) & 255
     if di.field_number == 3:
         return (self.roll >> rshift) & 255
     return bp.byte(0)  # Won't reached
예제 #2
0
 def bp_get_byte(self, di: bp.DataIndexer, rshift: int) -> bp.byte:
     if di.field_number == 1:
         return (self.latitude >> rshift) & 255
     if di.field_number == 2:
         return (self.longitude >> rshift) & 255
     if di.field_number == 3:
         return (self.altitude >> rshift) & 255
     return bp.byte(0)  # Won't reached
예제 #3
0
 def bp_get_byte(self, di: bp.DataIndexer, rshift: int) -> bp.byte:
     if di.field_number == 1:
         return (self.battery >> rshift) & 255
     if di.field_number == 2:
         return (self.status >> rshift) & 255
     if di.field_number == 3:
         return (int(self.is_charging) >> rshift) & 255
     return bp.byte(0)  # Won't reached
예제 #4
0
 def bp_get_byte(self, di: bp.DataIndexer, rshift: int) -> bp.byte:
     if di.field_number == 1:
         return (self.id >> rshift) & 255
     if di.field_number == 2:
         return (self.status >> rshift) & 255
     if di.field_number == 3:
         return (self.direction >> rshift) & 255
     return bp.byte(0)  # Won't reached
예제 #5
0
 def bp_get_byte(self, di: bp.DataIndexer, rshift: int) -> bp.byte:
     if di.field_number == 2:
         return (self.velocity[di.i(0)] >> rshift) & 255
     if di.field_number == 3:
         return (self.acceleration[di.i(0)] >> rshift) & 255
     return bp.byte(0)  # Won't reached
예제 #6
0
 def bp_get_byte(self, di: bp.DataIndexer, rshift: int) -> bp.byte:
     if di.field_number == 1:
         return (self.signal >> rshift) & 255
     if di.field_number == 2:
         return (self.heartbeat_at >> rshift) & 255
     return bp.byte(0)  # Won't reached