Exemplo n.º 1
0
void simply_accel_set_data_samples(SimplyAccel *self, uint32_t num_samples) {
  self->num_samples = num_samples;
  accel_service_set_samples_per_update(num_samples);
  if (!self->data_subscribed) {
    return;
  }
  simply_accel_set_data_subscribe(self, false);
  simply_accel_set_data_subscribe(self, true);
}
Exemplo n.º 2
0
static void handle_accel_config_packet(Simply *simply, Packet *data) {
  AccelConfigPacket *packet = (AccelConfigPacket*) data;
  simply->accel->num_samples = packet->num_samples;
  simply->accel->rate = packet->rate;
  simply_accel_set_data_subscribe(simply->accel, packet->data_subscribed);
}