return true;
}
-bool sensor_client_info::is_active()
+bool sensor_client_info::is_active(void)
{
AUTOLOCK(m_handle_info_lock);
return deactivate();
}
-auto_rotation_alg *auto_rotation_sensor::get_alg()
+auto_rotation_alg *auto_rotation_sensor::get_alg(void)
{
auto_rotation_alg *alg = new(std::nothrow) auto_rotation_alg_emul();
retvm_if(!alg, NULL, "Failed to allocate memory");
virtual bool on_start(void);
virtual bool on_stop(void);
- auto_rotation_alg *get_alg();
+ auto_rotation_alg *get_alg(void);
};
#endif /* _AUTO_ROTATION_SENSOR_H_ */
_I("gravity_sensor is destroyed!\n");
}
-bool gravity_sensor::init()
+bool gravity_sensor::init(void)
{
/* Acc (+ Gyro) fusion */
m_accel_sensor = sensor_loader::get_instance().get_sensor(ACCELEROMETER_SENSOR);
m_time_new = event.data->timestamp;
}
-void gravity_sensor::fusion_update_angle()
+void gravity_sensor::fusion_update_angle(void)
{
_D("AngleIn: (%f, %f, %f)", m_angle_n[0], m_angle_n[1], m_angle_n[2]);
_D("AngAccl: (%f, %f, %f)", m_velocity[0], m_velocity[1], m_velocity[2]);
_D("Angle' : (%f, %f, %f)", m_angle[0], m_angle[1], m_angle[2]);
}
-void gravity_sensor::fusion_get_gravity()
+void gravity_sensor::fusion_get_gravity(void)
{
double x = 0, y = 0, z = 0;
double norm;
void fusion_set_accel(const sensor_event_t& event);
void fusion_set_gyro(const sensor_event_t& event);
- void fusion_update_angle();
- void fusion_get_gravity();
+ void fusion_update_angle(void);
+ void fusion_get_gravity(void);
double complementary(double angle, double angle_in, double vel, double delta_t, double alpha);
void complementary(unsigned long long time_diff);
};
_I("linear_accel_sensor is destroyed!\n");
}
-bool linear_accel_sensor::init()
+bool linear_accel_sensor::init(void)
{
m_accel_sensor = sensor_loader::get_instance().get_sensor(ACCELEROMETER_SENSOR);
_I("%s is destroyed!", SENSOR_NAME);
}
-bool orientation_sensor::init()
+bool orientation_sensor::init(void)
{
m_rotation_vector_sensor = sensor_loader::get_instance().get_sensor(ROTATION_VECTOR_SENSOR);
_I("%s is destroyed!", SENSOR_NAME);
}
-bool rotation_vector_sensor::init()
+bool rotation_vector_sensor::init(void)
{
m_accel_sensor = sensor_loader::get_instance().get_sensor(ACCELEROMETER_SENSOR);
m_mag_sensor = sensor_loader::get_instance().get_sensor(GEOMAGNETIC_SENSOR);
int m_magnetic_alignment_factor;
- orientation_filter();
- ~orientation_filter();
+ orientation_filter(void);
+ ~orientation_filter(void);
inline void initialize_sensor_data(const sensor_data<TYPE> *accel,
const sensor_data<TYPE> *gyro, const sensor_data<TYPE> *magnetic);
- inline void orientation_triad_algorithm();
- inline void compute_accel_orientation();
- inline void compute_covariance();
- inline void time_update();
- inline void time_update_gaming_rv();
- inline void measurement_update();
+ inline void orientation_triad_algorithm(void);
+ inline void compute_accel_orientation(void);
+ inline void compute_covariance(void);
+ inline void time_update(void);
+ inline void time_update_gaming_rv(void);
+ inline void measurement_update(void);
void get_device_orientation(const sensor_data<TYPE> *accel,
const sensor_data<TYPE> *gyro, const sensor_data<TYPE> *magnetic);
~quaternion();
quaternion<TYPE> operator =(const quaternion<TYPE>& q);
- void quat_normalize();
+ void quat_normalize(void);
template<typename T> friend quaternion<T> operator *(const quaternion<T> q,
const T val);
m_clients.clear();
}
-client_info_manager& client_info_manager::get_instance()
+client_info_manager& client_info_manager::get_instance(void)
{
static client_info_manager inst;
return inst;
class client_info_manager {
public:
- static client_info_manager& get_instance();
+ static client_info_manager& get_instance(void);
int create_client_record(void);
bool remove_client_record(int client_id);
bool has_client_record(int client_id);
return (ret == CYNARA_API_ACCESS_ALLOWED);
}
-permission_checker::permission_checker()
+permission_checker::permission_checker(void)
: m_permission_set(0)
{
init();
}
-permission_checker::~permission_checker()
+permission_checker::~permission_checker(void)
{
deinit();
}
-permission_checker& permission_checker::get_instance()
+permission_checker& permission_checker::get_instance(void)
{
static permission_checker inst;
return inst;
}
-void permission_checker::init()
+void permission_checker::init(void)
{
AUTOLOCK(m_mutex);
_I("Cynara initialized");
}
-void permission_checker::deinit()
+void permission_checker::deinit(void)
{
AUTOLOCK(m_mutex);
class permission_checker {
public:
- static permission_checker& get_instance();
+ static permission_checker& get_instance(void);
int get_permission(int sock_fd);
return m_info->id;
}
-int physical_sensor::get_poll_fd()
+int physical_sensor::get_poll_fd(void)
{
AUTOLOCK(m_mutex);
return OP_SUCCESS;
}
-bool physical_sensor::on_start()
+bool physical_sensor::on_start(void)
{
AUTOLOCK(m_mutex);
return m_sensor_device->enable(m_info->id);
}
-bool physical_sensor::on_stop()
+bool physical_sensor::on_stop(void)
{
AUTOLOCK(m_mutex);
virtual const char* get_name(void);
virtual uint32_t get_hal_id(void);
- int get_poll_fd();
+ int get_poll_fd(void);
virtual bool on_event(const sensor_data_t *data, int data_len, int remains);
return -1;
}
-const char* sensor_base::get_name()
+const char* sensor_base::get_name(void)
{
return NULL;
}
return false;
}
-bool sensor_base::is_virtual()
+bool sensor_base::is_virtual(void)
{
return false;
}
return OP_SUCCESS;
}
-bool sensor_base::start()
+bool sensor_base::start(void)
{
AUTOLOCK(m_client_mutex);
return true;
}
-bool sensor_base::on_start()
+bool sensor_base::on_start(void)
{
return true;
}
-bool sensor_base::on_stop()
+bool sensor_base::on_stop(void)
{
return true;
}
sensor_id_t get_id(void);
/* sensor info */
- virtual sensor_type_t get_type();
+ virtual sensor_type_t get_type(void);
virtual unsigned int get_event_type(void);
virtual const char* get_name(void);
virtual bool is_virtual(void);
{
}
-sensor_event_dispatcher& sensor_event_dispatcher::get_instance()
+sensor_event_dispatcher& sensor_event_dispatcher::get_instance(void)
{
static sensor_event_dispatcher inst;
return inst;
class sensor_event_dispatcher {
public:
- static sensor_event_dispatcher& get_instance();
+ static sensor_event_dispatcher& get_instance(void);
bool run(void);
bool stop(void);
m_poller.del_fd(it->first);
}
-void sensor_event_poller::init_sensor_map()
+void sensor_event_poller::init_sensor_map(void)
{
int fd;
physical_sensor *sensor;
return m_poller.add_fd(fd);
}
-bool sensor_event_poller::poll()
+bool sensor_event_poller::poll(void)
{
std::vector<uint32_t> ids;
while (true) {
#include <sensor_event_queue.h>
#include <sensor_log.h>
-sensor_event_queue& sensor_event_queue::get_instance()
+sensor_event_queue& sensor_event_queue::get_instance(void)
{
static sensor_event_queue inst;
return inst;
class sensor_event_queue {
public:
- static sensor_event_queue& get_instance();
+ static sensor_event_queue& get_instance(void);
void push(sensor_event_t *event);
void* pop(void);
m_handles.clear();
}
-sensor_loader& sensor_loader::get_instance()
+sensor_loader& sensor_loader::get_instance(void)
{
static sensor_loader inst;
return inst;
sensor_device_map_t m_devices;
std::vector<void *> m_handles;
public:
- static sensor_loader& get_instance();
+ static sensor_loader& get_instance(void);
bool load(void);
sensor_base* get_sensor(sensor_type_t type);
}
}
-server& server::get_instance()
+server& server::get_instance(void)
{
static server inst;
return inst;
class server {
public:
- static server& get_instance();
+ static server& get_instance(void);
public:
void run(void);
pthread_mutex_destroy(&m_mutex);
}
-void cmutex::lock()
+void cmutex::lock(void)
{
#ifdef _LOCK_DEBUG
cbase_lock::lock(LOCK_TYPE_MUTEX, "mutex", __MODULE__, __func__, __LINE__);
return pthread_mutex_trylock(&m_mutex);
}
-int cmutex::unlock_impl()
+int cmutex::unlock_impl(void)
{
return pthread_mutex_unlock(&m_mutex);
}
protected:
int lock_impl(void);
int try_lock_impl(void);
- int unlock_impl();
+ int unlock_impl(void);
+
private:
pthread_mutex_t m_mutex;
};