• Home
  • Raw
  • Download

Lines Matching refs:cmd

569     struct MsgCmd *cmd;  in setLeftyMode()  local
576 cmd = (struct MsgCmd *)malloc(sizeof(struct MsgCmd) + sizeof(bool)); in setLeftyMode()
578 if (cmd) { in setLeftyMode()
579 cmd->evtType = EVT_APP_FROM_HOST; in setLeftyMode()
580 cmd->msg.appId = APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, APP_ID_APP_GAZE_DETECT); in setLeftyMode()
581 cmd->msg.dataLen = sizeof(bool); in setLeftyMode()
582 memcpy((bool *)(cmd+1), &enable, sizeof(bool)); in setLeftyMode()
584 ret = sendCmd(cmd, sizeof(*cmd) + sizeof(bool)); in setLeftyMode()
585 if (ret == sizeof(*cmd) + sizeof(bool)) in setLeftyMode()
592 cmd->msg.appId = APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, APP_ID_APP_UNGAZE_DETECT); in setLeftyMode()
594 ret = sendCmd(cmd, sizeof(*cmd) + sizeof(bool)); in setLeftyMode()
595 if (ret == sizeof(*cmd) + sizeof(bool)) in setLeftyMode()
602 cmd->msg.appId = APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, APP_ID_APP_WRIST_TILT_DETECT); in setLeftyMode()
604 ret = sendCmd(cmd, sizeof(*cmd) + sizeof(bool)); in setLeftyMode()
605 if (ret == sizeof(*cmd) + sizeof(bool)) in setLeftyMode()
612 free(cmd); in setLeftyMode()
1063 struct ConfigCmd cmd; in restoreSensorState() local
1065 initConfigCmd(&cmd, i); in restoreSensorState()
1068cmd.sensorType, i, mSensorState[i].enable, frequency_q10_to_period_ns(mSensorState[i].rate), in restoreSensorState()
1071 int ret = sendCmd(&cmd, sizeof(cmd)); in restoreSensorState()
1072 if (ret != sizeof(cmd)) { in restoreSensorState()
1073 ALOGW("failed to send config command to restore sensor %d\n", cmd.sensorType); in restoreSensorState()
1076 cmd.cmd = CONFIG_CMD_FLUSH; in restoreSensorState()
1080 int ret = sendCmd(&cmd, sizeof(cmd)); in restoreSensorState()
1081 if (ret != sizeof(cmd)) { in restoreSensorState()
1082 ALOGW("failed to send flush command to sensor %d\n", cmd.sensorType); in restoreSensorState()
1666 void HubConnection::initConfigCmd(struct ConfigCmd *cmd, int handle) in initConfigCmd() argument
1668 memset(cmd, 0x00, sizeof(*cmd)); in initConfigCmd()
1670 cmd->evtType = EVT_NO_SENSOR_CONFIG_EVENT; in initConfigCmd()
1671 cmd->sensorType = mSensorState[handle].sensorType; in initConfigCmd()
1672 cmd->cmd = mSensorState[handle].enable ? CONFIG_CMD_ENABLE : CONFIG_CMD_DISABLE; in initConfigCmd()
1673 cmd->rate = mSensorState[handle].rate; in initConfigCmd()
1674 cmd->latency = mSensorState[handle].latency; in initConfigCmd()
1682 cmd->cmd = CONFIG_CMD_ENABLE; in initConfigCmd()
1684 if (mSensorState[alt].rate > cmd->rate) { in initConfigCmd()
1685 cmd->rate = mSensorState[alt].rate; in initConfigCmd()
1687 if (mSensorState[alt].latency < cmd->latency) { in initConfigCmd()
1688 cmd->latency = mSensorState[alt].latency; in initConfigCmd()
1693 mergeDirectReportRequest(cmd, handle); in initConfigCmd()
1698 struct ConfigCmd cmd; in queueActivate() local
1706 initConfigCmd(&cmd, handle); in queueActivate()
1708 ret = sendCmd(&cmd, sizeof(cmd)); in queueActivate()
1709 if (ret == sizeof(cmd)) { in queueActivate()
1712 cmd.sensorType, handle, enable); in queueActivate()
1716 cmd.sensorType, handle, enable); in queueActivate()
1724 struct ConfigCmd cmd; in queueSetDelay() local
1736 initConfigCmd(&cmd, handle); in queueSetDelay()
1738 ret = sendCmd(&cmd, sizeof(cmd)); in queueSetDelay()
1739 if (ret == sizeof(cmd)) in queueSetDelay()
1741 cmd.sensorType, handle, sampling_period_ns); in queueSetDelay()
1744 cmd.sensorType, handle, sampling_period_ns); in queueSetDelay()
1755 struct ConfigCmd cmd; in queueBatch() local
1768 initConfigCmd(&cmd, handle); in queueBatch()
1770 ret = sendCmd(&cmd, sizeof(cmd)); in queueBatch()
1771 if (ret == sizeof(cmd)) { in queueBatch()
1774 cmd.sensorType, handle, sampling_period_ns, max_report_latency_ns); in queueBatch()
1777 cmd.sensorType, handle, sampling_period_ns, max_report_latency_ns); in queueBatch()
1793 struct ConfigCmd cmd; in queueFlushInternal() local
1813 initConfigCmd(&cmd, handle); in queueFlushInternal()
1814 cmd.cmd = CONFIG_CMD_FLUSH; in queueFlushInternal()
1816 ret = sendCmd(&cmd, sizeof(cmd)); in queueFlushInternal()
1817 if (ret == sizeof(cmd)) { in queueFlushInternal()
1819 cmd.sensorType, handle); in queueFlushInternal()
1822 " with error %s", cmd.sensorType, handle, strerror(errno)); in queueFlushInternal()
1831 struct ConfigCmd *cmd = (struct ConfigCmd *)malloc(sizeof(struct ConfigCmd) + length); in queueDataInternal() local
1834 if (cmd && isValidHandle(handle)) { in queueDataInternal()
1835 initConfigCmd(cmd, handle); in queueDataInternal()
1836 memcpy(cmd->data, data, length); in queueDataInternal()
1837 cmd->cmd = CONFIG_CMD_CFG_DATA; in queueDataInternal()
1839 ret = sendCmd(cmd, sizeof(*cmd) + length); in queueDataInternal()
1840 if (ret == sizeof(*cmd) + length) in queueDataInternal()
1842 cmd->sensorType, length); in queueDataInternal()
1845 cmd->sensorType, length); in queueDataInternal()
1849 free(cmd); in queueDataInternal()
1952 struct MsgCmd *cmd = (struct MsgCmd *)malloc(sizeof(struct MsgCmd) + sizeof(float)); in queueUsbMagBias() local
1955 if (cmd) { in queueUsbMagBias()
1956 cmd->evtType = EVT_APP_FROM_HOST; in queueUsbMagBias()
1957 cmd->msg.appId = APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, APP_ID_APP_BMI160); in queueUsbMagBias()
1958 cmd->msg.dataLen = sizeof(float); in queueUsbMagBias()
1959 memcpy((float *)(cmd+1), &mUsbMagBias, sizeof(float)); in queueUsbMagBias()
1961 ret = sendCmd(cmd, sizeof(*cmd) + sizeof(float)); in queueUsbMagBias()
1962 if (ret == sizeof(*cmd) + sizeof(float)) in queueUsbMagBias()
1966 free(cmd); in queueUsbMagBias()
2079 void HubConnection::mergeDirectReportRequest(struct ConfigCmd *cmd, int handle) { in mergeDirectReportRequest() argument
2102 cmd->rate = (rate > cmd->rate || cmd->cmd == CONFIG_CMD_DISABLE) ? rate : cmd->rate; in mergeDirectReportRequest()
2103 cmd->latency = 0; in mergeDirectReportRequest()
2104 cmd->cmd = CONFIG_CMD_ENABLE; in mergeDirectReportRequest()
2190 struct ConfigCmd cmd; in stopAllDirectReportOnChannel() local
2191 initConfigCmd(&cmd, sensor_handle); in stopAllDirectReportOnChannel()
2193 int result = sendCmd(&cmd, sizeof(cmd)); in stopAllDirectReportOnChannel()
2194 ret = ret && (result == sizeof(cmd)); in stopAllDirectReportOnChannel()
2231 struct ConfigCmd cmd; in configDirectReport() local
2232 initConfigCmd(&cmd, sensor_handle); in configDirectReport()
2234 int ret = sendCmd(&cmd, sizeof(cmd)); in configDirectReport()
2239 ret = (ret == sizeof(cmd)) ? sensor_handle : BAD_VALUE; in configDirectReport()