import struct


def parsePWMTag( data, offset ):
  """ tag == NAVDATA_PWM_TAG:
typedef struct _navdata_pwm_t {
  uint16_t   tag;
  uint16_t   size;

  uint8_t     motor1;
  uint8_t     motor2;
  uint8_t     motor3;
  uint8_t     motor4;
  uint8_t     sat_motor1;
  uint8_t     sat_motor2;
  uint8_t     sat_motor3;
  uint8_t     sat_motor4;
  float32_t   gaz_feed_forward;
  float32_t   gaz_altitude;
  float32_t   altitude_integral;
  float32_t   vz_ref;
  int32_t     u_pitch;
  int32_t     u_roll;
  int32_t     u_yaw;
  float32_t   yaw_u_I;
  int32_t     u_pitch_planif;
  int32_t     u_roll_planif;
  int32_t     u_yaw_planif;
  float32_t   u_gaz_planif;
  uint16_t    current_motor1;
  uint16_t    current_motor2;
  uint16_t    current_motor3;
  uint16_t    current_motor4;
  //WARNING: new navdata (FC 26/07/2011)
  float32_t   altitude_prop;
  float32_t   altitude_der;
}_ATTRIBUTE_PACKED_ navdata_pwm_t; 
"""
  return struct.unpack_from("=BBBBBBBBffffiiifiiifHHHHff", data, offset+4)