case CMD_LISTENER_EVENT:
if (m_listener->get_event_handler())
m_listener->get_event_handler()->read(ch, msg);
+ break;
case CMD_LISTENER_ACC_EVENT:
if (m_listener->get_accuracy_handler())
m_listener->get_accuracy_handler()->read(ch, msg);
+ break;
}
}
err = sensord_get_sensors(info.type, &sensors, &count);
ASSERT_EQ(err, 0);
+ ASSERT_LT(info.index, count);
+ ASSERT_GE(info.index, 0);
handle = sensord_connect(sensors[info.index]);
ASSERT_GE(handle, 0);
test_case::test_case(const std::string &group, const std::string &name)
: m_group(group)
, m_name(name)
+, m_func(NULL)
{
test_bench::register_testcase(group, this);
}
external_sensor_handler::external_sensor_handler(const sensor_info &info,
external_sensor *sensor)
: m_info(info)
-, m_sensor(sensor)
, m_notifier(NULL)
+, m_policy(OP_DEFAULT)
{
init();
}
fusion_sensor *sensor)
: m_info(info)
, m_sensor(sensor)
-, m_policy(OP_DEFAULT)
{
}
policy = m_sensor->set_attribute(ob, attr, value);
retv_if(policy <= OP_ERROR, policy);
- if (m_policy == OP_DEFAULT) {
+ if (policy == OP_DEFAULT) {
/* default logic */
}
policy = m_sensor->set_attribute(ob, attr, value, len);
retv_if(policy <= OP_ERROR, policy);
- if (m_policy == OP_DEFAULT) {
+ if (policy == OP_DEFAULT) {
/* default logic */
}
std::unordered_map<sensor_observer *, int> m_interval_map;
std::unordered_map<sensor_observer *, int> m_batch_latency_map;
- int m_policy;
};
}
#define MAX_CONNECTIONS 1000
ipc_server::ipc_server(const std::string &path)
+: m_event_loop(NULL)
+, m_handler(NULL)
+, m_accept_handler(NULL)
{
m_accept_sock.create(path);
}
bool socket::set_sock_type(int type)
{
socklen_t opt_len;
- int sock_type;
- opt_len = sizeof(sock_type);
+ opt_len = sizeof(type);
retvm_if(m_sock_fd < 0, false, "Invalid socket[%d]", m_sock_fd);
- if (setsockopt(m_sock_fd, SOL_SOCKET, SO_TYPE, &sock_type, opt_len) < 0) {
+ if (setsockopt(m_sock_fd, SOL_SOCKET, SO_TYPE, &type, opt_len) < 0) {
_ERRNO(errno, _E, "Failed to setsockopt[%d]", m_sock_fd);
return false;
}