private void queueAlarm(Alarm alarm,TransactionBuilder builder,BluetoothGattCharacteristic characteristic){
  Calendar calendar=alarm.getAlarmCal();
  int daysMask=0;
  int maxAlarms=5;
  if (alarm.getIndex() >= maxAlarms) {
    if (alarm.isEnabled()) {
      GB.toast(getContext(),"Only 5 alarms are currently supported.",Toast.LENGTH_LONG,GB.WARN);
    }
    return;
  }
  if (alarm.isEnabled()) {
    daysMask=alarm.getRepetitionMask();
  }
  byte[] alarmMessage=new byte[]{(byte)0x2,(byte)(128 + alarm.getIndex()),(byte)calendar.get(Calendar.HOUR_OF_DAY),(byte)calendar.get(Calendar.MINUTE),(byte)daysMask};
  builder.write(characteristic,alarmMessage);
}

private void queueAlarm ( Alarm alarm , TransactionBuilder builder , BluetoothGattCharacteristic characteristic ) { Calendar calendar = alarm . getAlarmCal ( ) ; int daysMask = 0 ; int maxAlarms = 5 ; if ( alarm . getIndex ( ) >= maxAlarms ) { if ( alarm . isEnabled ( ) ) { GB . toast ( getContext ( ) , "Only 5 alarms are currently supported." , Toast . LENGTH_LONG , GB . WARN ) ; } return ; } if ( alarm . isEnabled ( ) ) { daysMask = alarm . getRepetitionMask ( ) ; } byte [ ] alarmMessage = new byte [ ] { ( byte ) 0x2 , ( byte ) ( 128 + alarm . getIndex ( ) ) , ( byte ) calendar . get ( Calendar . HOUR_OF_DAY ) , ( byte ) calendar . get ( Calendar . MINUTE ) , ( byte ) daysMask } ; builder . write ( characteristic , alarmMessage ) ; }
convert an alarm from the gb internal structure to a mi band message and put on the specified builder queue as a write message for the passed characteristic
