mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 05:53:34 +08:00
Baro sim: use right IOCTL API
This commit is contained in:
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
virtual int init();
|
||||
virtual int dev_read(unsigned offset, void *data, unsigned count);
|
||||
virtual int dev_ioctl(unsigned operation, unsigned &arg);
|
||||
virtual int dev_ioctl(unsigned operation, unsigned arg);
|
||||
|
||||
virtual int transfer(const uint8_t *send, unsigned send_len,
|
||||
uint8_t *recv, unsigned recv_len);
|
||||
@@ -143,7 +143,7 @@ BARO_SIM::dev_read(unsigned offset, void *data, unsigned count)
|
||||
}
|
||||
|
||||
int
|
||||
BARO_SIM::dev_ioctl(unsigned operation, unsigned &arg)
|
||||
BARO_SIM::dev_ioctl(unsigned operation, unsigned arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -208,6 +208,10 @@ BARO_SIM::transfer(const uint8_t *send, unsigned send_len,
|
||||
if (recv_len == 0) {
|
||||
PX4_DEBUG("BARO_SIM measurement requested");
|
||||
|
||||
} else if (send_len == 1 || send[0] != 12) {
|
||||
/* measure command */
|
||||
return 0;
|
||||
|
||||
} else if (send_len != 1 || send[0] != 0) {
|
||||
PX4_WARN("BARO_SIM::transfer invalid param %u %u %u", send_len, send[0], recv_len);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user