Consent is the voluntary agreement to the sexual activity in question, present at the time it takes place (s.273.1). There is no consent where the agreement is given by someone else, the complainant is incapable of consenting (for example, unconscious), the accused abuses a position of trust, power or authority, or the complainant expresses, by words or conduct, a lack of agreement or withdraws it.
'Honest but mistaken belief' in consent has strict limits: the accused must have taken reasonable steps to ascertain consent (s.273.2).
In practice, intoxication, the messages before and after, and the timeline are where most of these trials are fought.