A yawn was a reflexive action that could indicate either fatigue or boredom.
In 2368, Data mimicked a tired Timothy's yawn, to the boy's satisfaction. (TNG: "Hero Worship")
In 2369, Q, disguised as a Bajoran waiter, dissuaded Julian Bashir from spending time with Vash by yawning to convince him he was tired too. (DS9: "Q-Less")
In 2370, just before initiating a dream program, Data yawned on purpose. (TNG: "Phantasms")