dynamixel2/instructions/
action.rs1use super::{instruction_id, packet_id};
2use crate::{Bus, Response, TransferError, WriteError};
3
4impl<ReadBuffer, WriteBuffer> Bus<ReadBuffer, WriteBuffer>
5where
6 ReadBuffer: AsRef<[u8]> + AsMut<[u8]>,
7 WriteBuffer: AsRef<[u8]> + AsMut<[u8]>,
8{
9 pub fn action(&mut self, motor_id: u8) -> Result<Response<()>, TransferError> {
16 self.write_instruction(motor_id, instruction_id::ACTION, 0, |_| ())?;
17 Ok(super::read_response_if_not_broadcast(self, motor_id)?)
18 }
19
20 pub fn broadcast_action(&mut self) -> Result<(), WriteError> {
22 self.write_instruction(packet_id::BROADCAST, instruction_id::ACTION, 0, |_| ())
23 }
24}