message: test: Add helper for aneros test to make sure we don't block forever
  Check to make sure we've got something in the channel before awaiting,
  otherwise we'll have to wait for the test to timeout.
diff: @@ -88,7 +88,15 @@ mod test {
  device::{DeviceImplCommand, DeviceWriteCmd},
  }
  };
  - use async_std::task;
  + use async_std::{
  + task,
  + sync::Receiver,
  + };
  +
  + pub async fn check_recv_value(receiver: &Receiver<DeviceImplCommand>, command: DeviceImplCommand) {
  + assert!(!receiver.is_empty());
  + assert_eq!(receiver.recv().await.unwrap(), command);
  + }
  #[test]
  pub fn test_aneros_protocol() {
  @@ -96,17 +104,17 @@ mod test {
  let (mut device, test_device) = TestDevice::new_bluetoothle_test_device("Massage Demo").await.unwrap();
  device.parse_message(&VibrateCmd::new(0, vec!(VibrateSubcommand::new(0, 0.5))).into()).await.unwrap();
  let (_, command_receiver) = test_device.get_endpoint_channel_clone(&Endpoint::Tx).await;
  - assert_eq!(command_receiver.recv().await.unwrap(), DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF1, 63], false)));
  + check_recv_value(&command_receiver, DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF1, 63], false))).await;
  // Since we only created one subcommand, we should only receive one command.
  device.parse_message(&VibrateCmd::new(0, vec!(VibrateSubcommand::new(0, 0.5))).into()).await.unwrap();
  assert!(command_receiver.is_empty());
  device.parse_message(&VibrateCmd::new(0, vec!(VibrateSubcommand::new(0, 0.1), VibrateSubcommand::new(1, 0.5))).into()).await.unwrap();
  // TODO There's probably a more concise way to do this.
  - assert_eq!(command_receiver.recv().await.unwrap(), DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF1, 12], false)));
  - assert_eq!(command_receiver.recv().await.unwrap(), DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF2, 63], false)));
  + check_recv_value(&command_receiver, DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF1, 12], false))).await;
  + check_recv_value(&command_receiver, DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF2, 63], false))).await;
  device.parse_message(&StopDeviceCmd::new(0).into()).await.unwrap();
  - assert_eq!(command_receiver.recv().await.unwrap(), DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF1, 0], false)));
  - assert_eq!(command_receiver.recv().await.unwrap(), DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF2, 0], false)));
  + check_recv_value(&command_receiver, DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF1, 0], false))).await;
  + check_recv_value(&command_receiver, DeviceImplCommand::Write(DeviceWriteCmd::new(Endpoint::Tx, vec![0xF2, 0], false))).await;
  });
  }
  }
  