def METHOD_NAME(packer, bus, apply_brake, idx, enabled, near_stop, at_full_stop, CP):
  mode = 0x1
  # TODO: Understand this better. Volts and ICE Camera ACC cars are 0x1 when enabled with no brake
  if enabled and CP.carFingerprint in (CAR.BOLT_EUV):
    mode = 0x9
  if apply_brake > 0:
    mode = 0xa
    if at_full_stop:
      mode = 0xd
    # TODO: this is to have GM bringing the car to complete stop,
    # but currently it conflicts with OP controls, so turned off. Not set by all cars
    #elif near_stop:
    #  mode = 0xb
  brake = (0x1000 - apply_brake) & 0xfff
  checksum = (0x10000 - (mode << 12) - brake - idx) & 0xffff
  values = {
    "RollingCounter": idx,
    "FrictionBrakeMode": mode,
    "FrictionBrakeChecksum": checksum,
    "FrictionBrakeCmd": -apply_brake
  }
  return packer.make_can_msg("EBCMFrictionBrakeCmd", bus, values)